admin/list-virtual.php: correctly display add mailbox or add alias links for a domain as appropriate (not if it is a backup mx or inactive or alias/mailbox limit has been reached

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@109 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 17 years ago
parent 568f49a1f7
commit 4e4af1a099

@ -55,7 +55,6 @@ else
if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[0];
$limit = get_domain_properties ($fDomain);
if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDomain)) $fDomain = $list_domains[1];
@ -116,22 +115,46 @@ if ($result['rows'] > 0)
}
}
if (isset ($limit))
{
if ($fDisplay >= $page_size)
{
$tCanAddAlias = false;
$tCanAddMailbox = false;
$limit = get_domain_properties($fDomain);
if (isset ($limit)) {
if ($fDisplay >= $page_size) {
$tDisplay_back_show = 1;
$tDisplay_back = $fDisplay - $page_size;
}
if (($limit['alias_count'] > $page_size) or ($limit['mailbox_count'] > $page_size))
{
if (($limit['alias_count'] > $page_size) or ($limit['mailbox_count'] > $page_size)) {
$tDisplay_up_show = 1;
}
if ((($fDisplay + $page_size) < $limit['alias_count']) or (($fDisplay + $page_size) < $limit['mailbox_count']))
if ((($fDisplay + $page_size) < $limit['alias_count']) or
(($fDisplay + $page_size) < $limit['mailbox_count']))
{
$tDisplay_next_show = 1;
$tDisplay_next = $fDisplay + $page_size;
}
$active = $limit['active'];
if($active == 't' || $active == 1) {
$backup_mx = $limit['backupmx'];
if($backup_mx == 'f' || $backup_mx == 0) {
if($limit['aliases'] == -1) {
$tCanAddAlias = true;
}
elseif($limit['alias_count'] < $limit['aliases']) {
$tCanAddAlias = true;
echo 'xxx2';
}
if($limit['mailboxes'] == -1) {
$tCanAddMailbox = true;
echo 'xxx3';
}
elseif($limit['mailbox_count'] < $limit['mailboxes']) {
$tCanAddMailbox = true;
echo 'xxx4';
}
}
}
}

Loading…
Cancel
Save