From 735bcb2f55e93c0025697850635128e178958c5a Mon Sep 17 00:00:00 2001 From: andryyy Date: Thu, 3 Jun 2021 08:00:59 +0200 Subject: [PATCH] [Web] Allow to select aliases for BCC --- data/web/inc/functions.inc.php | 3 +++ data/web/js/site/mailbox.js | 6 +++--- data/web/modals/mailbox.php | 17 +++++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index f107863b..6a451cd9 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -949,6 +949,9 @@ function user_get_alias_details($username) { if (!filter_var($username, FILTER_VALIDATE_EMAIL)) { return false; } + if (!hasMailboxObjectAccess($username, $_SESSION['mailcow_cc_role'], $username)) { + return false; + } $data['address'] = $username; $stmt = $pdo->prepare("SELECT `address` AS `shared_aliases`, `public_comment` FROM `alias` WHERE `goto` REGEXP :username_goto diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index 101088c4..d008b478 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -565,13 +565,13 @@ jQuery(function($){ ft_bcc_table = FooTable.init('#bcc_table', { "columns": [ {"name":"chkbox","title":"","style":{"min-width":"60px","width":"60px"},"filterable": false,"sortable": false,"type":"html"}, - {"sorted": true,"name":"id","title":"ID","style":{"maxWidth":"60px","width":"60px","text-align":"center"}}, + {"sorted": true,"name":"id","title":"ID","style":{"min-width":"60px","width":"60px","text-align":"center"}}, {"name":"type","title":lang.bcc_type}, {"name":"local_dest","title":lang.bcc_local_dest}, {"name":"bcc_dest","title":lang.bcc_destinations}, {"name":"domain","title":lang.domain,"breakpoints":"xs sm"}, - {"name":"active","filterable": false,"style":{"maxWidth":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'':0==value&&'';}}, - {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","maxWidth":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} + {"name":"active","filterable": false,"style":{"min-width":"80px","width":"80px"},"title":lang.active,"formatter": function(value){return 1==value?'':0==value&&'';}}, + {"name":"action","filterable": false,"sortable": false,"style":{"text-align":"right","min-width":"180px","width":"180px"},"type":"html","title":lang.action,"breakpoints":"xs sm"} ], "empty": lang.empty, "rows": $.ajax({ diff --git a/data/web/modals/mailbox.php b/data/web/modals/mailbox.php index ad7d84b5..6ebd4435 100644 --- a/data/web/modals/mailbox.php +++ b/data/web/modals/mailbox.php @@ -650,25 +650,38 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
- "; foreach ($domains as $domain) { echo ""; } + echo ""; } if (!empty($alias_domains)) { + echo ""; foreach ($alias_domains as $alias_domain) { echo ""; } + echo ""; } if (!empty($domains)) { foreach ($domains as $domain) { $mailboxes = mailbox('get', 'mailboxes', $domain); foreach ($mailboxes as $mailbox) { - echo ""; + echo ""; + echo ""; + $user_alias_details = user_get_alias_details($mailbox); + foreach ($user_alias_details['direct_aliases'] as $k => $v) { + echo ""; + } + foreach ($user_alias_details['shared_aliases'] as $k => $v) { + echo ""; + } + echo ""; } } }