From 13f8a513d4651918b95a825dd252b69a6ad7711e Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Wed, 12 Mar 2014 17:36:55 +0100 Subject: fix error messages on password recovery --- includes/controller/users_controller.php | 6 +++--- includes/pages/user_shifts.php | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index c5c437ca..bf83fa9e 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -49,15 +49,15 @@ function user_password_recovery_controller() { engelsystem_error("Unable to load user."); if ($user_source == null) { $ok = false; - $msg .= error(_("E-mail address is not correct."), true); + error(_("E-mail address is not correct.")); } } else { $ok = false; - $msg .= error(_("E-mail address is not correct."), true); + error(_("E-mail address is not correct.")); } } else { $ok = false; - $msg .= error(_("Please enter your e-mail."), true); + error(_("Please enter your e-mail.")); } if ($ok) { diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index ea3be85f..a80a6622 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -298,6 +298,11 @@ function view_user_shifts() { $days = sql_select_single_col("SELECT DISTINCT DATE(FROM_UNIXTIME(`start`)) AS `id`, DATE(FROM_UNIXTIME(`start`)) AS `name` FROM `Shifts` ORDER BY `start`"); $rooms = sql_select("SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` WHERE `show`='Y' ORDER BY `Name`"); + if (count($rooms) == 0) { + error(_("The administration has not configured any rooms yet.")); + redirect('?'); + } + if (in_array('user_shifts_admin', $privileges)) $types = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `AngelTypes`.`name`"); else @@ -315,6 +320,11 @@ function view_user_shifts() { ) ); + if (count($types) == 0) { + error(_("The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype.")); + redirect('?'); + } + if (! isset($_SESSION['user_shifts'])) $_SESSION['user_shifts'] = array(); -- cgit v1.2.3-70-g09d2