X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvcard.inc.php;h=59eb6f5e6da98acab312906df1ddd5dd7aeb4904;hb=1f58ccb1e75eca08fbd04971d617ea372bc77b5a;hp=d16dae6e8762f5bdc32b10d742ce381204e9e59d;hpb=0c8cd507ad27b70c20e9f056b77fc286ee88e04f;p=platal.git diff --git a/include/vcard.inc.php b/include/vcard.inc.php index d16dae6..59eb6f5 100644 --- a/include/vcard.inc.php +++ b/include/vcard.inc.php @@ -1,6 +1,6 @@ addMail(null, $user['bestalias'] . '@' . $globals->mail->domain, true); $entry->addMail(null, $user['bestalias'] . '@' . $globals->mail->domain2); if ($user['bestalias'] != $user['forlife']) { @@ -110,24 +111,26 @@ class VCard extends PlVCard } // Pro - foreach ($user['adr_pro'] as $pro) { - $street = array($adr['adr1']); - if (!empty($pro['adr2'])) { - $street[] = $pro['adr2']; - } - if (!empty($pro['adr3'])) { - $street[] = $pro['adr3']; - } - $group = $entry->addWork($pro['entreprise'], null, $pro['poste'], $pro['fonction'], - $street, null, null, $pro['postcode'], $pro['city'], $pro['region'], @$pro['country']); - if (!empty($pro['tel'])) { - $entry->addTel($group, $pro['tel']); - } - if (!empty($pro['fax'])) { - $entry->addTel($group, $pro['fax'], true); - } - if (!empty($pro['email'])) { - $entry->addMail($group, $pro['email']); + if (!empty($user['adr_pro'])) { + foreach ($user['adr_pro'] as $pro) { + $street = array($pro['adr1']); + if (!empty($pro['adr2'])) { + $street[] = $pro['adr2']; + } + if (!empty($pro['adr3'])) { + $street[] = $pro['adr3']; + } + $group = $entry->addWork($pro['entreprise'], null, $pro['poste'], $pro['fonction'], + $street, null, null, $pro['postcode'], $pro['city'], $pro['region'], @$pro['country']); + if (!empty($pro['tel'])) { + $entry->addTel($group, $pro['tel']); + } + if (!empty($pro['fax'])) { + $entry->addTel($group, $pro['fax'], true); + } + if (!empty($pro['email'])) { + $entry->addMail($group, $pro['email']); + } } } @@ -162,7 +165,7 @@ class VCard extends PlVCard $res = XDB::query( "SELECT attach, attachmime FROM photo AS p - WHERE u.user_id = {?}", $login->id()); + WHERE p.uid = {?}", $login->id()); if ($res->numRows()) { list($data, $type) = $res->fetchOneRow(); $entry->setPhoto($data, strtoupper($type));