From 9274b7b8e1399c2bce488c051ab3b0261bb486f4 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 22 Aug 2020 22:59:13 +0200 Subject: [PATCH] [Web] Allow to set force_pw_update, tls_enforce_in, tls_enforce_out, sogo_access and quarantine_notification when adding a domain (via API) --- data/web/inc/functions.mailbox.inc.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index d69c6f08..1206d27e 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -937,15 +937,20 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { $name = $local_part; } $active = intval($_data['active']); + $force_pw_update = (isset($_data['force_pw_update'])) ? intval($_data['force_pw_update']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update']); + $tls_enforce_in = (isset($_data['tls_enforce_in'])) ? intval($_data['tls_enforce_in']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in']); + $tls_enforce_out = (isset($_data['tls_enforce_out'])) ? intval($_data['tls_enforce_out']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_out']); + $sogo_access = (isset($_data['sogo_access'])) ? intval($_data['sogo_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['sogo_access']); + $quarantine_notification = (isset($_data['quarantine_notification'])) ? strval($_data['quarantine_notification']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']); $quota_b = ($quota_m * 1048576); $mailbox_attrs = json_encode( array( - 'force_pw_update' => strval(intval($MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update'])), - 'tls_enforce_in' => strval(intval($MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in'])), - 'tls_enforce_out' => strval(intval($MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_out'])), - 'sogo_access' => (!isset($_SESSION['acl']['sogo_access']) || $_SESSION['acl']['sogo_access'] != "1") ? 0 : strval(intval($MAILBOX_DEFAULT_ATTRIBUTES['sogo_access'])), + 'force_pw_update' => strval($force_pw_update), + 'tls_enforce_in' => strval($tls_enforce_in), + 'tls_enforce_out' => strval($tls_enforce_out), + 'sogo_access' => strval($sogo_access), 'mailbox_format' => strval($MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format']), - 'quarantine_notification' => strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']) + 'quarantine_notification' => strval($quarantine_notification) ) ); if (!is_valid_domain_name($domain)) {