git subrepo commit mailcow/src/mailcow-dockerized
subrepo: subdir: "mailcow/src/mailcow-dockerized"
merged: "308860af"
upstream: origin: "https://github.com/mailcow/mailcow-dockerized.git"
branch: "master"
commit: "3f1a5af8"
git-subrepo: version: "0.4.5"
origin: "???"
commit: "???"
Change-Id: I5d51c14b45db54fe706be40a591ddbfcea50d4b0
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php b/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php
index de1b22c..16c5c03 100644
--- a/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/functions.customize.inc.php
@@ -2,8 +2,18 @@
function customize($_action, $_item, $_data = null) {
global $redis;
global $lang;
+
switch ($_action) {
case 'add':
+ // disable functionality when demo mode is enabled
+ if ($GLOBALS["DEMO_MODE"]) {
+ $_SESSION['return'][] = array(
+ 'type' => 'danger',
+ 'log' => array(__FUNCTION__, $_action, $_item, $_data),
+ 'msg' => 'demo_mode_enabled'
+ );
+ return false;
+ }
if ($_SESSION['mailcow_cc_role'] != "admin") {
$_SESSION['return'][] = array(
'type' => 'danger',
@@ -72,6 +82,15 @@
}
break;
case 'edit':
+ // disable functionality when demo mode is enabled
+ if ($GLOBALS["DEMO_MODE"]) {
+ $_SESSION['return'][] = array(
+ 'type' => 'danger',
+ 'log' => array(__FUNCTION__, $_action, $_item, $_data),
+ 'msg' => 'demo_mode_enabled'
+ );
+ return false;
+ }
if ($_SESSION['mailcow_cc_role'] != "admin") {
$_SESSION['return'][] = array(
'type' => 'danger',
@@ -116,6 +135,7 @@
$ui_announcement_text = $_data['ui_announcement_text'];
$ui_announcement_type = (in_array($_data['ui_announcement_type'], array('info', 'warning', 'danger'))) ? $_data['ui_announcement_type'] : false;
$ui_announcement_active = (!empty($_data['ui_announcement_active']) ? 1 : 0);
+
try {
$redis->set('TITLE_NAME', htmlspecialchars($title_name));
$redis->set('MAIN_NAME', htmlspecialchars($main_name));
@@ -143,6 +163,15 @@
}
break;
case 'delete':
+ // disable functionality when demo mode is enabled
+ if ($GLOBALS["DEMO_MODE"]) {
+ $_SESSION['return'][] = array(
+ 'type' => 'danger',
+ 'log' => array(__FUNCTION__, $_action, $_item, $_data),
+ 'msg' => 'demo_mode_enabled'
+ );
+ return false;
+ }
if ($_SESSION['mailcow_cc_role'] != "admin") {
$_SESSION['return'][] = array(
'type' => 'danger',