list mailbox, alias/forwarder by domain using extra parameter

master
Gamal Abdul Nasser 2019-11-07 10:37:09 +07:00
parent 15f3a664cd
commit cf1e633b1a
1 changed files with 12 additions and 2 deletions

View File

@ -601,7 +601,12 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
case "mailbox":
switch ($object) {
case "all":
$domains = mailbox('get', 'domains');
if(empty($extra)) {
$domains = mailbox('get', 'domains');
}
else {
$domains = [ $extra ];
}
if (!empty($domains)) {
foreach ($domains as $domain) {
$mailboxes = mailbox('get', 'mailboxes', $domain);
@ -940,7 +945,12 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u
case "alias":
switch ($object) {
case "all":
$domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains'));
if(empty($extra)) {
$domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains'));
}
else {
$domains = [ $extra ];
}
if (!empty($domains)) {
foreach ($domains as $domain) {
$aliases = mailbox('get', 'aliases', $domain);