summaryrefslogtreecommitdiff
path: root/includes/controller
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-30 14:59:27 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-30 15:35:12 +0200
commit96f1d9fd541d0c5ef78151f8c69a89c41684b67a (patch)
treee39f5afde165a55f49857d064675fa1876a66808 /includes/controller
parenta473a56f1dbf568dc66cd6fcffe6b638308c542e (diff)
Bugfixes
Diffstat (limited to 'includes/controller')
-rw-r--r--includes/controller/shift_entries_controller.php6
-rw-r--r--includes/controller/shifts_controller.php11
2 files changed, 9 insertions, 8 deletions
diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php
index 148b19fb..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'));
@@ -33,7 +33,7 @@ function shift_entry_add_controller()
$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)
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index c359850f..70011821 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -8,10 +8,13 @@ use Engelsystem\ShiftSignupState;
*/
function shift_link($shift)
{
- $link = page_link_to('shifts', ['action' => 'view']);
+ $parameters = ['action' => 'view'];
if (isset($shift['SID'])) {
- $link .= '&shift_id=' . $shift['SID'];
+ $parameters['shift_id'] = $shift['SID'];
}
+
+ $link = page_link_to('shifts', $parameters);
+
return $link;
}
@@ -201,7 +204,7 @@ function shift_delete_controller()
}
// Schicht komplett löschen (nur für admins/user mit user_shifts_admin privileg)
- if (!$request->has('delete_shift') || !preg_match('/^\d*$/', $request->input('delete_shift'))) {
+ if (!$request->has('delete_shift') || !preg_match('/^\d+$/', $request->input('delete_shift'))) {
redirect(page_link_to('user_shifts'));
}
$shift_id = $request->input('delete_shift');
@@ -316,8 +319,6 @@ function shifts_controller()
/**
* Redirects the user to his next shift.
- *
- * @return false
*/
function shift_next_controller()
{