array ("get", "integer" ,0), "sd" => array ("get", "integer" ,0), "usr" => array ("get", "integer" ,0), "order" => array ("get", "integer" ,0), ); getFields($fields); if (!$admin->enabled) { __("This page is restricted to authorized staff"); exit(); } include_once ("head.php"); ?>



$error

"; } ?>


"; printf(_("If you want to manage them, go to")." "._("Administration -> Manage the Alternc accounts").""); ?>



get_list(0, $cuid); foreach ($membres_list as $n) { $domList = $dom->enum_domains($n["uid"]); $mList[$n["uid"]] = array ( "login" => $n["login"], "domaines" => $domList, ); } $totalweb = 0; $totalmail = 0; $totallist = 0; $totaldb = 0; $dc = 0; $mc = 0; $mlc = 0; $dbc = 0; foreach ($mList as $mUID => $mData) { $tmpweb = $quota->get_size_web_sum_user($mUID); $totalweb += $tmpweb; if (!empty($mData["domaines"])) { foreach ($mData["domaines"] as $domaine) { $dc++; $tmpmail = $quota->get_size_mail_sum_domain($domaine); $totalmail += $tmpmail; $mc = $quota->get_size_mail_count_domain($domaine); $tmplist = $quota->get_size_mailman_sum_domain($domaine); $totallist += $tmplist; } } $mlc = $quota->get_size_mailman_count_user($mUID); $tmpdb = $quota->get_size_db_sum_user($mData["login"]); $totaldb += $tmpdb; $dbc = $quota->get_size_db_count_user($mData["login"]); } $tmptotal=$totalweb+$totallist+$totalmail+($totaldb/1024); $totaltotal=$quota->get_size_unit($tmptotal); } else { $tmptotalweb = $quota->get_size_web_sum_all(); // In KB $totalweb=$quota->get_size_unit($tmptotalweb * 1024); $tmptotalmail = $quota->get_size_mail_sum_all(); // In B $totalmail=$quota->get_size_unit($tmptotalmail); $tmptotallist = $quota->get_size_mailman_sum_all(); // IN KB $totallist=$quota->get_size_unit($tmptotallist * 1024); $tmptotaldb = $quota->get_size_db_sum_all(); // IN B $totaldb=$quota->get_size_unit($tmptotaldb); $tmptotaltotal=($tmptotalweb*1024)+($tmptotallist*1024)+$tmptotalmail+($tmptotaldb/1024); // IN B $totaltotal=$quota->get_size_unit($tmptotaltotal); $dc = $dom->count_domains_all(); $mc = $quota->get_size_mail_count_all(); $mlc = $quota->get_size_mailman_count_all(); $dbc = $quota->get_size_db_count_all(); } ?>
 
"; echo $txt; echo ""; echo "     "; if ($order==$asc) echo "\"sorted"; if ($order==$desc) echo "\"sorted"; } ?>
get_list(0, $cuid); foreach ($membres_list as $minfo) { $domList = $dom->enum_domains($minfo['uid']); $mList[$muid] = array ( "login" => $minfo['login'], "domaines" => $domList, ); } $totalweb = 0; $totalmail = 0; $totallist = 0; $totaldb = 0; $dc = 0; $mc = 0; $mlc = 0; $dbc = 0; foreach ($mList as $mUID => $mData) { $tmpweb = $quota->get_size_web_sum_user($mUID); $totalweb += $tmpweb; if (!empty($mData["domaines"])) { foreach ($mData["domaines"] as $domaine) { $dc++; $tmpmail = $quota->get_size_mail_sum_domain($domaine); $totalmail += $tmpmail; $mc = $quota->get_size_mail_count_domain($domaine); $tmplist = $quota->get_size_mailman_sum_domain($domaine); $totallist += $tmplist; } } $mlc = $quota->get_size_mailman_count_user($mUID); $tmpdb = $quota->get_size_db_sum_user($mData["login"]); $totaldb += $tmpdb; $dbc = $quota->get_size_db_count_user($mData["login"]); } } else { $totalweb = $quota->get_size_web_sum_all(); $totalmail = $quota->get_size_mail_sum_all(); $totallist = $quota->get_size_mailman_sum_all(); $totaldb = $quota->get_size_db_sum_all(); } $totaltotal=$totalweb+$totallist+($totalmail/1024)+($totaldb/1024); // In KB if ($totaltotal==0) $totaltotal=1; if ($cuid != 2000) { $membres_list = $admin->get_list(0, $cuid); } else { $membres_list = $admin->get_list(1); } // ------------------------------------------------------------ // LOOP ON EACH MEMBER $all=array(); foreach ($membres_list as $c) { $one=$c; // On affiche le compte et ses domaines : $domaines_list = $dom->enum_domains($c["uid"]); $dc=0; // Domain Count $ms=0; // Mail Space $mls=0; $one["domains"]=array(); foreach ($domaines_list as $d) { $dc++; $one["domains"][]=$d; $mstmp = $quota->get_size_mail_sum_domain($d); $ms+=$mstmp; $mlstmp = $quota->get_size_mailman_sum_domain($d); $mls+=$mlstmp; } $one["mailsize"]=$ms; $one["mailmainsize"]=$mls; // Mail Count $maildomains_list = $mail->enum_domains($c["uid"]); $mc = 0; foreach ($maildomains_list as $md) { $mc += $md['nb_mail']; } $one["mailcount"]=$mc; $one["domaincount"]=$dc; // Mailman List Count if (isset($mailman)) { $mlc = $mailman->count_ml_user($c["uid"]); $one["mailmancount"]=$mlc; } // Espace WEB $ws = $quota->get_size_web_sum_user($c["uid"]); $one["websize"]=$ws; // Espace Mail : // Espace DB : $ds = $quota->get_size_db_sum_user($c["login"]); $one["dbsize"]=$ds; $ts=$ds/1024+$ws+$ms/1024+$mls; // In KB $one["totalsize"]=$ts; $all[]=$one; } // SORT this $all array $asc=(($order%2)==0); $fie=$afields[intval($order/2)]; function mysort($a,$b) { global $fie,$asc; if ($asc) { if ($a[$fie]<$b[$fie]) return -1; if ($a[$fie]>$b[$fie]) return 1; return 0; } else { if ($a[$fie]<$b[$fie]) return 1; if ($a[$fie]>$b[$fie]) return -1; return 0; } } usort($all,"mysort"); // ------------------------------------------------------------ // LOOP ON EACH MEMBER foreach ($all as $c) { echo ""; if ($mode==0) { echo sprintf("%.1f", $webspace['size'])." ".$webspace['unit']; } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { #echo "\"".$pc."%\""; $quota->quota_displaybar($pc); } echo ""; // Espace Mail : if ($totalmail) $pc=intval(100*$ms/$totalmail); else $pc=0; if ($mode==0) { echo sprintf("%.1f", $mailsize['size'])." ".$mailsize['unit']; } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { #echo "\"".$pc."%\""; $quota->quota_displaybar($pc); } echo ""; // Espace Mailman : if ($totallist) $pc=intval(100*$mls/$totallist); else $pc=0; if ($mode==0) { echo sprintf("%.1f", $mailmansize['size'])." ".$mailmansize['unit']; } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { #echo "\"".$pc."%\""; $quota->quota_displaybar($pc); } echo ""; // Espace DB : $ds = $c["dbsize"]; $dbsize=$quota->get_size_unit($ds); if ($totaldb) $pc=intval(100*$ds/$totaldb); else $pc=0; if ($mode==0) { echo sprintf("%.1f", $dbsize['size'])." ".$dbsize['unit']; } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { #echo "\"".$pc."%\""; $quota->quota_displaybar($pc); } echo ""; $ts=$c["totalsize"]; $totalsize=$quota->get_size_unit($ts * 1024); if ($mode==0) { echo sprintf("%.1f", $totalsize['size'])." ".$totalsize['unit']; } elseif ($mode==1) { echo sprintf("%.1f",(100*$ts/$totaltotal))." %"; } else { if ($totaltotal) { $pc=intval(100*$ts/$totaltotal); } else { $pc=0; } #echo "\"".$pc."%\""; $quota->quota_displaybar($pc); } echo ""; echo ""; } ?>
"; // On affiche le compte et ses domaines : echo "".$c["login"]."
\n"; $domaines_list = $dom->enum_domains($c["uid"]); $dc=0; // Domain Count $ms=0; // Mail Space $mls=0; foreach ($c["domains"] as $d) { if ($sd) echo "   - {$d}
\n"; } $ms=$c["mailsize"]; $mls=$c["mailmansize"]; $mailsize=$quota->get_size_unit($ms); $mailmansize=$quota->get_size_unit($mls); // Espace WEB $ws = $c["websize"]; $webspace=$quota->get_size_unit($ws * 1024); if (isset($totalweb) && $totalweb){ $pc=intval(100*$ws/$totalweb); } else { $pc=0; } $dc=$c["domaincount"]; $mc=$c["mailcount"]; $mlc=$c["mailmancount"]; echo "
$dc$mc$mlc
get($usr); $mcreator = $admin->get_creator($c['uid']); if ($mcreator['uid'] == $cuid) { $oneuser_ok = true; } } else { $c = $admin->get($usr); if ($c != false) { $oneuser_ok = true; } } if ($oneuser_ok) { # quotas_oneuser.php will used prefilled $c define("QUOTASONE","1"); require_once("quotas_oneuser.php"); } } // endif un seul compte ?>