X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Fuser_delete.php;h=4c9aad878cc3cab3b5aea5b36d9620da25e27f11;hb=926b8d63a0be596b0c95cb55f01addae410af50c;hp=d8400456a99ba6f167f4d1ec2a0823199d47b745;hpb=fd0872d9e582113346fa1e93557f370286c5c9f2;p=timetracker.git diff --git a/mobile/user_delete.php b/mobile/user_delete.php index d8400456..4c9aad87 100644 --- a/mobile/user_delete.php +++ b/mobile/user_delete.php @@ -35,23 +35,13 @@ if (!ttAccessAllowed('manage_users')) { header('Location: access_denied.php'); exit(); } - -// Get user id we are deleting from the request. -// 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. - ) { +$user_details = $user->getUser($user_id); +if (!$user_details) { header('Location: access_denied.php'); exit(); } +// End of access checks. $smarty->assign('user_to_delete', $user_details['name']." (".$user_details['login'].")");