mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Search results are correctly shown
This commit is contained in:
		@@ -61,16 +61,22 @@ class userController
 | 
			
		||||
	  }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Get current user infos using tokens
 | 
			
		||||
	 * Get informations about a user
 | 
			
		||||
	 *
 | 
			
		||||
	 * @url POST /user/getCurrentUserInfos
 | 
			
		||||
	 * @url POST /user/getInfos
 | 
			
		||||
	 * @return array The result
 | 
			
		||||
	 */
 | 
			
		||||
	public function getCurrentUserInfosWithTokens() : array{
 | 
			
		||||
	public function getUserInfos() : array{
 | 
			
		||||
		user_login_required();
 | 
			
		||||
 | 
			
		||||
		//Try to get user infos from token
 | 
			
		||||
		$userInfos = CS::get()->user->getUserInfos(userID);
 | 
			
		||||
		//Determine userID
 | 
			
		||||
		if(!isset($_POST['userID']))
 | 
			
		||||
			Rest_fatal_error(400, "Please specify user ID !");
 | 
			
		||||
		
 | 
			
		||||
		$userID = $_POST['userID']*1;
 | 
			
		||||
 | 
			
		||||
		//Try to get user infos
 | 
			
		||||
		$userInfos = CS::get()->user->getUserInfos($userID);
 | 
			
		||||
		
 | 
			
		||||
		//Check if response is empty
 | 
			
		||||
		if(count($userInfos) == 0)
 | 
			
		||||
@@ -85,7 +91,7 @@ class userController
 | 
			
		||||
	 *
 | 
			
		||||
	 * @url POST /user/getCurrentUserID
 | 
			
		||||
	 */
 | 
			
		||||
	public function getCurrentUserIDUsingTokens(){
 | 
			
		||||
	public function getCurrentUserID(){
 | 
			
		||||
		user_login_required();
 | 
			
		||||
 | 
			
		||||
		//Return userID
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user