diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-10-09 21:47:31 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-10-31 13:43:23 +0100 |
commit | 89e62c95a7ffd71a8e860f59378ecd13d6cbb196 (patch) | |
tree | a26965030177112a0d54a232c81ffd21d48529de /includes/pages/user_myshifts.php | |
parent | b069a938c6721ab5adddcbec4cff858ded6f0e1e (diff) |
Changed more functions :tada:
Diffstat (limited to 'includes/pages/user_myshifts.php')
-rw-r--r-- | includes/pages/user_myshifts.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 2a8a5d5a..ab4b00b6 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -1,6 +1,7 @@ <?php use Engelsystem\Database\DB; +use Engelsystem\Models\User\User; /** * @return string @@ -31,12 +32,12 @@ function user_myshifts() $shift_entry_id = $user['UID']; } - $shifts_user = DB::selectOne('SELECT * FROM `User` WHERE `UID`=? LIMIT 1', [$shift_entry_id]); + $shifts_user = User::find($shift_entry_id); if ($request->has('reset')) { if ($request->input('reset') == 'ack') { User_reset_api_key($user); success(__('Key changed.')); - redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']])); + redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user->id])); } return page_with_title(__('Reset API key'), [ error( @@ -68,7 +69,7 @@ function user_myshifts() ', [ $shift_entry_id, - $shifts_user['UID'], + $shifts_user->id, ] ); if (!empty($shift)) { @@ -87,7 +88,7 @@ function user_myshifts() } $comment = strip_request_item_nl('comment'); - $user_source = User($shift['UID']); + $user_source = User::find($shift['UID']); if ($valid) { ShiftEntry_update([ @@ -105,7 +106,7 @@ function user_myshifts() . '. Freeloaded: ' . ($freeloaded ? 'YES Comment: ' . $freeload_comment : 'NO') ); success(__('Shift saved.')); - redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']])); + redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user->id])); } } @@ -125,6 +126,6 @@ function user_myshifts() } } - redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']])); + redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user->id])); return ''; } |