From 5b4b184778ac04bd90fb2745d6d5a19f8423d7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 23 Aug 2018 08:49:02 +0200 Subject: [PATCH] [Web] Fixes to mailcow logo (stickers are coming!) [Web] Fix adding multiple domain aliases, fixes #1705 --- data/web/img/cow_mailcow.svg | 316 ++++++++++++------------- data/web/inc/functions.mailbox.inc.php | 42 ++-- 2 files changed, 174 insertions(+), 184 deletions(-) diff --git a/data/web/img/cow_mailcow.svg b/data/web/img/cow_mailcow.svg index d45778214..6ba98e466 100644 --- a/data/web/img/cow_mailcow.svg +++ b/data/web/img/cow_mailcow.svg @@ -1,5 +1,5 @@ - + image/svg+xml \ No newline at end of file + id="white_1_"> \ No newline at end of file diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 200ff0ae3..b17e204f5 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -637,7 +637,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); return false; } - foreach ($alias_domains as $i => &$alias_domain) { + foreach ($alias_domains as $i => $alias_domain) { $alias_domain = idn_to_ascii(strtolower(trim($alias_domain))); if (!is_valid_domain_name($alias_domain)) { $_SESSION['return'][] = array( @@ -680,30 +680,30 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); continue; } - } - $stmt = $pdo->prepare("INSERT INTO `alias_domain` (`alias_domain`, `target_domain`, `active`) - VALUES (:alias_domain, :target_domain, :active)"); - $stmt->execute(array( - ':alias_domain' => $alias_domain, - ':target_domain' => $target_domain, - ':active' => $active - )); - try { - $redis->hSet('DOMAIN_MAP', $alias_domain, 1); - } - catch (RedisException $e) { + $stmt = $pdo->prepare("INSERT INTO `alias_domain` (`alias_domain`, `target_domain`, `active`) + VALUES (:alias_domain, :target_domain, :active)"); + $stmt->execute(array( + ':alias_domain' => $alias_domain, + ':target_domain' => $target_domain, + ':active' => $active + )); + try { + $redis->hSet('DOMAIN_MAP', $alias_domain, 1); + } + catch (RedisException $e) { + $_SESSION['return'][] = array( + 'type' => 'danger', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => array('redis_error', $e) + ); + return false; + } $_SESSION['return'][] = array( - 'type' => 'danger', + 'type' => 'success', 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), - 'msg' => array('redis_error', $e) + 'msg' => array('aliasd_added', htmlspecialchars($alias_domain)) ); - return false; } - $_SESSION['return'][] = array( - 'type' => 'success', - 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), - 'msg' => array('aliasd_added', htmlspecialchars($alias_domain)) - ); break; case 'mailbox': $local_part = strtolower(trim($_data['local_part']));