send the bestalias here
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Fri, 14 Jan 2005 15:03:13 +0000 (15:03 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:33 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-319

htdocs/auth-groupex.php

index 83c0d1b..d9a07b1 100644 (file)
@@ -52,12 +52,7 @@ function gpex_make_auth($chlg, $privkey, $datafields) {
         if (isset($_SESSION[$val])) {
             $tohash .= $_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 a.user_id = {?} AND FIND_IN_SET('bestalias', flags)", Session::getInt('uid'));
             $min_username = $res->fetchOneCell();
             $tohash      .= $min_username;
        }