Copyright 2004-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Stuart Binge (omicron@mighty.co.za)
Author: Gunnar Wrobel (wrobel@pardus.de)
Author: Thomas Jarosch (thomas.jarosch@intra2net.com)
示例#1
0
 /**
  * Constructor.
  *
  * @param Horde_Kolab_Storage_Folder          $folder The storage folder
  *                                                    representing this
  *                                                    resource.
  * @param Horde_Kolab_FreeBusy_Owner_Freebusy $owner  The resource owner.
  */
 public function __construct(Horde_Kolab_Storage_Folder $folder, Horde_Kolab_FreeBusy_Owner_Event $owner)
 {
     if ($folder->getType() != 'event') {
         throw new Horde_Kolab_FreeBusy_Exception(sprintf('Resource %s has type "%s" not "event"!', $folder->getName(), $folder->getType()));
     }
     parent::__construct($folder, $owner);
 }
示例#2
0
文件: Base.php 项目: platolin/horde
 /**
  * Delete the specified messages from this folder.
  *
  * @param array|string $uids Backend id(s) of the message to be deleted.
  */
 public function deleteBackendIds($uids)
 {
     if (!is_array($uids)) {
         $uids = array($uids);
     }
     $this->_driver->deleteMessages($this->_folder->getPath(), $uids);
     $this->_driver->expunge($this->_folder->getPath());
 }
示例#3
0
 /**
  * Loads the object from the backend.
  *
  * @param string $backend_id                       The object ID within the
  *                                                 backend.
  * @param Horde_Kolab_Storage_Folder $folder       The folder to retrieve
  *                                                 the data object from.
  * @param Horde_Kolab_Storage_Object_Writer $data  The data parser.
  * @param Horde_Mime_Part $structure               The MIME message
  *                                                 structure of the object.
  */
 public function load($backend_id, Horde_Kolab_Storage_Folder $folder, Horde_Kolab_Storage_Object_Writer $data, Horde_Mime_Part $structure = null)
 {
     $this->_folder = $folder->getPath();
     $this->_backend_id = $backend_id;
     $result = Horde_Kolab_Storage_Object_MimeType::matchMimePartToFolderType($structure, $folder->getType());
     /* No object content matching the folder type: Try fetching the header
      * and look for a Kolab type deviating from the folder type. */
     if ($result === false || $result[0] === false) {
         $result = Horde_Kolab_Storage_Object_MimeType::matchMimePartToHeaderType($structure, $this->getHeaders());
         /* Seems to have no Kolab data part: mark invalid. */
         if ($result === false || $result[0] === false) {
             $this->_type = self::TYPE_INVALID;
             $this->addParseError(self::ERROR_MISSING_KOLAB_PART);
             return;
         }
     }
     $this->_type = $result[1];
     $mime_part = $structure->getPart($result[0]);
     if (empty($mime_part)) {
         $this->_type = self::TYPE_INVALID;
         $this->addParseError(self::ERROR_MISSING_KOLAB_PART);
         return;
     }
     $this->_mime_part_id = $result[0];
     $mime_part->setContents($this->getContent());
     $result = $data->load($mime_part->getContents(array('stream' => true)), $this);
     if ($result instanceof Exception) {
         $this->addParseError(self::ERROR_INVALID_KOLAB_PART, $result->getMessage());
     } else {
         foreach ($structure->getParts() as $part) {
             if ($part->getMimeId() == $this->_mime_part_id || !$part->getName()) {
                 continue;
             }
             $this->_data['_attachments'][$part->getName()] = array('type' => $part->getType(), 'content' => $this->_getDriver()->fetchBodypart($this->_getFolder(), $this->getBackendId(), $part->getMimeId()));
         }
     }
     $this->_structure = $structure;
 }
示例#4
0
文件: Kolab.php 项目: raz0rsdge/horde
 /**
  * Fetch the resource ACL.
  *
  * @return array ACL for this resource.
  *
  * @throws Horde_Kolab_FreeBusy_Exception If retrieving the ACL information
  *                                        failed.
  */
 public function getAcl()
 {
     $perm = $this->_folder->getPermission();
     $acl =& $perm->acl;
     return $acl;
 }