diff options
Diffstat (limited to 'includes/controller/shifts_controller.php')
-rw-r--r-- | includes/controller/shifts_controller.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 52162b9e..b29a819f 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -137,12 +137,12 @@ function shifts_json_export_all_controller() { function shifts_json_export_controller() { global $ical_shifts, $user; - if (isset($_REQUEST['key']) && preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) { - $key = $_REQUEST['key']; - } else { + if (! isset($_REQUEST['key']) || ! preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) { engelsystem_error("Missing key."); } + $key = $_REQUEST['key']; + $user = User_by_api_key($key); if ($user === false) { engelsystem_error("Unable to find user."); |