Exemplo n.º 1
0
 /**
  * Updates the VCard-formatted object
  *
  * @param string $cardData
  * @return void
  */
 public function put($cardData)
 {
     if (get_class($this->_converter) == 'Addressbook_Convert_Contact_VCard_Generic') {
         if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
             Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . " update by generic client not allowed. See Addressbook_Convert_Contact_VCard_Factory for supported clients.");
         }
         throw new Sabre_DAV_Exception_Forbidden('Update denied for unknow client');
     }
     $contact = $this->_converter->toTine20Model($cardData, $this->getRecord());
     $this->_contact = Addressbook_Controller_Contact::getInstance()->update($contact, false);
     $this->_vcard = null;
     // avoid sending headers during unit tests
     if (php_sapi_name() != 'cli') {
         // @todo this belongs to DAV_Server, but is currently not supported
         header('ETag: ' . $this->getETag());
     }
 }
 /**
  * Updates the VCard-formatted object
  *
  * @param string $cardData
  * @return void
  */
 public function put($cardData)
 {
     if (get_class($this->_converter) == 'Addressbook_Convert_Contact_VCard_Generic') {
         if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
             Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . " update by generic client not allowed. See Addressbook_Convert_Contact_VCard_Factory for supported clients.");
         }
         throw new DAV\Exception\Forbidden('Update denied for unknow client');
     }
     $contact = $this->_converter->toTine20Model($cardData, $this->getRecord(), array(Addressbook_Convert_Contact_VCard_Abstract::OPTION_USE_SERVER_MODLOG => true));
     try {
         $this->_contact = Addressbook_Controller_Contact::getInstance()->update($contact, false);
     } catch (Tinebase_Exception_AccessDenied $tead) {
         Tinebase_Exception::log($tead);
         throw new DAV\Exception\Forbidden('Access denied');
     }
     $this->_vcard = null;
     return $this->getETag();
 }