From a2aaba9cab6b7bdf755a023ed2503cf8cf46925a Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 17 Oct 2018 01:30:10 +0200 Subject: User: Bugfixes & code cleanup --- includes/controller/shifts_controller.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'includes/controller/shifts_controller.php') diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 07e81957..ee6714d4 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -332,13 +332,12 @@ function shifts_controller() function shift_next_controller() { global $privileges; - $user = auth()->user(); if (!in_array('user_shifts', $privileges)) { redirect(page_link_to('/')); } - $upcoming_shifts = ShiftEntries_upcoming_for_user($user->id); + $upcoming_shifts = ShiftEntries_upcoming_for_user(auth()->user()->id); if (!empty($upcoming_shifts)) { redirect(shift_link($upcoming_shifts[0])); -- cgit v1.2.3-54-g00ecf