If we already have the email address, don't need to do a DB query

This commit is contained in:
Andrew Ruthven 2021-02-26 00:04:35 +13:00
parent cbd1d4f8ea
commit 6f1a20e1a2

View File

@ -660,6 +660,10 @@ class Principal {
* @return boolean True if found. * @return boolean True if found.
*/ */
public function searchEmails( $email ) { public function searchEmails( $email ) {
if ( $self->email == $email ) {
return 1;
}
$qry = new AwlQuery('SELECT * FROM usr_emails WHERE user_no = :user_no AND lower(email) = lower(:email)', $qry = new AwlQuery('SELECT * FROM usr_emails WHERE user_no = :user_no AND lower(email) = lower(:email)',
array(':user_no' => $this->user_no(), ':email' => $email) ); array(':user_no' => $this->user_no(), ':email' => $email) );