Merge commit 'origin/fusionax' into account
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Feb 2009 13:29:01 +0000 (14:29 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Feb 2009 13:29:01 +0000 (14:29 +0100)
Conflicts:

core

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
1  2 
include/vcard.inc.php

diff --combined include/vcard.inc.php
@@@ -37,7 -37,7 +37,7 @@@ class VCard extends PlVCar
  
      public function addUser($user)
      {
 -        $user = User::getSilent($user);
 +        $user = Profile::get($user);
          if ($user) {
              $this->user_list[] = $user;
              $this->count++;
@@@ -59,7 -59,7 +59,7 @@@
      {
          global $globals;
          $login = $entry['value'];
 -        $user  = get_user_details($login->login());
 +        $user  = get_user_details($login->hrid());
  
          if (empty($user['nom_usage'])) {
              $entry = new PlVCardEntry($user['prenom'], $user['nom'], null, null, @$user['nickname']);
          }
  
          // 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($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']);
+                 }
              }
          }
  
          // Melix
          $res = XDB::query(
                  "SELECT alias
 -                   FROM virtual
 -             INNER JOIN virtual_redirect USING(vid)
 +                   FROM virtual AS v
 +             INNER JOIN virtual_redirect AS vr ON (v.vid = vr.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}'",