From cbd1d4f8ea1bbee1622acb58ebead756cd9e407c Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Thu, 25 Feb 2021 23:58:23 +1300 Subject: [PATCH] searchEmails should return a boolean, and needs to be public. --- inc/Principal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/Principal.php b/inc/Principal.php index 7ae11442..889d0870 100644 --- a/inc/Principal.php +++ b/inc/Principal.php @@ -659,12 +659,12 @@ class Principal { * Find if an email address is associated with this principle. * @return boolean True if found. */ - protected function searchEmails( $email ) { - $qry = new AwlQuery('SELECT * FROM usr_emails WHERE user_no = :user_no, email = :email', + public function searchEmails( $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) ); if ( $qry->Exec('Principal') ) { - return $qry->Rows; + return $qry->rows() == 1; } } }