Merge branch '2013.10' into 2014.11
[tine20] / tine20 / Tinebase / User.php
index 770db17..e87e742 100644 (file)
@@ -539,13 +539,15 @@ class Tinebase_User
             $contact = $addressbook->getByUserId($syncedUser->getId());
             $originalContact = clone $contact;
 
+            if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
+                . ' user: ' .print_r($syncedUser->toArray(), true));
+
             Tinebase_User::getInstance()->updateContactFromSyncBackend($syncedUser, $contact);
             $contact = self::_user2Contact($syncedUser, $contact);
 
             if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
-                . print_r($syncedUser->toArray(), true)
-                . ' new: ' . print_r($contact->toArray(), true)
-                . ' orig:' . print_r($originalContact->toArray(), true));
+                . ' new contact: ' . print_r($contact->toArray(), true)
+                . ' orig contact:' . print_r($originalContact->toArray(), true));
 
             // TODO allow to diff jpegphoto, too / maybe this should only be done when called via CLI/cronjob
             $diff = $contact->diff($originalContact, array('jpegphoto'));
@@ -569,6 +571,10 @@ class Tinebase_User
         } catch (Addressbook_Exception_NotFound $aenf) {
             self::createContactForSyncedUser($syncedUser);
             $syncedUser = Tinebase_User::getInstance()->updateUserInSqlBackend($syncedUser);
+        } catch (Tinebase_Exception_NotFound $tenf) {
+            if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
+                . ' Contact information seems to be missing in sync backend');
+            Tinebase_Exception::log($tenf);
         }
     }