diff --git a/bureau/admin/quotas_oneuser.php b/bureau/admin/quotas_oneuser.php
index 841656ff..48aba603 100644
--- a/bureau/admin/quotas_oneuser.php
+++ b/bureau/admin/quotas_oneuser.php
@@ -55,11 +55,9 @@ if (!isset($mode)) { # when included from adm_login, mode is not set
foreach ($domaines_user as $domaine) {
$alias_sizes = $quota->get_size_mail_details_domain($domaine);
$domsize = 0;
- $d = $quota->get_size_unit($domsize);
foreach ($alias_sizes as $e) {
if($e['size'] > 0) {
$domsize += $e['size'];
- $d = $quota->get_size_unit($domsize);
echo "
{$domaine} | ";
echo "".str_replace("_","@",$e["alias"])." | ";
echo "";
@@ -79,6 +77,9 @@ if (!isset($mode)) { # when included from adm_login, mode is not set
echo " |
";
}
}
+
+ $d = $quota->get_size_unit($domsize);
+
if ($totalmail) {
$tpc = intval(100 * $domsize / $totalmail);
} else {
diff --git a/bureau/admin/quotas_users.php b/bureau/admin/quotas_users.php
index 7c4fabf2..5ef6ffb2 100644
--- a/bureau/admin/quotas_users.php
+++ b/bureau/admin/quotas_users.php
@@ -89,20 +89,29 @@ if (isset($error) && $error) {
$mlc = $quota->get_size_mailman_count_user($mUID);
$tmpdb = $quota->get_size_db_sum_user($mData["login"]);
- $totaldb += $tmpdb;
+ $totaldb += $tmpdb;
$dbc = $quota->get_size_db_count_user($mData["login"]);
}
- $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko
+ $tmptotal=$totalweb+$totallist+$totalmail+($totaldb/1024);
+ $totaltotal=$quota->get_size_unit($tmptotal);
}
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();
+ $tmptotalweb = $quota->get_size_web_sum_all(); // In KB
+ $totalweb=$quota->get_size_unit($tmptotalweb * 1024);
- $totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko
+ $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();
@@ -121,28 +130,28 @@ if (isset($error) && $error) {
|
|
- Mo |
+ |
|
|
- Mo |
+ |
|
|
- Mo |
+ |
|
|
- Mo |
+ |
|
- Mo |
+ |
@@ -189,7 +198,7 @@ if ($cuid != 2000)
foreach ($mList as $mUID => $mData)
{
$tmpweb = $quota->get_size_web_sum_user($mUID);
- $totalweb += $tmpweb;
+ $totalweb += $tmpweb;
if (!empty($mData["domaines"]))
{
@@ -197,18 +206,18 @@ if ($cuid != 2000)
{
$dc++;
- $tmpmail = $quota->get_size_mail_sum_domain($domaine);
+ $tmpmail = $quota->get_size_mail_sum_domain($domaine);
$totalmail += $tmpmail;
- $mc = $quota->get_size_mail_count_domain($domaine);
+ $mc = $quota->get_size_mail_count_domain($domaine);
- $tmplist = $quota->get_size_mailman_sum_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;
+ $totaldb += $tmpdb;
$dbc = $quota->get_size_db_count_user($mData["login"]);
}
@@ -221,7 +230,7 @@ else
$totaldb = $quota->get_size_db_sum_all();
}
-$totaltotal=$totalweb+$totallist+$totalmail+($totaldb/1024); // en Ko
+$totaltotal=$totalweb+$totallist+($totalmail/1024)+($totaldb/1024); // In KB
if ($totaltotal==0) $totaltotal=1;
if ($cuid != 2000) {
@@ -249,6 +258,13 @@ foreach ($membres_list as $c) {
$mls+=$mlstmp;
}
+ $mailsize=$quota->get_size_unit($ms);
+
+ if($mls != 0)
+ $mailmansize=$quota->get_size_unit($mls);
+ else
+ $mailmansize=$quota->get_size_unit($quota->get_size_mailman_sum_user($c["uid"]) * 1024);
+
// Mail Count
$maildomains_list = $mail->enum_domains($c["uid"]);
$mc = 0;
@@ -256,17 +272,15 @@ foreach ($membres_list as $c) {
$mc += $md['nb_mail'];
}
-if (isset($mailman)) {
// Mailman List Count
$mlc = $mailman->count_ml_user($c["uid"]);
echo "$dc | $mc | $mlc | ";
-} // isset mailman
// Espace WEB
$ws = $quota->get_size_web_sum_user($c["uid"]);
-
+ $webspace=$quota->get_size_unit($ws * 1024);
if (isset($totalweb) && $totalweb){
$pc=intval(100*$ws/$totalweb);
}
@@ -275,7 +289,7 @@ if (isset($mailman)) {
}
if ($mode==0) {
- echo sprintf("%.1f", $ws / 1024)." "._("MB");
+ echo sprintf("%.1f", $webspace['size'])." ".$webspace['unit'];
} elseif ($mode==1) {
echo sprintf("%.1f",$pc)." %";
} else {
@@ -293,7 +307,7 @@ else
$pc=0;
if ($mode==0) {
- echo sprintf("%.1f", $ms / 1024)." Mo";
+ echo sprintf("%.1f", $mailsize['size'])." ".$mailsize['unit'];
} elseif ($mode==1) {
echo sprintf("%.1f",$pc)." %";
} else {
@@ -311,7 +325,7 @@ else
$pc=0;
if ($mode==0) {
- echo sprintf("%.1f", $mls / 1024)." "._("MB");
+ echo sprintf("%.1f", $mailmansize['size'])." ".$mailmansize['unit'];
} elseif ($mode==1) {
echo sprintf("%.1f",$pc)." %";
} else {
@@ -324,6 +338,7 @@ echo ">";
// Espace DB :
$ds = $quota->get_size_db_sum_user($c["login"]);
+$dbsize=$quota->get_size_unit($ds);
if ($totaldb)
$pc=intval(100*$ds/$totaldb);
@@ -331,7 +346,7 @@ else
$pc=0;
if ($mode==0) {
- echo sprintf("%.1f", $ds / 1024/1024)." "._("MB");
+ echo sprintf("%.1f", $dbsize['size'])." ".$dbsize['unit'];
} elseif ($mode==1) {
echo sprintf("%.1f",$pc)." %";
} else {
@@ -342,9 +357,10 @@ echo " | ";
-$ts=$ds/1024+$ws+$ms+$mls;
+$ts=$ds/1024+$ws+$ms/1024+$mls; // In KB
+$totalsize=$quota->get_size_unit($ts * 1024);
if ($mode==0) {
- echo sprintf("%.1f", $ts/1024)." "._("MB");
+ echo sprintf("%.1f", $totalsize['size'])." ".$totalsize['unit'];
} elseif ($mode==1) {
echo sprintf("%.1f",(100*$ts/$totaltotal))." %";
} else {
|