diff options
author | msquare <msquare@notrademark.de> | 2017-09-11 17:52:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-11 17:52:55 +0200 |
commit | 359160613027a480620e22deef19ff883eaaeb21 (patch) | |
tree | 310600aaa23404f0cd7d3e198bacdbc93645da32 /includes/controller/shift_entries_controller.php | |
parent | 581b81f1b25dc6b6f0a3b34810c293738fd40217 (diff) | |
parent | 0a20883aa862779b48fd2a297456c2db04cffb95 (diff) |
Merge pull request #344 from MyIgel/master
Prepared routing, added symfony http Closes #336 and closes #337
Diffstat (limited to 'includes/controller/shift_entries_controller.php')
-rw-r--r-- | includes/controller/shift_entries_controller.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index 72189869..150db2e9 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -13,7 +13,7 @@ function shift_entry_add_controller() $request = request(); $shift_id = 0; - if ($request->has('shift_id') && preg_match('/^\d*$/', $request->input('shift_id'))) { + if ($request->has('shift_id') && preg_match('/^\d+$/', $request->input('shift_id'))) { $shift_id = $request->input('shift_id'); } else { redirect(page_link_to('user_shifts')); @@ -27,13 +27,13 @@ function shift_entry_add_controller() } $shift = Shift($shift_id); - $shift['Name'] = $room_array[$shift['RID']]; if ($shift == null) { redirect(page_link_to('user_shifts')); } + $shift['Name'] = $room_array[$shift['RID']]; $type_id = 0; - if ($request->has('type_id') && preg_match('/^\d*$/', $request->input('type_id'))) { + if ($request->has('type_id') && preg_match('/^\d+$/', $request->input('type_id'))) { $type_id = $request->input('type_id'); } else { redirect(page_link_to('user_shifts')); @@ -64,7 +64,7 @@ function shift_entry_add_controller() if ( $request->has('user_id') - && preg_match('/^\d*$/', $request->input('user_id')) + && preg_match('/^\d+$/', $request->input('user_id')) && ( in_array('user_shifts_admin', $privileges) || in_array('shiftentry_edit_angeltype_supporter', $privileges) |