X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/fd0872d9e582113346fa1e93557f370286c5c9f2..9339284bfdaba5a0c2a4e3c9fa000194a508d0bf:/user_delete.php diff --git a/user_delete.php b/user_delete.php index a88454bf..b8ec5e9a 100644 --- a/user_delete.php +++ b/user_delete.php @@ -30,27 +30,24 @@ require_once('initialize.php'); import('form.Form'); import('ttUserHelper'); -// Access check. +// Access checks. if (!ttAccessAllowed('manage_users')) { header('Location: access_denied.php'); exit(); } - -// Get user id we are deleting from the request. +// Get user id we are deleting. // A cast to int is for safety against manipulation of request parameter (sql injection). $user_id = (int) $request->getParameter('id'); // We need user name and login to display. $user_details = ttUserHelper::getUserDetails($user_id); - -// Security checks. if (!$user_details || // No details. - $user_details['team_id'] <> $user->team_id || // User not in team. $user_details['rank'] > $user->rank || // User has a bigger rank. ($user_details['rank'] == $user->rank && $user_details['id'] <> $user->id) // Same rank but not us. ) { header('Location: access_denied.php'); exit(); } +// End of access checks. $smarty->assign('user_to_delete', $user_details['name']." (".$user_details['login'].")");