mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Check if user exists before the query
This commit is contained in:
parent
1cd8adf247
commit
88e9a6fa58
@ -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 !");
|
||||
|
Loading…
Reference in New Issue
Block a user