mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can check if a user is allowed to access other user informations
This commit is contained in:
@ -110,6 +110,27 @@ class userController
|
||||
return $userInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get advanced user informations
|
||||
*
|
||||
* @url POST /user/getAdvancedUserInfos
|
||||
*/
|
||||
public function getAdvancedInfos(){
|
||||
|
||||
//Get the ID of the target user
|
||||
if(!isset($_POST["userID"]))
|
||||
Rest_fatal_error(400, "Please specify a user ID!");
|
||||
|
||||
$userID = toInt($_POST["userID"]);
|
||||
|
||||
//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 !");
|
||||
|
||||
echo "ok";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current user infos using tokens
|
||||
*
|
||||
|
Reference in New Issue
Block a user