From 2dcb7cc2de448c664bbc9a7112f9cb13dc15c516 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 8 Oct 2018 21:15:56 +0200 Subject: Replaced some global `$user` variables --- includes/pages/user_shifts.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'includes/pages/user_shifts.php') diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 6754292e..dc33d078 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -129,7 +129,7 @@ function load_days() */ function load_types() { - global $user; + $user = Auth()->user(); if (!count(DB::select('SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0'))) { error(__('The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype.')); @@ -155,7 +155,7 @@ function load_types() ORDER BY `AngelTypes`.`name` ', [ - $user['UID'], + $user->id, ] ); if (empty($types)) { @@ -284,13 +284,13 @@ function view_user_shifts() */ function ical_hint() { - global $user; + $user = Auth()->user(); return heading(__('iCal export'), 2) . '

' . sprintf( __('Export your own shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key).'), - page_link_to('ical', ['key' => $user['api_key']]), - page_link_to('shifts_json_export', ['key' => $user['api_key']]), + page_link_to('ical', ['key' => $user->api_key]), + page_link_to('shifts_json_export', ['key' => $user->api_key]), page_link_to('user_myshifts', ['reset' => 1]) ) . '

'; } -- cgit v1.2.3-54-g00ecf