From f05f1a3cd4cc3a9fa6021d2c5feedd7e734973ba Mon Sep 17 00:00:00 2001 From: msquare Date: Thu, 29 Sep 2016 12:08:12 +0200 Subject: rename to --- includes/controller/angeltypes_controller.php | 6 ++--- includes/controller/event_config_controller.php | 20 +++++++-------- includes/controller/shifttypes_controller.php | 6 ++--- includes/controller/user_angeltypes_controller.php | 6 ++--- .../controller/user_driver_licenses_controller.php | 6 ++--- includes/controller/users_controller.php | 30 +++++++++++----------- 6 files changed, 37 insertions(+), 37 deletions(-) (limited to 'includes/controller') diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php index eeb42d75..92d1d8ee 100644 --- a/includes/controller/angeltypes_controller.php +++ b/includes/controller/angeltypes_controller.php @@ -133,13 +133,13 @@ function angeltype_edit_controller() { $coordinator_mode = ! in_array('admin_angel_types', $privileges); if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (! $coordinator_mode) { if (isset($_REQUEST['name'])) { list($valid, $name) = AngelType_validate_name($_REQUEST['name'], $angeltype); if (! $valid) { - $ok = false; + $valid = false; error(_("Please check the name. Maybe it already exists.")); } } @@ -152,7 +152,7 @@ function angeltype_edit_controller() { $description = strip_request_item_nl('description'); } - if ($ok) { + if ($valid) { if (isset($angeltype)) { $result = AngelType_update($angeltype['id'], $name, $restricted, $description, $requires_driver_license); if ($result === false) { diff --git a/includes/controller/event_config_controller.php b/includes/controller/event_config_controller.php index dc789ca6..2e5175e9 100644 --- a/includes/controller/event_config_controller.php +++ b/includes/controller/event_config_controller.php @@ -32,7 +32,7 @@ function event_config_edit_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (isset($_REQUEST['event_name'])) { $event_name = strip_request_item('event_name'); @@ -50,41 +50,41 @@ function event_config_edit_controller() { $result = check_request_date('buildup_start_date', _("Please enter buildup start date."), true); $buildup_start_date = $result->getValue(); - $ok &= $result->isOk(); + $valid &= $result->isOk(); $result = check_request_date('event_start_date', _("Please enter event start date."), true); $event_start_date = $result->getValue(); - $ok &= $result->isOk(); + $valid &= $result->isOk(); $result = check_request_date('event_end_date', _("Please enter event end date."), true); $event_end_date = $result->getValue(); - $ok &= $result->isOk(); + $valid &= $result->isOk(); $result = check_request_date('teardown_end_date', _("Please enter teardown end date."), true); $teardown_end_date = $result->getValue(); - $ok &= $result->isOk(); + $valid &= $result->isOk(); if ($buildup_start_date != null && $event_start_date != null && $buildup_start_date > $event_start_date) { - $ok = false; + $valid = false; error(_("The buildup start date has to be before the event start date.")); } if ($event_start_date != null && $event_end_date != null && $event_start_date > $event_end_date) { - $ok = false; + $valid = false; error(_("The event start date has to be before the event end date.")); } if ($event_end_date != null && $teardown_end_date != null && $event_end_date > $teardown_end_date) { - $ok = false; + $valid = false; error(_("The event end date has to be before the teardown end date.")); } if ($buildup_start_date != null && $teardown_end_date != null && $buildup_start_date > $teardown_end_date) { - $ok = false; + $valid = false; error(_("The buildup start date has to be before the teardown end date.")); } - if ($ok) { + if ($valid) { $result = EventConfig_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg); if ($result === false) { diff --git a/includes/controller/shifttypes_controller.php b/includes/controller/shifttypes_controller.php index 5380389e..88feffed 100644 --- a/includes/controller/shifttypes_controller.php +++ b/includes/controller/shifttypes_controller.php @@ -68,12 +68,12 @@ function shifttype_edit_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') { $name = strip_request_item('name'); } else { - $ok = false; + $valid = false; error(_('Please enter a name.')); } @@ -87,7 +87,7 @@ function shifttype_edit_controller() { $description = strip_request_item_nl('description'); } - if ($ok) { + if ($valid) { if ($shifttype_id) { $result = ShiftType_update($shifttype_id, $name, $angeltype_id, $description); if ($result === false) { diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php index e0c0b38f..cdd6f951 100644 --- a/includes/controller/user_angeltypes_controller.php +++ b/includes/controller/user_angeltypes_controller.php @@ -336,18 +336,18 @@ function user_angeltype_add_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (isset($_REQUEST['user_id']) && in_array($_REQUEST['user_id'], array_map(function ($user) { return $user['UID']; }, $users_source))) { $user_id = $_REQUEST['user_id']; } else { - $ok = false; + $valid = false; error(_("Please select a user.")); } - if ($ok) { + if ($valid) { foreach ($users_source as $user_source) { if ($user_source['UID'] == $user_id) { $user_angeltype_id = UserAngelType_create($user_source, $angeltype); diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php index 62e491f1..d1c770ba 100644 --- a/includes/controller/user_driver_licenses_controller.php +++ b/includes/controller/user_driver_licenses_controller.php @@ -109,7 +109,7 @@ function user_driver_license_edit_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; $wants_to_drive = isset($_REQUEST['wants_to_drive']); $has_car = isset($_REQUEST['has_car']); $has_license_car = isset($_REQUEST['has_license_car']); @@ -119,11 +119,11 @@ function user_driver_license_edit_controller() { $has_license_forklift = isset($_REQUEST['has_license_forklift']); if ($wants_to_drive && ! $has_license_car && ! $has_license_3_5t_transporter && ! $has_license_7_5t_truck && ! $has_license_12_5t_truck && ! $has_license_forklift) { - $ok = false; + $valid = false; error(_("Please select at least one driving license.")); } - if ($ok) { + if ($valid) { if (! $wants_to_drive && $user_driver_license != null) { $result = UserDriverLicenses_delete($user_source['UID']); if ($result === false) { diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index 512a5723..ca1b8c8d 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -52,14 +52,14 @@ function user_delete_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (! (isset($_REQUEST['password']) && verify_password($_REQUEST['password'], $user['Passwort'], $user['UID']))) { - $ok = false; + $valid = false; error(_("Your password is incorrect. Please try it again.")); } - if ($ok) { + if ($valid) { $result = User_delete($user_source['UID']); if ($result === false) { engelsystem_error('Unable to delete user.'); @@ -109,16 +109,16 @@ function user_edit_vouchers_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (isset($_REQUEST['vouchers']) && test_request_int('vouchers') && trim($_REQUEST['vouchers']) >= 0) { $vouchers = trim($_REQUEST['vouchers']); } else { - $ok = false; + $valid = false; error(_("Please enter a valid number of vouchers.")); } - if ($ok) { + if ($valid) { $user_source['got_voucher'] = $vouchers; $result = User_update($user_source); @@ -225,19 +225,19 @@ function user_password_recovery_controller() { } if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (isset($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) { if ($_REQUEST['password'] != $_REQUEST['password2']) { - $ok = false; + $valid = false; error(_("Your passwords don't match.")); } } else { - $ok = false; + $valid = false; error(_("Your password is to short (please use at least 6 characters).")); } - if ($ok) { + if ($valid) { $result = set_password($user_source['UID'], $_REQUEST['password']); if ($result === false) { engelsystem_error(_("Password could not be updated.")); @@ -251,7 +251,7 @@ function user_password_recovery_controller() { return User_password_set_view(); } else { if (isset($_REQUEST['submit'])) { - $ok = true; + $valid = true; if (isset($_REQUEST['email']) && strlen(strip_request_item('email')) > 0) { $email = strip_request_item('email'); @@ -261,19 +261,19 @@ function user_password_recovery_controller() { engelsystem_error("Unable to load user."); } if ($user_source == null) { - $ok = false; + $valid = false; error(_("E-mail address is not correct.")); } } else { - $ok = false; + $valid = false; error(_("E-mail address is not correct.")); } } else { - $ok = false; + $valid = false; error(_("Please enter your e-mail.")); } - if ($ok) { + if ($valid) { $token = User_generate_password_recovery_token($user_source); if ($token === false) { engelsystem_error("Unable to generate password recovery token."); -- cgit v1.2.3-70-g09d2