From: Nicolas Iooss Date: Thu, 2 Jan 2014 19:02:34 +0000 (+0100) Subject: Fix alias overriding bug when changing names X-Git-Tag: xorg/1.1.12~17^2~4 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e88ea173e8d1826ce33c834e704d04dde91331c4;p=platal.git Fix alias overriding bug when changing names When changing name (first name or last name), the new alias was tested against existing aliases in email_source_account table but not against those in email_source_other, where the homonyms are. Signed-off-by: Nicolas Iooss --- diff --git a/include/validations/names.inc.php b/include/validations/names.inc.php index d52a849..34e0567 100644 --- a/include/validations/names.inc.php +++ b/include/validations/names.inc.php @@ -59,6 +59,13 @@ class NamesReq extends ProfileValidate FROM email_source_account WHERE email = {?} AND type != \'alias_aux\'', $this->new_alias); + if (!$used) { + // Check against homonyms + $used = XDB::fetchOneCell('SELECT COUNT(email) + FROM email_source_other + WHERE email = {?}', + $this->new_alias); + } if ($used) { $this->new_alias = null; }