X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvcard.inc.php;h=2fb2e58a48198df2b39ec07b0f422c2d673fea9c;hb=2981f248b2db1adfdfbf4c294625bc382efe53fe;hp=99086cc1adb4f0ef157385bfbe3ed738a7425246;hpb=45ea6160465aeba0aa780e49c12272819dedffd1;p=platal.git diff --git a/include/vcard.inc.php b/include/vcard.inc.php index 99086cc..2fb2e58 100644 --- a/include/vcard.inc.php +++ b/include/vcard.inc.php @@ -1,6 +1,6 @@ visibility = Visibility::defaultForRead(Visibility::VIEW_PRIVATE); $this->freetext = $freetext; $this->photos = $photos; } public function addProfile($profile) { - $profile = Profile::get($profile, Profile::FETCH_ALL); + $profile = Profile::get($profile, Profile::FETCH_ALL, $this->visibility); if ($profile) { $this->profile_list[] = $profile; $this->count++; @@ -145,7 +147,7 @@ class VCard extends PlVCard // Melix if (!is_null($user)) { - $alias = $user->emailAliases(); + $alias = $user->emailAlias(); if (!is_null($alias) && $pf->alias_pub == 'public') { $entry->addMail(null, $alias); } @@ -182,8 +184,9 @@ class VCard extends PlVCard if ($this->photos) { $res = XDB::query( "SELECT attach, attachmime - FROM profile_photos AS p - WHERE p.pid = {?}", $pf->id()); + FROM profile_photos + WHERE pid = {?} AND pub IN ('public', {?})", + $pf->id(), $this->visibility->level()); if ($res->numRows()) { list($data, $type) = $res->fetchOneRow(); $entry->setPhoto($data, strtoupper($type)); @@ -193,5 +196,5 @@ class VCard extends PlVCard } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>