diff --git a/bureau/admin/quotas_users.php b/bureau/admin/quotas_users.php index 0c5b5d40..3085a7fd 100644 --- a/bureau/admin/quotas_users.php +++ b/bureau/admin/quotas_users.php @@ -55,15 +55,9 @@ if (isset($error) && $error) { if ($cuid != 2000) { $mList = array(); - $res = mysql_query("SELECT * FROM membres WHERE creator = '" . $cuid . "'"); - while ($n = @mysql_fetch_array($res)) - { - $domList = array(); - $res2 = mysql_query("SELECT * FROM domaines WHERE compte = '" . $n["uid"] . "'"); - while ($n2 = @mysql_fetch_array($res2)) - { - $domList[] = $n2["domaine"]; - } + $membres_list = $admin->get_list(0, $cuid); + foreach ($membres_list as $n) { + $domList = $dom->enum_domains($n["uid"]); $mList[$n["uid"]] = array ( "login" => $n["login"], "domaines" => $domList, @@ -110,7 +104,7 @@ if (isset($error) && $error) { $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko - list($dc)=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM domaines;")); + $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(); @@ -180,17 +174,11 @@ if (isset($error) && $error) { if ($cuid != 2000) { $mList = array(); - $res = mysql_query("SELECT * FROM membres WHERE creator = '" . $cuid . "'"); - while ($n = @mysql_fetch_array($res)) - { - $domList = array(); - $res2 = mysql_query("SELECT * FROM domaines WHERE compte = '" . $n["uid"] . "'"); - while ($n2 = @mysql_fetch_array($res2)) - { - $domList[] = $n2["domaine"]; - } - $mList[$n["uid"]] = array ( - "login" => $n["login"], + $membres_list = $admin->get_list(0, $cuid); + foreach ($membres_list as $minfo) { + $domList = $dom->enum_domains($minfo['uid']); + $mList[$muid] = array ( + "login" => $minfo['login'], "domaines" => $domList, ); } @@ -218,7 +206,7 @@ if ($cuid != 2000) } } - $mlc = $quota->get_size_mailman_count_domain($mUID); + $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"]); @@ -236,38 +224,39 @@ else $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko if ($totaltotal==0) $totaltotal=1; -if ($cuid != 2000) -{ - $r = mysql_query("SELECT * FROM membres WHERE creator = '" . $cuid . "' ORDER BY login;"); -} -else -{ - $r=mysql_query("SELECT * FROM membres ORDER BY login;"); +if ($cuid != 2000) { + $membres_list = $admin->get_list(0, $cuid); +} else { + $membres_list = $admin->get_list(1); } -while ($c=mysql_fetch_array($r)) { +foreach ($membres_list as $c) { echo "