backport
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 9 May 2005 14:28:03 +0000 (14:28 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:55 +0000 (23:28 +0200)
Patches applied:

 * opensource@polytechnique.org--2005/platal--release--0.9.6--patch-4
   SQL qurey was faulty

git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-633

include/xnet/mail.inc.php

index 328b959..6cc3844 100644 (file)
@@ -33,11 +33,11 @@ function get_all_redirects($membres, $mls, $alias, &$client)
         $res = $globals->xdb->query(
                     'SELECT  IF(u.nom, u.nom, m.nom) AS nom,
                              IF(u.prenom, u.prenom, m.prenom) AS prenom,
-                             IF(m.email, m.email, CONCAT(a.alias, "@polytechnique.org")) as email,
+                             IF(m.email <> "", m.email, CONCAT(a.alias, "@polytechnique.org")) as email,
                              FIND_IN_SET("femme", u.flags) AS sexe
                        FROM  groupex.membres AS m
                   LEFT JOIN  auth_user_md5   AS u ON (m.uid=u.user_id AND m.uid<50000)
-                 INNER JOIN  aliases         AS a ON (a.id=u.user_id and a.type="a_vie")
+                  LEFT JOIN  aliases         AS a ON (a.id=u.user_id and a.type="a_vie")
                       WHERE  asso_id = {?}', $globals->asso('id'));
         $tos = $res->fetchAllAssoc();
     }