X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvcard.inc.php;h=0671343f40ddface5cacec1ef4600f270bb263d5;hb=bd4f648ba40d48ad6bf8b60d5707f2a9324c450c;hp=ebda6af26110e1acb3019887a62c23cbaa4a61df;hpb=5f30b30e8b2657ade5c727e98de286386ee002d8;p=platal.git diff --git a/include/vcard.inc.php b/include/vcard.inc.php index ebda6af..0671343 100644 --- a/include/vcard.inc.php +++ b/include/vcard.inc.php @@ -19,7 +19,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('xorg.misc.inc.php'); require_once('user.func.inc.php'); class VCardIterator implements PlIterator @@ -37,8 +36,11 @@ class VCardIterator implements PlIterator public function add_user($user) { - $this->user_list[] = get_user_forlife($user); - $this->count++; + $user = User::getSilent($user); + if ($user) { + $this->user_list[] = $user; + $this->count++; + } } public function first() @@ -63,7 +65,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']); @@ -84,20 +86,19 @@ class VCardIterator implements PlIterator INNER JOIN auth_user_quick ON ( user_id = {?} AND emails_alias_pub = 'public' ) WHERE ( redirect={?} OR redirect={?} ) AND alias LIKE '%@{$globals->mail->alias_dom}'", - S::v('uid'), + $user['user_id'], $user['forlife'].'@'.$globals->mail->domain, $user['forlife'].'@'.$globals->mail->domain2); $user['virtualalias'] = $res->fetchOneCell(); - $user['gpxs_vcardjoin'] = join(',', array_map(array('VCard', 'text_encode'), $user['gpxs_name'])); - $user['binets_vcardjoin'] = join(',', array_map(array('VCard', 'text_encode'), $user['binets'])); + $user['gpxs_vcardjoin'] = join(', ', array_map(array('VCard', 'text_encode'), $user['gpxs_name'])); + $user['binets_vcardjoin'] = join(', ', array_map(array('VCard', 'text_encode'), $user['binets'])); // 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(); } @@ -172,7 +173,6 @@ class VCard header("Pragma: "); header("Cache-Control: "); header("Content-type: text/x-vcard; charset=UTF-8"); - header("Content-Transfer-Encoding: 8bit"); } }