From 40b5ed4d7246bb868282c6381802e4dad04a452f Mon Sep 17 00:00:00 2001 From: Kristian Feldsam Date: Fri, 15 Oct 2021 17:18:26 +0200 Subject: [PATCH] [web] fix annoucements and notifications close #4292 Signed-off-by: Kristian Feldsam --- data/web/inc/footer.inc.php | 2 +- data/web/templates/base.twig | 6 +++--- data/web/templates/index.twig | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/web/inc/footer.inc.php b/data/web/inc/footer.inc.php index a0d6ef1b..3d4b3c33 100644 --- a/data/web/inc/footer.inc.php +++ b/data/web/inc/footer.inc.php @@ -12,7 +12,7 @@ $alertbox_log_parser = alertbox_log_parser($_SESSION); $alerts = []; if (is_array($alertbox_log_parser)) { foreach ($alertbox_log_parser as $log) { - $alert[$log['type']][] = $log['msg']; + $alerts[trim($log['type'], '"')][] = trim($log['msg'], '"'); } $alert = array_filter(array_unique($alerts)); foreach($alert as $alert_type => $alert_msg) { diff --git a/data/web/templates/base.twig b/data/web/templates/base.twig index 1c9a5a3f..41816cb2 100644 --- a/data/web/templates/base.twig +++ b/data/web/templates/base.twig @@ -100,7 +100,7 @@ {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active and not is_root_uri %}
-
{{ ui_texts.ui_announcement_text|rot13 }}
+
{{ ui_texts.ui_announcement_text }}
{% endif %} @@ -169,8 +169,8 @@ function recursiveBase64StrToArrayBuffer(obj) { }); // TFA, CSRF, Alerts in footer.inc.php // Other general functions in mailcow.js - {% for alert_type, alert_msg in aletrs %} - mailcow_alert_box(alert_msg, alert_type); + {% for alert_type, alert_msg in alerts %} + mailcow_alert_box("{{ alert_msg }}", "{{ alert_type }}"); {% endfor %} // Confirm TFA modal diff --git a/data/web/templates/index.twig b/data/web/templates/index.twig index e0876054..ec7dcc8c 100644 --- a/data/web/templates/index.twig +++ b/data/web/templates/index.twig @@ -9,7 +9,7 @@
{{ lang.login.login }}
- {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active and not is_root_uri %} + {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active %}
{{ ui_texts.ui_announcement_text|rot13 }}
{% endif %} {% if oauth2_request %}{{ lang.oauth2.authorize_app }}{% else %}{{ ui_texts.main_name }}{% endif %}