fix error messages on password recovery

This commit is contained in:
Philip Häusler 2014-03-12 17:36:55 +01:00
parent 462b78a7e7
commit 13f8a513d4
2 changed files with 13 additions and 3 deletions

View File

@ -49,15 +49,15 @@ function user_password_recovery_controller() {
engelsystem_error("Unable to load user."); engelsystem_error("Unable to load user.");
if ($user_source == null) { if ($user_source == null) {
$ok = false; $ok = false;
$msg .= error(_("E-mail address is not correct."), true); error(_("E-mail address is not correct."));
} }
} else { } else {
$ok = false; $ok = false;
$msg .= error(_("E-mail address is not correct."), true); error(_("E-mail address is not correct."));
} }
} else { } else {
$ok = false; $ok = false;
$msg .= error(_("Please enter your e-mail."), true); error(_("Please enter your e-mail."));
} }
if ($ok) { if ($ok) {

View File

@ -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`"); $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`"); $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)) if (in_array('user_shifts_admin', $privileges))
$types = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `AngelTypes`.`name`"); $types = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `AngelTypes`.`name`");
else 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'])) if (! isset($_SESSION['user_shifts']))
$_SESSION['user_shifts'] = array(); $_SESSION['user_shifts'] = array();