functions.inc.php

- allowed_quota: if $CONF[quota] == NO, just return 0 (unlimited)

list-virtual.php:
- only eval_size($limit['maxquota']) if $CONF[quota] == YES
  ($limit['maxquota'] is not set if $CONF[quota] == NO)

Both issues (which caused PHP warnings) were found by TigerP on IRC


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1445 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 12 years ago
parent 2091c50662
commit 68390b0201

@ -648,6 +648,10 @@ function check_quota ($quota, $domain, $username="") {
* @return Integer allowed maximum quota (in MB)
*/
function allowed_quota($domain, $current_user_quota) {
if ( !boolconf('quota') ) {
return 0; # quota disabled means no limits - no need for more checks
}
$domain_properties = get_domain_properties($domain);
$tMaxquota = $domain_properties['maxquota'];

@ -288,7 +288,9 @@ if (isset ($limit)) {
$limit ['aliases'] = eval_size ($limit ['aliases']);
$limit ['mailboxes'] = eval_size ($limit ['mailboxes']);
$limit ['maxquota'] = eval_size ($limit ['maxquota']);
if (boolconf('quota')) {
$limit ['maxquota'] = eval_size ($limit ['maxquota']);
}
}
$gen_show_status = array ();

Loading…
Cancel
Save