diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index 2c57f550..356a9db8 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -17,7 +17,7 @@ function shift_entries_controller() $action = strip_request_item('action'); if (empty($action)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } switch ($action) { @@ -44,7 +44,7 @@ function shift_entry_create_controller() $shift = Shift($request->input('shift_id')); if (empty($shift)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } $angeltype = AngelType($request->input('angeltype_id')); @@ -54,7 +54,7 @@ function shift_entry_create_controller() } if (empty($angeltype)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } if (User_is_AngelType_supporter($user, $angeltype)) { @@ -345,7 +345,7 @@ function shift_entry_delete_controller() $signout_user = User($shiftEntry['UID']); if (!Shift_signout_allowed($shift, $angeltype, $signout_user)) { error(__('You are not allowed to remove this shift entry. If necessary, ask your supporter or heaven to do so.')); - redirect(user_link($signout_user)); + redirect(user_link($signout_user['UID'])); } if ($request->has('continue')) { diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php index 422ad382..2a3f7023 100644 --- a/includes/controller/user_driver_licenses_controller.php +++ b/includes/controller/user_driver_licenses_controller.php @@ -130,7 +130,7 @@ function user_driver_license_edit_controller() } engelsystem_log('Driver license information updated.'); success(__('Your driver license information has been saved.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } else { error(__('Please select at least one driving license.')); } @@ -138,7 +138,7 @@ function user_driver_license_edit_controller() UserDriverLicenses_delete($user_source['UID']); engelsystem_log('Driver license information removed.'); success(__('Your driver license information has been removed.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } } diff --git a/includes/controller/user_worklog_controller.php b/includes/controller/user_worklog_controller.php index 640dcaba..a431643f 100644 --- a/includes/controller/user_worklog_controller.php +++ b/includes/controller/user_worklog_controller.php @@ -12,7 +12,7 @@ function user_worklog_delete_controller() $request = request(); $userWorkLog = UserWorkLog($request->input('user_worklog_id')); if (empty($userWorkLog)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } $user_source = User($userWorkLog['user_id']); @@ -20,7 +20,7 @@ function user_worklog_delete_controller() UserWorkLog_delete($userWorkLog); success(__('Work log entry deleted.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } return [ @@ -41,7 +41,7 @@ function user_worklog_edit_controller() $request = request(); $userWorkLog = UserWorkLog($request->input('user_worklog_id')); if (empty($userWorkLog)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } $user_source = User($userWorkLog['user_id']); @@ -52,7 +52,7 @@ function user_worklog_edit_controller() UserWorkLog_update($userWorkLog); success(__('Work log entry updated.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } } @@ -113,7 +113,7 @@ function user_worklog_add_controller() $request = request(); $user_source = User($request->input('user_id')); if (empty($user_source)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } $userWorkLog = UserWorkLog_new($user_source); @@ -125,7 +125,7 @@ function user_worklog_add_controller() UserWorkLog_create($userWorkLog); success(__('Work log entry created.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } } @@ -189,13 +189,13 @@ function user_worklog_controller() global $user, $privileges; if (!in_array('admin_user_worklog', $privileges)) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } $request = request(); $action = $request->input('action'); if (!$request->has('action')) { - redirect(user_link($user)); + redirect(user_link($user['UID'])); } switch ($action) { diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index 13264fd1..f49439da 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -59,7 +59,7 @@ function user_delete_controller() // You cannot delete yourself if ($user['UID'] == $user_source['UID']) { error(__('You cannot delete yourself.')); - redirect(user_link($user)); + redirect(user_link($user['UID'])); } if ($request->has('submit')) { @@ -101,30 +101,30 @@ function users_link() } /** - * @param array $user + * @param int $userId * @return string */ -function user_edit_link($user) +function user_edit_link($userId) { - return page_link_to('admin_user', ['user_id' => $user['UID']]); + return page_link_to('admin_user', ['user_id' => $userId]); } /** - * @param array $user + * @param int $userId * @return string */ -function user_delete_link($user) +function user_delete_link($userId) { - return page_link_to('users', ['action' => 'delete', 'user_id' => $user['UID']]); + return page_link_to('users', ['action' => 'delete', 'user_id' => $userId]); } /** - * @param array $user + * @param int $userId * @return string */ -function user_link($user) +function user_link($userId) { - return page_link_to('users', ['action' => 'view', 'user_id' => $user['UID']]); + return page_link_to('users', ['action' => 'view', 'user_id' => $userId]); } /** @@ -169,7 +169,7 @@ function user_edit_vouchers_controller() engelsystem_log(User_Nick_render($user_source) . ': ' . sprintf('Got %s vouchers', $user_source['got_voucher'])); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } } diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php index cb03437f..4f29b85d 100644 --- a/includes/pages/admin_arrive.php +++ b/includes/pages/admin_arrive.php @@ -36,7 +36,7 @@ function admin_arrive() ', [$user_id]); engelsystem_log('User set to not arrived: ' . User_Nick_render($user_source)); success(__('Reset done. Angel has not arrived.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } else { $msg = error(__('Angel not found.'), true); } @@ -52,7 +52,7 @@ function admin_arrive() ', [time(), $user_id]); engelsystem_log('User set has arrived: ' . User_Nick_render($user_source)); success(__('Angel has been marked as arrived.')); - redirect(user_link($user_source)); + redirect(user_link($user_source['UID'])); } else { $msg = error(__('Angel not found.'), true); } diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 2ef48eb7..b4dd9c1b 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -165,7 +165,7 @@ function admin_user() } $html .= buttons([ - button(user_delete_link($user_source), glyph('lock') . __('delete'), 'btn-danger') + button(user_delete_link($user_source['UID']), glyph('lock') . __('delete'), 'btn-danger') ]); $html .= "