[web] fix annoucements and notifications close #4292

Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
master
Kristian Feldsam 2021-10-15 17:18:26 +02:00
parent 627e9dae7b
commit 40b5ed4d72
3 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -100,7 +100,7 @@
{% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active and not is_root_uri %}
<div class="container">
<div class="alert alert-{{ ui_texts.ui_announcement_type }}">{{ ui_texts.ui_announcement_text|rot13 }}</div>
<div class="alert alert-{{ ui_texts.ui_announcement_type }}">{{ ui_texts.ui_announcement_text }}</div>
</div>
{% 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

View File

@ -9,7 +9,7 @@
<div class="panel-heading"><i class="bi bi-person-fill"></i> {{ lang.login.login }}</div>
<div class="panel-body">
<div class="text-center mailcow-logo"><img src="{{ logo|default('/img/cow_mailcow.svg') }}" alt="mailcow"></div>
{% 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 %}
<div class="alert alert-{{ ui_texts.ui_announcement_type }} rot-enc ui-announcement-alert">{{ ui_texts.ui_announcement_text|rot13 }}</div>
{% endif %}
<legend>{% if oauth2_request %}{{ lang.oauth2.authorize_app }}{% else %}{{ ui_texts.main_name }}{% endif %}</legend>