From 8261933bec7d6009e392f64aec7371dabb5149a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Sat, 6 Dec 2014 21:40:16 +0100 Subject: [PATCH] try to prevent hint duplication --- includes/pages/admin_news.php | 2 +- includes/pages/admin_user.php | 1 + public/index.php | 24 +++++++++++------------- templates/user_shifts.html | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php index a83e0d70..0653a045 100644 --- a/includes/pages/admin_news.php +++ b/includes/pages/admin_news.php @@ -5,7 +5,7 @@ function admin_news() { if (! isset($_GET["action"])) { redirect(page_link_to("news")); } else { - $html = '

' . _("Edit news entry") . '

'; + $html = '

' . _("Edit news entry") . '

' . msg(); if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) $id = $_REQUEST['id']; else diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index b2275b52..87190857 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -264,6 +264,7 @@ function admin_user() { } } } else { + msg(); redirect(page_link_to('users')); } diff --git a/public/index.php b/public/index.php index f6dca310..03bc3869 100644 --- a/public/index.php +++ b/public/index.php @@ -90,32 +90,30 @@ if (! isset($_REQUEST['p'])) if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (in_array($_REQUEST['p'], $free_pages) || in_array($_REQUEST['p'], $privileges))) { $p = $_REQUEST['p']; + $title = $p; + $content = ""; + if (isset($user)) { - $hints = ""; - if (User_is_freeloader($user)) error(sprintf(_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."), $max_freeloadable_shifts)); - - // Hinweis für Engel, die noch nicht angekommen sind + + // Hinweis für Engel, die noch nicht angekommen sind if ($user['Gekommen'] == 0) error(_("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.")); - + if ($enable_tshirt_size && $user['Size'] == "") error(_("You need to specify a tshirt size in your settings!")); - + if ($user['DECT'] == "") error(_("You need to specify a DECT phone number in your settings! If you don't have a DECT phone, just enter \"-\".")); - - // Erzengel Hinweis für unbeantwortete Fragen + + // Erzengel Hinweis für unbeantwortete Fragen if ($p != "admin_questions") admin_new_questions(); - + user_angeltypes_unconfirmed_hint(); } - $title = $p; - $content = ""; - if ($p == "api") { require_once realpath(__DIR__ . '/../includes/controller/api.php'); error("Api disabled temporily."); @@ -240,7 +238,7 @@ echo template_render('../templates/layout.html', array( 'title' => $title, 'atom_link' => ($p == 'news' || $p == 'user_meetings') ? '' : '', 'menu' => make_menu(), - 'content' => $content, + 'content' => msg() . $content, 'header_toolbar' => header_toolbar(), 'faq_url' => $faq_url, 'locale' => $_SESSION['locale'] diff --git a/templates/user_shifts.html b/templates/user_shifts.html index 6b230d94..206a8a9f 100644 --- a/templates/user_shifts.html +++ b/templates/user_shifts.html @@ -12,7 +12,7 @@ } } -
+