Can check if a user is allowed to access other user informations

This commit is contained in:
Pierre
2017-12-16 15:30:04 +01:00
parent c3e4c79d04
commit 1a0a812519
3 changed files with 73 additions and 7 deletions

View File

@ -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
*