-
-// 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.
- ) {