mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Added a method to check if an email is associated or not with an account.
This commit is contained in:
		@@ -62,6 +62,26 @@ class accountController {
 | 
			
		||||
		return array("success" => "The user has been disconnected !");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Check if an email is already associated with an account or not
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @url POST /account/exists_email
 | 
			
		||||
	 */
 | 
			
		||||
	public function existsMail(){
 | 
			
		||||
 | 
			
		||||
		//Check the given email address
 | 
			
		||||
		$email = postString("email", 5);
 | 
			
		||||
		if(!filter_var($email, FILTER_VALIDATE_EMAIL))
 | 
			
		||||
			Rest_fatal_error(400, "Specified email address is invalid !");
 | 
			
		||||
		
 | 
			
		||||
		//Check if the email address is already associated with an account
 | 
			
		||||
		$email_exists = components()->account->exists_email($email);
 | 
			
		||||
		
 | 
			
		||||
		return array(
 | 
			
		||||
			"exists" => $email_exists
 | 
			
		||||
		);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Create an account
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user