2010-06-03 08:41:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../class/config.php");
|
|
|
|
if (!defined("QUOTASONE")) return;
|
|
|
|
|
2012-08-24 18:08:51 +00:00
|
|
|
if (!isset($mode)) { # when included from adm_login, mode is not set
|
|
|
|
$mode = 0;
|
|
|
|
}
|
2012-08-24 18:01:02 +00:00
|
|
|
?>
|
2010-06-03 08:41:37 +00:00
|
|
|
<center>
|
2012-08-24 18:01:02 +00:00
|
|
|
|
2012-09-27 10:11:48 +00:00
|
|
|
<p><h3><center><?php __("Account"); ?> <span style="font-weight: bold;"><?php echo $mem->user["login"]; ?></span></center></h3></p>
|
2012-08-24 18:01:02 +00:00
|
|
|
|
|
|
|
<div style="width: 550px">
|
|
|
|
|
|
|
|
<!-- Les esapces web -->
|
|
|
|
|
2010-06-03 08:41:37 +00:00
|
|
|
<?php
|
|
|
|
|
2012-09-27 10:11:48 +00:00
|
|
|
$totalweb = $quota->get_size_web_sum_user($mem->user["uid"]);
|
2010-06-03 08:41:37 +00:00
|
|
|
|
2012-08-24 18:01:02 +00:00
|
|
|
echo "<p>"._("Web Space:")." ";
|
|
|
|
echo sprintf("%.1f", $totalweb / 1024)." "._("MB");
|
|
|
|
echo "</p>";
|
2010-06-03 08:41:37 +00:00
|
|
|
|
|
|
|
?>
|
2012-08-24 18:01:02 +00:00
|
|
|
|
|
|
|
<!-- Les mails -->
|
|
|
|
|
2010-06-03 08:41:37 +00:00
|
|
|
<table class="tedit">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?php __("Domains"); ?></th>
|
|
|
|
<th><?php __("Emails"); ?></th>
|
|
|
|
<th><?php __("Space"); ?></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
|
2012-09-27 10:11:48 +00:00
|
|
|
$domaines_user = $dom->enum_domains($mem->user["uid"]);
|
2010-06-03 08:41:37 +00:00
|
|
|
$totalmail=0;
|
2012-08-24 18:01:02 +00:00
|
|
|
foreach ($domaines_user as $domaine) {
|
|
|
|
$mstmp = $quota->get_size_mail_sum_domain($domaine);
|
2010-06-03 08:41:37 +00:00
|
|
|
$totalmail+=$mstmp;
|
|
|
|
}
|
|
|
|
|
2012-10-18 06:17:29 +00:00
|
|
|
echo "<p>"._("Mailboxes size:")." ";
|
2012-08-24 17:16:29 +00:00
|
|
|
echo sprintf("%.1f", $totalmail / 1024)." "._("MB");
|
|
|
|
echo "</p>";
|
|
|
|
|
2012-08-24 18:01:02 +00:00
|
|
|
foreach ($domaines_user as $domaine) {
|
|
|
|
$alias_sizes = $quota->get_size_mail_details_domain($domaine);
|
|
|
|
$domsize = 0;
|
2012-08-24 17:16:29 +00:00
|
|
|
foreach ($alias_sizes as $e) {
|
2012-08-24 18:01:02 +00:00
|
|
|
$domsize += $e['size'];
|
|
|
|
echo "<tr><td>{$domaine}</td>";
|
2010-06-03 08:41:37 +00:00
|
|
|
echo "<td>".str_replace("_","@",$e["alias"])."</td>";
|
2012-08-24 18:01:02 +00:00
|
|
|
echo "<td"; if ($mode!=2) echo " style=\"text-align: right\""; echo ">";
|
2010-06-03 08:41:37 +00:00
|
|
|
$ms=$e["size"];
|
2012-08-24 18:01:02 +00:00
|
|
|
if ($totalmail) {
|
|
|
|
$pc=intval(100*$ms/$totalmail);
|
|
|
|
} else {
|
|
|
|
$pc=0;
|
|
|
|
}
|
2010-06-03 08:41:37 +00:00
|
|
|
if ($mode==0) {
|
2012-08-24 18:01:02 +00:00
|
|
|
echo sprintf("%.1f", $ms / 1024)." "._("MB");
|
2010-06-03 08:41:37 +00:00
|
|
|
} elseif ($mode==1) {
|
2012-08-24 18:01:02 +00:00
|
|
|
echo sprintf("%.1f", $pc)." %";
|
2010-06-03 08:41:37 +00:00
|
|
|
} else {
|
2012-08-24 18:01:02 +00:00
|
|
|
echo "<img src=\"hippo_bleue.gif\" style=\"width: ".(2*$pc)."px; height: 16px\" alt=\"".$pc."%\" title=\"".$pc."\"/>";
|
2010-06-03 08:41:37 +00:00
|
|
|
}
|
|
|
|
echo "</td></tr>";
|
|
|
|
}
|
2012-08-24 18:08:51 +00:00
|
|
|
if ($totalmail) {
|
|
|
|
$tpc = intval(100 * $domsize / $totalmail);
|
|
|
|
} else {
|
|
|
|
$tpc = 0;
|
|
|
|
}
|
|
|
|
if (count($alias_sizes) > 0) {
|
2012-08-24 18:01:02 +00:00
|
|
|
echo "<tr><td><i>". _('Total'). " {$domaine}</i></td><td></td>";
|
|
|
|
echo "<td";
|
|
|
|
if ($mode!=2) echo " style=\"text-align: right\"";
|
|
|
|
echo "><i>";
|
|
|
|
if ($mode==0) {
|
|
|
|
echo sprintf("%.1f", $domsize / 1024)." "._("MB");
|
|
|
|
} elseif ($mode==1) {
|
|
|
|
echo sprintf("%.1f", $tpc)." %";
|
|
|
|
} else {
|
|
|
|
echo "<img src=\"hippo_bleue.gif\" style=\"width: ".(2*$tpc)."px; height: 16px\" alt=\"".$tpc."%\" title=\"".$tpc."\"/>";
|
|
|
|
}
|
|
|
|
echo "</i></td></tr>";
|
2010-06-03 08:41:37 +00:00
|
|
|
}
|
2012-08-24 18:08:51 +00:00
|
|
|
}
|
2010-06-03 08:41:37 +00:00
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2012-08-24 18:01:02 +00:00
|
|
|
|
|
|
|
<!-- Les bases -->
|
2010-06-03 08:41:37 +00:00
|
|
|
|
2012-08-24 17:16:29 +00:00
|
|
|
<?php
|
2012-09-27 10:11:48 +00:00
|
|
|
$totaldb = $quota->get_size_db_sum_user($mem->user["login"]);
|
2012-08-24 17:16:29 +00:00
|
|
|
|
|
|
|
echo "<p>"._("Databases:")." ";
|
|
|
|
echo sprintf("%.1f", $totaldb/(1024*1024))." "._("MB");
|
|
|
|
echo "</p>";
|
|
|
|
?>
|
|
|
|
|
2010-06-03 08:41:37 +00:00
|
|
|
<table class="tedit">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?php __("DB"); ?></th>
|
|
|
|
<th><?php __("Space"); ?></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
|
2012-09-27 10:11:48 +00:00
|
|
|
$db_sizes = $quota->get_size_db_details_user($mem->user["login"]);
|
2012-08-24 17:16:29 +00:00
|
|
|
foreach ($db_sizes as $d) {
|
2010-06-03 08:41:37 +00:00
|
|
|
echo "<tr><td>".$d["db"]."</td><td";
|
|
|
|
if ($mode!=2) echo " style=\"text-align: right\"";
|
|
|
|
echo ">";
|
|
|
|
$ds=$d["size"];
|
2012-08-24 18:01:02 +00:00
|
|
|
if ($totaldb) {
|
|
|
|
$pc=intval(100*$ds/$totaldb);
|
|
|
|
} else {
|
|
|
|
$pc=0;
|
|
|
|
}
|
2012-06-19 15:26:48 +00:00
|
|
|
if (isset($mode) && $mode==0) {
|
2010-06-03 08:41:37 +00:00
|
|
|
echo sprintf("%.1f", $ds / 1024/1024)." "._("MB");
|
2012-06-19 15:26:48 +00:00
|
|
|
} elseif (isset($mode) &&$mode==1) {
|
2010-06-03 08:41:37 +00:00
|
|
|
echo sprintf("%.1f", $pc)." %";
|
|
|
|
} else {
|
|
|
|
echo "<img src=\"hippo_bleue.gif\" style=\"width: ".(2*$pc)."px; height: 16px\" alt=\"".$pc."%\" title=\"".$pc."%\"/>";
|
|
|
|
}
|
|
|
|
echo "</td></tr>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2012-08-24 18:01:02 +00:00
|
|
|
<!-- Les listes -->
|
|
|
|
|
2010-06-03 08:41:37 +00:00
|
|
|
<?php
|
2012-08-24 18:01:02 +00:00
|
|
|
$totallist = $quota->get_size_mailman_sum_user($c["uid"]);
|
2010-06-03 08:41:37 +00:00
|
|
|
if ($totallist) {
|
2012-08-24 18:01:02 +00:00
|
|
|
?>
|
2012-08-24 17:16:29 +00:00
|
|
|
|
|
|
|
<?php
|
|
|
|
echo "<p>"._("Mailman lists:")." ";
|
|
|
|
echo sprintf("%.1f", $totallist/1024)." "._("MB");
|
|
|
|
echo "</p>";
|
|
|
|
?>
|
2012-08-24 18:01:02 +00:00
|
|
|
|
2010-06-03 08:41:37 +00:00
|
|
|
<table class="tedit">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?php __("Lists"); ?></th>
|
|
|
|
<th><?php __("Space"); ?></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
|
2012-09-27 10:11:48 +00:00
|
|
|
$mailman_size = $quota->get_size_mailman_details_user($mem->user["uid"]);
|
2012-08-24 17:16:29 +00:00
|
|
|
foreach ($mailman_size as $d) {
|
2010-06-03 08:41:37 +00:00
|
|
|
echo "<tr><td>".$d["list"]."</td><td";
|
|
|
|
if ($mode!=2) echo " style=\"text-align: right\"";
|
|
|
|
echo ">";
|
|
|
|
$ds=$d["size"];
|
2012-08-24 18:01:02 +00:00
|
|
|
if ($totallist) {
|
|
|
|
$pc=intval(100*$ds/$totallist);
|
|
|
|
} else {
|
|
|
|
$pc=0;
|
|
|
|
}
|
2010-06-03 08:41:37 +00:00
|
|
|
if ($mode==0) {
|
|
|
|
echo sprintf("%.1f", $ds / 1024)." "._("MB");
|
|
|
|
} elseif ($mode==1) {
|
|
|
|
echo sprintf("%.1f", $pc)." %";
|
|
|
|
} else {
|
|
|
|
echo "<img src=\"hippo_bleue.gif\" style=\"width: ".(2*$pc)."px; height: 16px\" alt=\"".$pc."%\" title=\"".$pc."%\"/>";
|
|
|
|
}
|
|
|
|
echo "</td></tr>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2012-08-24 18:01:02 +00:00
|
|
|
<?php } /* totallist */ ?>
|
2010-06-03 08:41:37 +00:00
|
|
|
</div>
|
|
|
|
</center>
|