Merge branch 'xorg/maint'
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Fri, 3 Jan 2014 17:44:20 +0000 (18:44 +0100)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Fri, 3 Jan 2014 17:44:20 +0000 (18:44 +0100)
1  2 
include/validations/names.inc.php

@@@ -1,6 -1,6 +1,6 @@@
  <?php
  /***************************************************************************
 - *  Copyright (C) 2003-2013 Polytechnique.org                              *
 + *  Copyright (C) 2003-2014 Polytechnique.org                              *
   *  http://opensource.polytechnique.org/                                   *
   *                                                                         *
   *  This program is free software; you can redistribute it and/or modify   *
@@@ -59,6 -59,13 +59,13 @@@ class NamesReq extends ProfileValidat
                                               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;
                  }