Remove the call to get_user_forlife in /profile/ax.
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Mon, 16 Jun 2008 02:08:08 +0000 (04:08 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Mon, 16 Jun 2008 02:08:08 +0000 (04:08 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
modules/profile.php

index b2429ec..69318cb 100644 (file)
@@ -268,18 +268,17 @@ class ProfileModule extends PLModule
 
     function handler_ax(&$page, $user = null)
     {
-        require_once 'user.func.inc.php';
-        $user = get_user_forlife($user);
+        $user = User::get($user);
         if (!$user) {
             return PL_NOT_FOUND;
         }
-        $res = XDB::query('SELECT matricule_ax
-                             FROM auth_user_md5 AS u
-                       INNER JOIN aliases       AS a ON (a.type = "a_vie" AND a.id = u.user_id)
-                            WHERE a.alias = {?}', $user);
+
+        $res = XDB::query("SELECT  matricule_ax
+                             FROM  auth_user_md5
+                            WHERE  user_id = {?}", $user->id());
         $mat = $res->fetchOneCell();
         if (!intval($mat)) {
-            $page->kill("Le matricule AX de $user est inconnu");
+            $page->kill("Le matricule AX de {$user->login()} est inconnu");
         }
         http_redirect("http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&anc_id=$mat");
     }