backport
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Wed, 22 Jun 2005 13:11:39 +0000 (13:11 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:29:24 +0000 (23:29 +0200)
Patches applied:

 * opensource@polytechnique.org--2005/platal--release--0.9.7--patch-9
   should fix a damn bug with auth

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

htdocs/auth-groupex.php

index f56e1cf..4c78598 100644 (file)
@@ -70,12 +70,7 @@ function gpex_make_params($chlg, $privkey, $datafields) {
         if (isset($_SESSION[$val])) {
             $params .= "&$val=".$_SESSION[$val];
         } else if ($val == 'username') {
-            $res = $globals->xdb->query(
-                    "SELECT  alias
-                       FROM  aliases       AS al
-                 INNER JOIN  auth_user_md5 AS a ON (a.user_id = al.id AND al.type IN('a_vie','alias'))
-                      WHERE  a.user_id = {?} AND alias LIKE '%.%'
-                   ORDER BY  LENGTH(alias)", Session::getInt('uid'));
+            $res = $globals->xdb->query("SELECT alias FROM aliases WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", Session::getInt('uid'));
             $min_username = $res->fetchOneCell();
             $params      .= "&$val=".$min_username;
        }