- // alias virtual
- $res = XDB::query(
- "SELECT alias
- FROM virtual
- INNER JOIN virtual_redirect USING(vid)
- 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['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']));
- // 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);
- if ($res->numRows()) {
- $user['photo'] = $res->fetchOneAssoc();
+ // Homes
+ $adrs = $pf->iterAddresses(Profile::ADDRESS_PERSO);
+ while ($adr = $adrs->next()) {
+ // TODO : find a way to fetch only the "street" part of the address
+ $group = $entry->addHome($adr['text'], null, null, $adr['postalCode'],
+ $adr['locality'], $adr['administrativeArea'], $adr['country'],
+ $adr['current'], $adr['mail'], $adr['mail']);
+ if (!empty($adr['fixed_tel'])) {
+ $entry->addTel($group, $adr['fixed_tel'], false, true, true, false, false, $adr['current'] && empty($pf->mobile));
+ }
+ if (!empty($adr['fax_tel'])) {
+ $entry->addTel($group, $adr['fax_tel'], true, false, false, false, false, false);