Use ProfileFilter for vcard building
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 15 Feb 2010 14:08:03 +0000 (15:08 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 15 Feb 2010 14:08:03 +0000 (15:08 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
modules/carnet.php

index ac3c0fe..0c8f790 100644 (file)
@@ -383,11 +383,9 @@ class CarnetModule extends PLModule
 
     function handler_vcard(&$page, $photos = null)
     {
-        $res = XDB::query('SELECT contact
-                             FROM contacts
-                            WHERE uid = {?}', S::v('uid'));
+        $pf = new ProfileFilter(new UFC_Contact(S::user()));
         $vcard = new VCard($photos == 'photos');
-        $vcard->addUsers($res->fetchColumn());
+        $vcard->addProfiles($pf->getProfiles());
         $vcard->show();
     }
 }