mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can check if a mail is linked to an account or not.
This commit is contained in:
		@@ -157,6 +157,23 @@ class Account {
 | 
			
		||||
		return $userInfos[0]["ID_utilisateurs"];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Check whether an email address is linked to an account or not
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return bool TRUE if the email is linked to an account / FALSE else
 | 
			
		||||
	 */
 | 
			
		||||
	public function exists_email(string $email) : bool {
 | 
			
		||||
 | 
			
		||||
		//Perform an API request
 | 
			
		||||
		$tableName = self::USER_TABLE;
 | 
			
		||||
		$conditions = "WHERE mail = ?";
 | 
			
		||||
		$values = array($email);
 | 
			
		||||
 | 
			
		||||
		//Return result
 | 
			
		||||
		return CS::get()->db->count($tableName, $conditions, $values) > 0;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Crypt user password
 | 
			
		||||
	 *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user