Avoid divide by zero ; Handle when we are called from adm_login nicely

This commit is contained in:
domi 2012-08-24 18:08:51 +00:00
parent 9d4f8e2314
commit 97923c62e1
1 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,9 @@
require_once("../class/config.php");
if (!defined("QUOTASONE")) return;
if (!isset($mode)) { # when included from adm_login, mode is not set
$mode = 0;
}
?>
<center>
@ -69,7 +72,12 @@ if (!defined("QUOTASONE")) return;
}
echo "</td></tr>";
}
$tpc = intval(100 * $domsize / $totalmail);
if ($totalmail) {
$tpc = intval(100 * $domsize / $totalmail);
} else {
$tpc = 0;
}
if (count($alias_sizes) > 0) {
echo "<tr><td><i>". _('Total'). " {$domaine}</i></td><td></td>";
echo "<td";
if ($mode!=2) echo " style=\"text-align: right\"";
@ -83,6 +91,7 @@ if (!defined("QUOTASONE")) return;
}
echo "</i></td></tr>";
}
}
?>
</tbody>
</table>