Skip to content
Snippets Groups Projects
Commit 4b7d7c3d authored by Peter Rotich's avatar Peter Rotich
Browse files

email: System email check + aliases

Include username when checking if a system email already exists. This
is important for emails that use aliases.
parent 956ad7bf
Branches
Tags
No related merge requests found
...@@ -216,7 +216,10 @@ class Email extends VerySimpleModel { ...@@ -216,7 +216,10 @@ class Email extends VerySimpleModel {
/******* Static functions ************/ /******* Static functions ************/
static function getIdByEmail($email) { static function getIdByEmail($email) {
$qs = static::objects()->filter(array('email' => $email)) $qs = static::objects()->filter(Q::any(array(
'email' => $email,
'userid' => $email
)))
->values_flat('email_id'); ->values_flat('email_id');
$row = $qs->first(); $row = $qs->first();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment