Fix in-session authentication.
[platal.git] / modules / auth / auth.inc.php
index 62e94ef..383745a 100644 (file)
@@ -34,7 +34,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
 
     $user =& S::user();
     if ($user->hasProfile()) {
-        // XXX: Transition table for auth.
+        /* Transition table for authentification. */
         $personnal_data = $user->profile()->data();
         $personnal_data['matricule'] = $personnal_data['xorg_id'];
         $personnal_data['matricule_ax'] = $personnal_data['ax_id'];
@@ -60,7 +60,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
         } else if ($val == 'username') {
             $res = XDB::query("SELECT  alias
                                  FROM  aliases
-                                WHERE  id = {?} AND FIND_IN_SET('bestalias', flags)",
+                                WHERE  uid = {?} AND FIND_IN_SET('bestalias', flags)",
                               S::i('uid'));
             $min_username = $res->fetchOneCell();
             $params      .= gpex_prepare_param($val, $min_username, $tohash, $charset);