summaryrefslogtreecommitdiff
path: root/includes/pages
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-10 03:10:28 +0200
committermsquare <msquare@notrademark.de>2018-10-31 13:43:23 +0100
commit7c6afc2bfe3263b91ecabf5530da57fe1162ea0b (patch)
treea251a646b6399a65842e3bfaefe44954f5ac1770 /includes/pages
parent89e62c95a7ffd71a8e860f59378ecd13d6cbb196 (diff)
Removed `User($id)` function :tada:
Diffstat (limited to 'includes/pages')
-rw-r--r--includes/pages/admin_questions.php2
-rw-r--r--includes/pages/user_myshifts.php5
-rw-r--r--includes/pages/user_shifts.php12
3 files changed, 10 insertions, 9 deletions
diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php
index 02f53d93..85d62362 100644
--- a/includes/pages/admin_questions.php
+++ b/includes/pages/admin_questions.php
@@ -68,7 +68,7 @@ function admin_questions()
$questions = DB::select('SELECT * FROM `Questions` WHERE NOT `AID` IS NULL');
foreach ($questions as $question) {
$user_source = User::find($question['UID']);
- $answer_user_source = User($question['AID']);
+ $answer_user_source = User::find($question['AID']);
$answered_questions_table[] = [
'from' => User_Nick_render($user_source),
'question' => str_replace("\n", '<br />', $question['Question']),
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index ab4b00b6..7f20139c 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -18,7 +18,8 @@ function myshifts_title()
*/
function user_myshifts()
{
- global $user, $privileges;
+ global $privileges;
+ $user = auth()->user();
$request = request();
if (
@@ -29,7 +30,7 @@ function user_myshifts()
) {
$shift_entry_id = $request->input('id');
} else {
- $shift_entry_id = $user['UID'];
+ $shift_entry_id = $user->id;
}
$shifts_user = User::find($shift_entry_id);
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 350394be..3e300e3c 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -22,10 +22,9 @@ function shifts_title()
*/
function user_shifts()
{
- global $user;
$request = request();
- if (User_is_freeloader($user)) {
+ if (User_is_freeloader(auth()->user())) {
redirect(page_link_to('user_myshifts'));
}
@@ -169,7 +168,8 @@ function load_types()
*/
function view_user_shifts()
{
- global $user, $privileges, $ical_shifts;
+ global $privileges, $ical_shifts;
+ $user = auth()->user();
$session = session();
$ical_shifts = [];
@@ -193,7 +193,7 @@ function view_user_shifts()
$shiftCalendarRenderer = shiftCalendarRendererByShiftFilter($shiftsFilter);
- if ($user['api_key'] == '') {
+ if (empty($user->api_key)) {
User_reset_api_key($user, false);
}
@@ -212,12 +212,12 @@ function view_user_shifts()
$end_day = date('Y-m-d', $shiftsFilter->getEndTime());
$end_time = date('H:i', $shiftsFilter->getEndTime());
- if (config('signup_requires_arrival') && !$user['Gekommen']) {
+ if (config('signup_requires_arrival') && !$user->state->arrived) {
info(render_user_arrived_hint());
}
$ownTypes = [];
- foreach (UserAngelTypes_by_User($user['UID']) as $type) {
+ foreach (UserAngelTypes_by_User($user->id) as $type) {
$ownTypes[] = (int)$type['angeltype_id'];
}