now until type=homonyme, the alias is ours.
authorx2000habouzit <x2000habouzit>
Sun, 5 Sep 2004 12:24:41 +0000 (12:24 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 5 Sep 2004 12:24:41 +0000 (12:24 +0000)
and expire tells that we can (or not) take the alias and make it an homonyme.
homonyme.id is not 0 anymore but one of the users having this id one day.
the table x4dat.homonyme tells the associated list

include/valid_aliases.inc.php
include/xorg.session.inc.php

index 2849527..bf8984e 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: valid_aliases.inc.php,v 1.15 2004-09-02 20:11:23 x2000habouzit Exp $
+        $Id: valid_aliases.inc.php,v 1.16 2004-09-05 12:24:41 x2000habouzit Exp $
  ***************************************************************************/
 
 class AliasReq extends Validate {
@@ -38,9 +38,9 @@ class AliasReq extends Validate {
         
         $sql = $globals->db->query("
            SELECT  l.alias,prenom,nom,domain
-             FROM  auth_user_md5 AS u
-       INNER JOIN  aliases       AS l ON(u.user_id=l.id AND type='a_vie')
-         LEFT JOIN  groupex.aliases as a ON (a.email = l.alias and a.id = 12)
+             FROM  auth_user_md5   AS u
+       INNER JOIN  aliases         AS l ON (u.user_id=l.id AND type='a_vie')
+         LEFT JOIN  groupex.aliases AS a ON (a.email = l.alias and a.id = 12)
              WHERE  user_id='".$this->uid."'");
         list($this->forlife,$this->prenom,$this->nom,$this->old) = mysql_fetch_row($sql);
         mysql_free_result($sql);
index 2ef9874..2dad330 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: xorg.session.inc.php,v 1.23 2004-09-02 19:39:20 x2000habouzit Exp $
+        $Id: xorg.session.inc.php,v 1.24 2004-09-05 12:24:41 x2000habouzit Exp $
  ***************************************************************************/
 
 require("diogenes.core.session.inc.php");
@@ -51,7 +51,8 @@ class XorgSession extends DiogenesCoreSession {
            $field = preg_match('/^\d*$/', $_REQUEST['username']) ? 'id' : 'alias';
            $res = @$globals->db->query( "SELECT  u.user_id,u.password
                                            FROM  auth_user_md5 AS u
-                                     INNER JOIN  aliases       AS a ON ( a.id=u.user_id AND a.$field='{$_REQUEST['username']}' )");
+                                     INNER JOIN  aliases       AS a ON ( a.id=u.user_id AND type!='homonyme' )
+                                          WHERE  a.$field='{$_REQUEST['username']}'");
            if(@mysql_num_rows($res) != 0) {
                list($uid,$password)=mysql_fetch_row($res);
                mysql_free_result($res);