Removes get_user_forlife calls in VCards.
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Mon, 16 Jun 2008 01:12:12 +0000 (03:12 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Mon, 16 Jun 2008 01:42:32 +0000 (03:42 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
include/vcard.inc.php

index a4366fc..52d6cb3 100644 (file)
@@ -37,7 +37,7 @@ class VCardIterator implements PlIterator
 
     public function add_user($user)
     {
-        $this->user_list[] = get_user_forlife($user);
+        $this->user_list[] = User::get($user);
         $this->count++;
     }
 
@@ -63,7 +63,7 @@ class VCardIterator implements PlIterator
         }
         global $globals;
         $login = array_shift($this->user_list);
-        $user  = get_user_details($login);
+        $user  = get_user_details($login->login());
 
         if (strlen(trim($user['freetext']))) {
             $user['freetext'] = pl_entity_decode($user['freetext']);
@@ -94,10 +94,9 @@ class VCardIterator implements PlIterator
         // get photo
         if ($this->photos) {
             $res = XDB::query(
-                    "SELECT attach, attachmime
-                       FROM photo   AS p
-                 INNER JOIN aliases AS a ON (a.id = p.uid AND a.type = 'a_vie')
-                      WHERE a.alias = {?}", $login);
+                    "SELECT  attach, attachmime
+                       FROM  photo AS p
+                      WHERE  u.user_id = {?}", $login->id());
             if ($res->numRows()) {
                 $user['photo'] = $res->fetchOneAssoc();
             }