mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 13:59:29 +00:00
Can check if a mail is linked to an account or not.
This commit is contained in:
parent
43ba96ac5e
commit
259b8be3b5
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user