Check if user exists before the query

This commit is contained in:
Pierre 2017-12-17 12:30:05 +01:00
parent 1cd8adf247
commit 88e9a6fa58

View File

@ -123,6 +123,10 @@ class userController
$userID = toInt($_POST["userID"]);
//Check if the user exists
if(!CS::get()->components->user->exists($userID))
Rest_fatal_error(404, "Specified user not found !");
//Check if the user is allowed to get advanced user infromations
if(!CS::get()->components->user->userAllowed(userID, $userID))
Rest_fatal_error(401, "You are not allowed to access these information !");