From 48838d9fd7550df3da844a82e1e18f2f18cad2ee Mon Sep 17 00:00:00 2001 From: heavygale Date: Sat, 5 Oct 2019 18:07:46 +0200 Subject: [PATCH] Don't update sogo_access when editing without acl Disabled checkboxes send 0 even if checked -> don't change sogo_access at all, if mailbox gets edited by domain admin without sogo_access acl. --- data/web/inc/functions.mailbox.inc.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 8c7690a4..1bdd4fbb 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -2065,7 +2065,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { if (!empty($is_now)) { $active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active_int']; (int)$force_pw_update = (isset($_data['force_pw_update'])) ? intval($_data['force_pw_update']) : intval($is_now['attributes']['force_pw_update']); - (int)$sogo_access = (isset($_data['sogo_access'])) ? intval($_data['sogo_access']) : intval($is_now['attributes']['sogo_access']); + (int)$sogo_access = (isset($_data['sogo_access']) && isset($_SESSION['acl']['sogo_access']) && $_SESSION['acl']['sogo_access'] == "1") ? intval($_data['sogo_access']) : intval($is_now['attributes']['sogo_access']); (int)$quota_m = (isset_has_content($_data['quota'])) ? intval($_data['quota']) : ($is_now['quota'] / 1048576); $name = (!empty($_data['name'])) ? ltrim(rtrim($_data['name'], '>'), '<') : $is_now['name']; $domain = $is_now['domain']; @@ -2119,16 +2119,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); continue; } - // if already 1 == ok - if ((!isset($_SESSION['acl']['sogo_access']) || $_SESSION['acl']['sogo_access'] != "1") && - (intval($_data['sogo_access']) == 1 && intval($is_now['attributes']['sogo_access'] != 1))) { - $_SESSION['return'][] = array( - 'type' => 'danger', - 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), - 'msg' => 'access_denied' - ); - return false; - } $extra_acls = array(); if (isset($_data['extended_sender_acl'])) { if (!isset($_SESSION['acl']['extend_sender_acl']) || $_SESSION['acl']['extend_sender_acl'] != "1" ) {