package.xml0000664000175000017500000023657312207101546011315 0ustar janjan Horde_Kolab_Storage pear.horde.org Kolab_Storage A package for handling Kolab data stored on an IMAP server Storing user data in an IMAP account belonging to the user is one of the Kolab server core concepts. This package provides all the necessary means to deal with this type of data storage effectively. Gunnar Wrobel wrobel p@rdus.de yes 2013-08-27 2.0.5 2.0.0 stable stable LGPL-2.1 * [jan] Catch errors in Kolab_Storage_Driver_Imap#fetchComplete() (Thomas Jarosch <thomas.jarosch@intra2net.com>, Bug #12584). * [jan] Retrieve status changes during running requests (Thomas Jarosch <thomas.jarosch@intra2net.com>, Bug #12589). 5.3.0 1.7.0 Horde_Cache pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Exception pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Kolab_Format pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Mime pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Translation pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Support pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Util pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Imap_Client pear.horde.org 2.14.0 3.0.0alpha1 3.0.0alpha1 Horde_History pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Test pear.horde.org 2.1.0 3.0.0alpha1 3.0.0alpha1 HTTP_Request pear.php.net Net_IMAP pear.php.net 1.1.0 imap 0.1.0 0.1.0 alpha alpha 2008-09-11 LGPL-2.1 * Initial release. 2008-09-12 0.2.0 0.1.0 alpha alpha LGPL-2.1 * Fixed the Kolab_Storage::getFolder() function. * Added Kolab_List::getForeignDefault() to retrieve the default folders of other users. Also fixes issues with overlapping default folders. * Fixed retrieval of general Kolab annotations. * Correctly determine the owner of the INBOX of another user. * Automatically trigger a folder within the folder handler. * Moved Kolab session handler from Kolab_Storage to Kolab_Server. * Moved the IMAP drivers from Kolab_Storage to Kolab_Server as the IMAP connection must be handled by the Kolab session. 2008-12-05 0.3.0 0.1.0 alpha alpha LGPL-2.1 * Added attachment support. * Fixed triggering folders. * Fixed renaming default folders. * Implemented extended free/busy access concept. * kolab/issue3292 (Sharing default groupware resources does not work in the web client) 0.4.0 0.1.0 alpha alpha 2011-02-27 LGPL-2.1 * Added namespace support (Bug #6691). * Converted the package to Horde 4 / PHP 5. * Fixed list driver to prevent overwriting folder data when authenticating twice (relevant for testing). * Allow to supress triggering (relevant for testing). 1.0.0alpha1 1.0.0 alpha alpha 2011-03-08 LGPL-2.1 * First alpha release for Horde 4. 1.0.0beta1 1.0.0 beta beta 2011-03-16 LGPL-2.1 * First beta release for Horde 4. 1.0.0RC1 1.0.0 beta beta 2011-03-22 LGPL-2.1 * First release candidate for Horde 4. * [gwr] Fix creating/modifying objects. * [gwr] Deal with Kolab_Format parsing exceptions. * [gwr] Throw an exception on a duplicate UID within one folder. 1.0.0RC2 1.0.0 beta beta 2011-03-29 LGPL-2.1 * Second release candidate for Horde 4. 1.0.0 1.0.0 stable stable 2011-04-06 LGPL-2.1 * First stable release for Horde 4. 1.1.0 1.1.0 stable stable 2011-11-13 LGPL-2.1 * [gwr] Readd support for updating Horde_History. * [gwr] Fix support for multiple namespaces of the same type. * [jan] Update Latvian translation. * [gwr] Add support for retrieving objects by backend id. * [gwr] Add a handler for active sync settings. * [gwr] Add preference data query. * [gwr] Add support for storing data query results in the cache. * [gwr] Add support for deleting messages by backend UID. * [jan] Update Spanish translation. * [gwr] Add logging for data handlers. 2.0.0alpha1 1.1.0 alpha stable 2012-07-05 LGPL-2.1 * First alpha release for Horde 5. 2.0.0beta1 1.1.0 beta stable 2012-07-19 LGPL-2.1 * First beta release for Horde 5. * [jan] Fix renaming of shares (Bug #11281). * [jan] Fix moving objects to a different folder (Bug #11280). * [jan] Fix listing and loading data from IMAP server (Bug #11273). 2.0.0beta2 1.1.0 beta stable 2012-08-29 LGPL-2.1 * [gwr] Avoid overwriting unknown XML elements (Bug #11309) 2.0.0beta3 2.0.0 beta stable 2012-10-12 LGPL-2.1 * [gwr] Allow setting the default folder. * [gwr] Reactivate folder list caching. 2.0.0RC1 2.0.0 beta stable 2012-10-26 LGPL-2.1 * [gwr] Corrected fix for modifying Kolab objects. 2.0.0 2.0.0 stable stable 2012-10-30 LGPL-2.1 * First stable release for Horde 5. 2.0.1 2.0.0 stable stable 2012-11-06 LGPL-2.1 * [jan] Update Japanese translation (Hiromi Kimura <hiromi@tac.tsukuba.ac.jp>). 2.0.2 2.0.0 stable stable 2012-11-27 LGPL-2.1 * [gwr] Add a time based snychronization strategy (Bug #11590). * [gwr] Correct cache update after move (Bug #11305). * [gwr] Remove deleted objects from the cache (Bug #11674). 2.0.3 2.0.0 stable stable 2013-01-09 LGPL-2.1 * [jan] Update Basque translation (Ibon Igartua <ibon.igartua@ehu.es>). 2.0.4 2.0.0 stable stable 2013-03-05 LGPL-2.1 * [jan] Fix unit tests. 2.0.5 2.0.0 stable stable 2013-08-27 LGPL-2.1 * [jan] Catch errors in Kolab_Storage_Driver_Imap#fetchComplete() (Thomas Jarosch <thomas.jarosch@intra2net.com>, Bug #12584). * [jan] Retrieve status changes during running requests (Thomas Jarosch <thomas.jarosch@intra2net.com>, Bug #12589). Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/examples/list.php0000644000175000017500000000023012207101545023211 0ustar janjanlistFolders()); Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/OLD/Folder.php0000664000175000017500000010106612207101545022264 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Kolab_Folder class represents an single folder in the Kolab * backend. * * Copyright 2004-2013 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 * @author Gunnar Wrobel * @author Thomas Jarosch * @package Kolab_Storage */ class Horde_Kolab_Storage_Folder_Base implements Horde_Kolab_Storage_Folder { /** * The handler for the list of folders. * * @var Horde_Kolab_Storage_List */ private $_list; /** * The folder path. * * @var string */ private $_path; /** * Additional folder information. * * @var array */ private $_data; /** * Constructor. * * @param Horde_Kolab_Storage_List $list The handler for the list of * folders. * @param string $path Path of the folder. */ public function __construct(Horde_Kolab_Storage_List $list, $path) { $this->_list = $list; $this->_path = $path; } /** * Fetch the data array. * * @return NULL */ private function _init() { if ($this->_data === null) { $this->_data = $this->_list->getQuery()->folderData($this->_path); } } /** * Fetch a data value. * * @param string $key The name of the data value to fetch. * * @return mixed The data value */ public function get($key) { $this->_init(); if (isset($this->_data[$key])) { return $this->_data[$key]; } throw new Horde_Kolab_Storage_Exception( sprintf('No "%s" information available!', $key) ); } /** * Fetch a data value and accept a missing value (represented by the return value NULL). * * @param string $key The name of the data value to fetch. * * @return mixed The data value */ public function getWithNull($key) { $this->_init(); if (isset($this->_data[$key])) { return $this->_data[$key]; } } /** * Return the storage path of the folder. * * @return string The storage path of the folder. */ public function getPath() { return $this->_path; } /** * Return the namespace type of the folder. * * @return string The namespace type of the folder. */ public function getNamespace() { return $this->get('namespace'); } /** * Return the namespace prefix of the folder. * * @return string The namespace prefix of the folder. */ public function getPrefix() { return $this->get('prefix'); } /** * Returns a readable title for this folder. * * @return string The folder title. */ public function getTitle() { return $this->get('name'); } /** * Returns the owner of the folder. * * @return string The owner of this folder. */ public function getOwner() { return $this->getWithNull('owner'); } /** * Returns the folder path without namespace components. * * @return string The subpath of this folder. */ public function getSubpath() { return $this->get('subpath'); } /** * Returns the folder parent. * * @return string The parent of this folder. */ public function getParent() { return $this->get('parent'); } /** * Is this a default folder? * * @return boolean Boolean that indicates the default status. */ public function isDefault() { return $this->get('default'); } /** * The type of this folder. * * @return string The folder type. */ public function getType() { return $this->get('type'); } /** * The root of the Kolab annotation hierarchy, used on the various IMAP * folder that are used by Kolab clients. */ const ANNOT_ROOT = '/shared/vendor/kolab/'; /** * The annotation, as defined by the Kolab format spec, that is used to store * information about what groupware format the folder contains. */ const ANNOT_FOLDER_TYPE = '/shared/vendor/kolab/folder-type'; /** * Horde-specific annotations on the imap folder have this prefix. */ const ANNOT_SHARE_ATTR = '/shared/vendor/horde/share-'; /** * Kolab specific free/busy relevance */ const FBRELEVANCE_ADMINS = 0; const FBRELEVANCE_READERS = 1; const FBRELEVANCE_NOBODY = 2; /** * Additional Horde folder attributes. * * @var array */ private $_attributes; /** * Additional Kolab folder attributes. * * @var array */ private $_kolab_attributes; /** * The permission handler for the folder. * * @var Horde_Permission_Kolab */ var $_perms; /** * Links to the data handlers for this folder. * * @var array */ // var $_data; /** * Links to the annotation data handlers for this folder. * * @var array */ var $_annotation_data; /** * Indicate that the folder data has been modified from the * outside and all Data handlers need to synchronize. * * @var boolean */ var $tainted = false; /** * Saves the folder. * * @param array $attributes An array of folder attributes. You can * set any attribute but there are a few * special ones like 'type', 'default', * 'owner' and 'desc'. * * @return NULL */ public function save($attributes = null) { if (!isset($this->_path)) { /* A new folder needs to be created */ if (!isset($this->_new_path)) { throw new Horde_Kolab_Storage_Exception('Cannot create this folder! The name has not yet been set.', Horde_Kolab_Storage_Exception::FOLDER_NAME_UNSET); } if (isset($attributes['type'])) { $this->_type = $attributes['type']; unset($attributes['type']); } else { $this->_type = 'mail'; } if (isset($attributes['default'])) { $this->_default = $attributes['default']; unset($attributes['default']); } else { $this->_default = false; } $result = $this->_driver->exists($this->_new_path); if ($result) { throw new Horde_Kolab_Storage_Exception(sprintf("Unable to add %s: destination folder already exists", $this->_new_path), Horde_Kolab_Storage_Exception::FOLDER_EXISTS); } $this->_driver->create($this->_new_path); $this->_path = $this->_new_path; $this->_new_path = null; /* Initialize the new folder to default permissions */ if (empty($this->_perms)) { $this->getPermission(); } } else { $type = $this->getType(); if (isset($attributes['type'])) { if ($attributes['type'] != $type) { Horde::logMessage(sprintf('Cannot modify the type of a folder from %s to %s!', $type, $attributes['type']), 'ERR'); } unset($attributes['type']); } if (isset($attributes['default'])) { $this->_default = $attributes['default']; unset($attributes['default']); } else { $this->_default = $this->isDefault(); } if (isset($this->_new_path) && $this->_new_path != $this->_path) { /** The folder needs to be renamed */ $result = $this->_driver->exists($this->_new_path); if ($result) { throw new Horde_Kolab_Storage_Exception(sprintf(Horde_Kolab_Storage_Translation::t("Unable to rename %s to %s: destination folder already exists"), $name, $new_name)); } $result = $this->_driver->rename($this->_path, $this->_new_path); $this->_storage->removeFromCache($this); $this->_path = $this->_new_path; $this->_new_path = null; $this->_title = null; $this->_owner = null; } } if (isset($attributes['owner'])) { if ($attributes['owner'] != $this->getOwner()) { Horde::logMessage(sprintf('Cannot modify the owner of a folder from %s to %s!', $this->getOwner(), $attributes['owner']), 'ERR'); } unset($attributes['owner']); } /** Handle the folder type */ $folder_type = $this->_type . ($this->_default ? '.default' : ''); if ($this->_type_annotation != $folder_type) { try { $result = $this->_setAnnotation(self::ANNOT_FOLDER_TYPE, $folder_type); } catch (Exception $e) { $this->_type = null; $this->_default = false; $this->_type_annotation = null; throw $e; } } if (!empty($attributes)) { if (!is_array($attributes)) { $attributes = array($attributes); } foreach ($attributes as $key => $value) { if ($key == 'params') { $params = unserialize($value); if (isset($params['xfbaccess'])) { $result = $this->setXfbAccess($params['xfbaccess']); if (is_a($result, 'PEAR_Error')) { return $result; } } if (isset($params['fbrelevance'])) { $result = $this->setFbrelevance($params['fbrelevance']); if (is_a($result, 'PEAR_Error')) { return $result; } } } // setAnnotation apparently does not suppoort UTF-8 nor any special characters $store = base64_encode($value); if ($key == 'desc') { $entry = '/shared/comment'; } else { $entry = self::ANNOT_SHARE_ATTR . $key; } $result = $this->_setAnnotation($entry, $store); if (is_a($result, 'PEAR_Error')) { return $result; } } $this->_attributes = $attributes; } /** Now save the folder permissions */ if (isset($this->_perms)) { $this->_perms->save(); $this->_perms = null; } $this->_storage->addToCache($this); return true; } /** * Delete this folder. * * @return boolean|PEAR_Error True if the operation succeeded. */ function delete() { $this->_driver->delete($this->_path); $this->_storage->removeFromCache($this); return true; } /** * Returns one of the attributes of the folder, or an empty string * if it isn't defined. * * @param string $attribute The attribute to retrieve. * * @return mixed The value of the attribute, an empty string or an * error. */ function getAttribute($attribute) { if (!isset($this->_attributes[$attribute])) { if ($attribute == 'desc') { $entry = '/comment'; } else { $entry = self::ANNOT_SHARE_ATTR . $attribute; } $annotation = $this->_getAnnotation($entry, $this->_path); if (is_a($annotation, 'PEAR_Error')) { return $annotation; } if (empty($annotation)) { $this->_attributes[$attribute] = ''; } else { $this->_attributes[$attribute] = base64_decode($annotation); } } return $this->_attributes[$attribute]; } /** * Returns one of the Kolab attributes of the folder, or an empty * string if it isn't defined. * * @param string $attribute The attribute to retrieve. * * @return mixed The value of the attribute, an empty string or an * error. */ function getKolabAttribute($attribute) { if (!isset($this->_kolab_attributes[$attribute])) { $entry = KOLAB_ANNOT_ROOT . $attribute; $annotation = $this->_getAnnotation($entry, $this->_path); if (is_a($annotation, 'PEAR_Error')) { return $annotation; } if (empty($annotation)) { $this->_kolab_attributes[$attribute] = ''; } else { $this->_kolab_attributes[$attribute] = $annotation; } } return $this->_kolab_attributes[$attribute]; } /** * Returns whether the folder exists. * * @return boolean|PEAR_Error True if the folder exists. */ function exists() { if ($this->_path === null) { return false; } try { return $this->_driver->exists($this->_path); } catch (Horde_Imap_Client_Exception $e) { return false; } } /** * Retrieve a handler for the data in this folder. * * @param Kolab_List $list The handler for the list of folders. * * @return Horde_Kolab_Storage_Data The data handler. */ public function getData($object_type = null, $data_version = 1) { if (empty($object_type)) { $object_type = $this->getType(); if (is_a($object_type, 'PEAR_Error')) { return $object_type; } } if ($this->tainted) { foreach ($this->_data as $data) { $data->synchronize(); } $this->tainted = false; } $key = $object_type . '|' . $data_version; if (!isset($this->_data[$key])) { if ($object_type != 'annotation') { $type = $this->getType(); } else { $type = 'annotation'; } $data = new Horde_Kolab_Storage_Data($type, $object_type, $data_version); $data->setFolder($this); $data->setCache($this->_storage->getDataCache()); $data->synchronize(); $this->_data[$key] = &$data; } return $this->_data[$key]; } /** * Delete the specified message from this folder. * * @param string $id IMAP id of the message to be deleted. * @param boolean $trigger Should the folder be triggered? * * @return NULL */ public function deleteMessage($id, $trigger = true) { // Select folder $this->_driver->deleteMessages($this->_path, $id); $this->_driver->expunge($this->_path); } /** * Move the specified message to the specified folder. * * @param string $id IMAP id of the message to be moved. * @param string $folder Name of the receiving folder. * * @return boolean True if successful. */ public function moveMessage($id, $folder) { $this->_driver->select($this->_path); $this->_driver->moveMessage($this->_path, $id, $folder); $this->_driver->expunge($this->_path); } /** * Move the specified message to the specified share. * * @param string $id IMAP id of the message to be moved. * @param string $share Name of the receiving share. * * @return NULL */ public function moveMessageToShare($id, $share) { $folder = $this->_storage->getByShare($share, $this->getType()); $folder->tainted = true; $success = $this->moveMessage($id, $folder->name); } /** * Retrieve the supported formats. * * @return array The names of the supported formats. */ function getFormats() { global $conf; if (empty($conf['kolab']['misc']['formats'])) { $formats = array('XML'); } else { $formats = $conf['kolab']['misc']['formats']; } if (!is_array($formats)) { $formats = array($formats); } if (!in_array('XML', $formats)) { $formats[] = 'XML'; } return $formats; } /** * Save an object in this folder. * * @param array $object The array that holds the data of the object. * @param int $data_version The format handler version. * @param string $object_type The type of the kolab object. * @param string $id The IMAP id of the old object if it * existed before * @param array $old_object The array that holds the current data of the * object. * * @return boolean True on success. */ public function saveObject(&$object, $data_version, $object_type, $id = null, &$old_object = null) { // Select folder $this->_driver->select($this->_path); $new_headers = new Horde_Mime_Headers(); $new_headers->setEOL("\r\n"); $formats = $this->getFormats(); $handlers = array(); foreach ($formats as $type) { $handlers[$type] = &Horde_Kolab_Format::factory($type, $object_type, $data_version); if (is_a($handlers[$type], 'PEAR_Error')) { if ($type == 'XML') { return $handlers[$type]; } Horde::logMessage(sprintf('Loading format handler "%s" failed: %s', $type, $handlers[$type]->getMessage()), 'ERR'); continue; } } if ($id != null) { /** Update an existing kolab object */ if (!in_array($id, $this->_driver->getUids($this->_path))) { return PEAR::raiseError(sprintf(Horde_Kolab_Storage_Translation::t("The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost."), $id)); } /** Parse email and load Kolab format structure */ $result = $this->parseMessage($id, $handlers['XML']->getMimeType(), true, $formats); if (is_a($result, 'PEAR_Error')) { return $result; } list($old_message, $part_ids, $mime_message, $mime_headers) = $result; if (is_a($old_message, 'PEAR_Error')) { return $old_message; } if (isset($object['_attachments']) && isset($old_object['_attachments'])) { $attachments = array_keys($object['_attachments']); foreach (array_keys($old_object['_attachments']) as $attachment) { if (!in_array($attachment, $attachments)) { foreach ($mime_message->getParts() as $part) { if ($part->getName() === $attachment) { foreach (array_keys($mime_message->_parts) as $key) { if ($mime_message->_parts[$key]->getMimeId() == $part->getMimeId()) { unset($mime_message->_parts[$key]); break; } } $mime_message->_generateIdMap($mime_message->_parts); } } } } } $object = array_merge($old_object, $object); if (isset($attachments)) { foreach ($mime_message->getParts() as $part) { $name = $part->getName(); foreach ($attachments as $attachment) { if ($name === $attachment) { $object['_attachments'][$attachment]['id'] = $part->getMimeId(); } } } } /** Copy email header */ if (!empty($mime_headers) && !$mime_headers === false) { foreach ($mime_headers as $header => $value) { $new_headers->addheader($header, $value); } } } else { $mime_message = $this->_prepareNewMessage($new_headers); $mime_part_id = false; } if (isset($object['_attachments'])) { $attachments = array_keys($object['_attachments']); foreach ($attachments as $attachment) { $data = $object['_attachments'][$attachment]; if (!isset($data['content']) && !isset($data['path'])) { /** * There no new content and no new path. Do not rewrite the * attachment. */ continue; } $part = new Horde_Mime_Part(); $part->setType(isset($data['type']) ? $data['type'] : null); $part->setContents(isset($data['content']) ? $data['content'] : file_get_contents($data['path'])); $part->setCharset('UTF-8'); $part->setTransferEncoding('quoted-printable'); $part->setDisposition('attachment'); $part->setName($attachment); if (!isset($data['id'])) { $mime_message->addPart($part); } else { $mime_message->alterPart($data['id'], $part); } } } foreach ($formats as $type) { $new_content = $handlers[$type]->save($object); if (is_a($new_content, 'PEAR_Error')) { return $new_content; } /** Update mime part */ $part = new Horde_Mime_Part(); $part->setType($handlers[$type]->getMimeType()); $part->setContents($new_content); $part->setCharset('UTF-8'); $part->setTransferEncoding('quoted-printable'); $part->setDisposition($handlers[$type]->getDisposition()); $part->setDispositionParameter('x-kolab-type', $type); $part->setName($handlers[$type]->getName()); if (!isset($part_ids) || $part_ids[$type] === false) { $mime_message->addPart($part); } else { $mime_message->alterPart($part_ids[$type], $part); } } // Update email headers $new_headers->addHeader('From', $this->_driver->getAuth()); $new_headers->addHeader('To', $this->_driver->getAuth()); $new_headers->addHeader('Date', date('r')); $new_headers->addHeader('X-Kolab-Type', $handlers['XML']->getMimeType()); $new_headers->addHeader('Subject', $object['uid']); $new_headers->addHeader('User-Agent', 'Horde::Kolab::Storage v0.2'); $new_headers->addHeader('MIME-Version', '1.0'); $mime_message->addMimeHeaders(array('headers' => $new_headers)); $msg = $new_headers->toString() . $mime_message->toString(array('canonical' => true, 'headers' => false)); // delete old email? if ($id != null) { $this->_driver->deleteMessages($this->_path, $id); } // store new email try { $result = $this->_driver->appendMessage($this->_path, $msg); } catch (Horde_Kolab_Storage_Exception $e) { if ($id != null) { $this->_driver->undeleteMessages($id); } } // remove deleted object if ($id != null) { $this->_driver->expunge($this->_path); } } /** * Get an IMAP message and retrieve the Kolab Format object. * * @param int $id The message to retrieve. * @param string $mime_type The mime type of the part to retrieve. * @param boolean $parse_headers Should the heades be Mime parsed? * @param array $formats The list of possible format parts. * * @return array|PEAR_Error An array that list the Kolab XML * object text, the mime ID of the part * with the XML object, the Mime parsed * message and the Mime parsed headers if * requested. */ function parseMessage($id, $mime_type, $parse_headers = true, $formats = array('XML')) { $raw_headers = $this->_driver->getMessageHeader($this->_path, $id); if (is_a($raw_headers, 'PEAR_Error')) { return PEAR::raiseError(sprintf(Horde_Kolab_Storage_Translation::t("Failed retrieving the message with ID %s. Original error: %s."), $id, $raw_headers->getMessage())); } $body = $this->_driver->getMessageBody($this->_path, $id); if (is_a($body, 'PEAR_Error')) { return PEAR::raiseError(sprintf(Horde_Kolab_Storage_Translation::t("Failed retrieving the message with ID %s. Original error: %s."), $id, $body->getMessage())); } //@todo: not setting "forcemime" means the subparts get checked too. Seems incorrect. $mime_message = Horde_Mime_Part::parseMessage($raw_headers . "\r" . $body, array('forcemime' => true)); $parts = $mime_message->contentTypeMap(); $mime_headers = false; $xml = false; // Read in a Kolab event object, if one exists $part_ids['XML'] = array_search($mime_type, $parts); if ($part_ids['XML'] !== false) { if ($parse_headers) { $mime_headers = Horde_Mime_Headers::parseHeaders($raw_headers); $mime_headers->setEOL("\r\n"); } $part = $mime_message->getPart($part_ids['XML']); //@todo: Check what happened to this call //$part->transferDecodeContents(); $xml = $part->getContents(); } $alternate_formats = array_diff(array('XML'), $formats); if (!empty($alternate_formats)) { foreach ($alternate_formats as $type) { $part_ids[$type] = false; } foreach ($mime_message->getParts() as $part) { $params = $part->getDispositionParameters(); foreach ($alternate_formats as $type) { if (isset($params['x-kolab-format']) && $params['x-kolab-format'] == $type) { $part_ids[$type] = $part->getMimeId(); } } } } $result = array($xml, $part_ids, $mime_message, $mime_headers); return $result; } /** * Get annotation values on IMAP servers that do not support * METADATA. * * @return array|PEAR_Error The anotations of this folder. */ function _getAnnotationData() { $this->_annotation_data = $this->getData('annotation'); } /** * Get an annotation value of this folder. * * @param $key The key of the annotation to retrieve. * * @return string|PEAR_Error The anotation value. */ function _getAnnotation($key) { global $conf; if (empty($conf['kolab']['imap']['no_annotations'])) { return $this->_driver->getAnnotation($key, $this->_path); } if (!isset($this->_annotation_data)) { $this->_getAnnotationData(); } $data = $this->_annotation_data->getObject('KOLAB_FOLDER_CONFIGURATION'); if (is_a($data, 'PEAR_Error')) { Horde::logMessage(sprintf('Error retrieving annotation data on folder %s: %s', $this->_path, $data->getMessage()), 'ERR'); return ''; } if (isset($data[$key])) { return $data[$key]; } else { return ''; } } /** * Set an annotation value of this folder. * * @param $key The key of the annotation to change. * @param $value The new value. * * @return boolean|PEAR_Error True on success. */ function _setAnnotation($key, $value) { if (empty($conf['kolab']['imap']['no_annotations'])) { return $this->_driver->setAnnotation($key, $value, $this->_path); } if (!isset($this->_annotation_data)) { $this->_getAnnotationData(); } $data = $this->_annotation_data->getObject('KOLAB_FOLDER_CONFIGURATION'); if (is_a($data, 'PEAR_Error')) { Horde::logMessage(sprintf('Error retrieving annotation data on folder %s: %s', $this->_path, $data->getMessage()), 'ERR'); $data = array(); $uid = null; } else { $uid = 'KOLAB_FOLDER_CONFIGURATION'; } $data[$key] = $value; $data['uid'] = 'KOLAB_FOLDER_CONFIGURATION'; return $this->_annotation_data->save($data, $uid); } /** * Get the free/busy relevance for this folder * * @return int Value containing the FB_RELEVANCE. */ function getFbrelevance() { $result = $this->getKolabAttribute('incidences-for'); if (is_a($result, 'PEAR_Error') || empty($result)) { return KOLAB_FBRELEVANCE_ADMINS; } switch ($result) { case 'admins': return KOLAB_FBRELEVANCE_ADMINS; case 'readers': return KOLAB_FBRELEVANCE_READERS; case 'nobody': return KOLAB_FBRELEVANCE_NOBODY; default: return KOLAB_FBRELEVANCE_ADMINS; } } /** * Set the free/busy relevance for this folder * * @param int $relevance Value containing the FB_RELEVANCE * * @return mixed True on success or a PEAR_Error. */ function setFbrelevance($relevance) { switch ($relevance) { case KOLAB_FBRELEVANCE_ADMINS: $value = 'admins'; break; case KOLAB_FBRELEVANCE_READERS: $value = 'readers'; break; case KOLAB_FBRELEVANCE_NOBODY: $value = 'nobody'; break; default: $value = 'admins'; } return $this->_setAnnotation(KOLAB_ANNOT_ROOT . 'incidences-for', $value); } /** * Get the extended free/busy access settings for this folder * * @return array Array containing the users with access to the * extended information. */ function getXfbaccess() { $result = $this->getKolabAttribute('pxfb-readable-for'); if (is_a($result, 'PEAR_Error') || empty($result)) { return array(); } return explode(' ', $result); } /** * Set the extended free/busy access settings for this folder * * @param array $access Array containing the users with access to the * extended information. * * @return mixed True on success or a PEAR_Error. */ function setXfbaccess($access) { $value = join(' ', $access); return $this->_setAnnotation(KOLAB_ANNOT_ROOT . 'pxfb-readable-for', $value); } } Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/OLD/Trigger.php0000664000175000017500000002012112207101545022444 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * This decorator triggers a URL following certain actions on the folder. * * Copyright 2008-2010 Klarälvdalens Datakonsult AB * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.horde.org/licenses/lgpl21. * * @author Gunnar Wrobel * @package Kolab_Storage */ class Horde_Kolab_Storage_Folder_Decorator_Trigger extends Horde_Kolab_Storage_Folder_Decorator_Base { /** * An output for log messages. * * @var Horde_Log_Logger */ private $_logger; /** * Constructor * * @param Horde_Kolab_Storage_Folder $folder The folder to be decorated. * @param Horde_Log_Logger $logger The logger. */ public function __construct(Horde_Kolab_Storage_Folder $folder, Horde_Log_Logger $logger) { $this->_logger = $logger; parent::__construct($folder); } /** * Saves the folder. * * @param array $attributes An array of folder attributes. You can * set any attribute but there are a few * special ones like 'type', 'default', * 'owner' and 'desc'. * * @return NULL */ public function save($attributes = null) { /** * Trigger the old folder on an empty IMAP folder after renaming a folder! */ try { $this->_connection->create($this->name); $this->_connection->setAnnotation(self::ANNOT_FOLDER_TYPE, $this->_type, $this->name); $this->trigger($this->name); $this->_connection->delete($this->name); } catch (Exception $e) { Horde::logMessage(sprintf('Failed handling the dummy folder: %s!', $e->getMessage()), 'ERR'); } /** Finally trigger the folder after saving.*/ try { $this->trigger(); } catch (Horde_Kolab_Storage_Exception $e) { Horde::logMessage(sprintf('Failed triggering folder %s! Error was: %s', $this->name, $e->getMessage()), 'ERR'); } } /** * Delete the specified message from this folder. * * @param string $id IMAP id of the message to be deleted. * @param boolean $trigger Should the folder be triggered? * * @return NULL */ public function deleteMessage($id, $trigger = true) { $this->_folder->deleteMessage($id, $trigger); if ($trigger) { try { $result = $this->trigger(); } catch (Horde_Kolab_Storage_Exception $e) { Horde::logMessage(sprintf('Failed triggering folder %s! Error was: %s', $this->name, $result->getMessage()), 'ERR'); } } } /** * Move the specified message to the specified folder. * * @param string $id IMAP id of the message to be moved. * @param string $folder Name of the receiving folder. * * @return NULL */ public function moveMessage($id, $folder) { $this->_folder->moveMessage($id, $folder); //@todo: shouldn't we trigger both folders here? $result = $this->trigger(); } /** * Move the specified message to the specified share. * * @param string $id IMAP id of the message to be moved. * @param string $share Name of the receiving share. * * @return NULL */ public function moveMessageToShare($id, $share) { $this->_folder->moveMessageToShare($id, $share); //@todo: shouldn't we trigger both folders here? $result = $this->trigger(); } /** * Save an object in this folder. * * @param array $object The array that holds the data of the object. * @param int $data_version The format handler version. * @param string $object_type The type of the kolab object. * @param string $id The IMAP id of the old object if it * existed before * @param array $old_object The array that holds the current data of the * object. * * @return NULL */ public function saveObject(&$object, $data_version, $object_type, $id = null, &$old_object = null) { $this->_folder->saveObject($object, $data_version, $object_type, $id, $old_object); $this->trigger(); } /** * Set the ACL of this folder. * * @param $user The user for whom the ACL should be set. * @param $acl The new ACL value. * * @return NULL */ public function setAcl($user, $acl) { $this->_folder->setAcl($user, $acl); $this->trigger(); } /** * Delete the ACL for a user on this folder. * * @param $user The user for whom the ACL should be deleted. * * @return NULL */ public function deleteAcl($user) { $this->_folder->deleteAcl($user); $this->trigger(); } /** * Triggers any required updates after changes within the * folder. This is currently only required for handling free/busy * information with Kolab. * * @param string $name Name of the folder that should be triggered. * * @return boolean|PEAR_Error True if successfull. */ private function trigger($name = null) { $type = $this->getType(); if (is_a($type, 'PEAR_Error')) { return $type; } $owner = $this->getOwner(); if (is_a($owner, 'PEAR_Error')) { return $owner; } $subpath = $this->getSubpath($name); if (is_a($subpath, 'PEAR_Error')) { return $subpath; } switch($type) { case 'event': $session = &Horde_Kolab_Session_Singleton::singleton(); $url = sprintf('%s/trigger/%s/%s.pfb', $session->freebusy_server, $owner, $subpath); break; default: return true; } $result = $this->triggerUrl($url); if (is_a($result, 'PEAR_Error')) { return PEAR::raiseError(sprintf(Horde_Kolab_Storage_Translation::t("Failed triggering folder %s. Error was: %s"), $this->name, $result->getMessage())); } return $result; } /** * Triggers a URL. * * @param string $url The URL to be triggered. * * @return boolean|PEAR_Error True if successfull. */ private function triggerUrl($url) { global $conf; if (!empty($conf['kolab']['no_triggering'])) { return true; } $options['method'] = 'GET'; $options['timeout'] = 5; $options['allowRedirects'] = true; if (isset($conf['http']['proxy']) && !empty($conf['http']['proxy']['proxy_host'])) { $options = array_merge($options, $conf['http']['proxy']); } $http = new HTTP_Request($url, $options); $http->setBasicAuth($GLOBALS['registry']->getAuth(), $GLOBALS['registry']->getAuthCredential('password')); @$http->sendRequest(); if ($http->getResponseCode() != 200) { return PEAR::raiseError(sprintf(Horde_Kolab_Storage_Translation::t("Unable to trigger URL %s. Response: %s"), $url, $http->getResponseCode())); } return true; } } Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/API.txt0000664000175000017500000002071512207101545021075 0ustar janjanKolab_Storage structure and API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Introduction ============ Kolab_Storage is a PHP library that provides access to the user data stored in a Kolab Server backend. The data is usually accessed via IMAP which is not cheap. Hence the primary purpose of the library is to reduce the IMAP traffic to a minimal amount. This is achieved by caching the parsed Kolab groupware data after retrieving it from the IMAP account and only updating the cache incrementally whenever possible. Core Elements ============= The library divides the data access into three conceptual elements: - The "List" - The "Folder" - The "Data" 1. Rationale First and foremost this structure intends to provide simple Kolab data access for the developer using the API. In addition this structure does at least to some degree follow structures that one would choose when representing the data available in the Kolab server backend in a relational database. But it also reflects specific constraints imposed by the IMAP protocol. The following sections will - among other things - try to highlight the reasons for the specific boundaries between the different elements. 2. Querying Each of the elements mentioned above is able to handle a defined set of data. While handling this information efficiently is important it is often even more important to allow quick access ("queries") into the data set. How these queries are made quick is left to the implementation but the library strives to clearly separate data management and querying the data to allow optimizing both independantly. Wherever applicable the following sections will also highlight the most common queries. 3. Caching It was initially mentioned that caching is a central aspect of the library. It is however equally important to point out that caching is totally irrelevant to the API itself. The three elements mentioned above always provide the same set of functions to the consumer. Whether the data access is cached in between or not. This design choice allows invisible changes to the actual caching technique up to a complete swapping of different caching approaches. There are other benefits as well when it comes to logging and time series measurements. The following sections will - if applicable - indicate what needs to be done on the IMAP level in order to synchronize the server backend with the cache. This will focus on keeping the IMAP traffic to a minimum. "List" ------ The list handler is concerned with the IMAP folder list visible for a user. It is handles folder names, types, and ownership. While folders typically have many other attributes only this small selection has been chosen to be dealt with by the list handler. The primary reason for this is the fact that folder names and folder types can each be listed using just a single IMAP statement. Additional folder attributes often need to be read using an IMAP statment *per folder*. In addition the other attributes are less frequently used. Folder attributes not represented by the "List" are represented by the "Folder" element. 1. Data The managed data consists only of the folder names and the folder type annotation ('/shared/vendor/kolab/folder-type'). There are several additional information that can be derived from these basic attributes: - Namespace of the folder ('personal', 'other', 'shared') - Owner of the folder (self, other user, or anonymous) - Folder type ('event', 'task', 'note', 'contact', 'journal', ...) - Default setting (e.g. the "default" calendar of a user) These are however a topic for the queries based on the list. For information about namespace/ownership handling you should refer to the "Folder Namespace" section within "Other Elements" below. Core methods of the list handler:: /** * Returns the list of folders visible to the current user. * * @return array The list of folders, represented as strings. */ public function listFolders(); /** * Returns the folder type annotation as associative array. * * @return array The list folder types with the folder names as key and the * folder type as values. */ public function listFolderTypes(); 2. Queries A number of relevant queries can be based on this relatively small dataset: - List all folders with their folder type - List all folders of a specified folder type - Identify the default folder of a specific folder type - Identify the default folder of another user (again given a specific folder type) Core methods of the basic list query:: /** * Returns the folder types as associative array. * * @return array The list folder types with the folder names as key and the * type as values. */ public function listTypes(); /** * List all folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ public function listByType($type); /** * Get the default folder for a certain type. * * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ public function getDefault($type); /** * Get the default folder for a certain type from a different owner. * * @param string $owner The folder owner. * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ public function getForeignDefault($owner, $type); 3. Synchronization In order to synchronize the cache with the server backend two IMAP commands are needed:: A0002 LIST "" "*" A0003 GETANNOTATION "*" ("/vendor/kolab/folder-type") ("value.shared") The second command is not required in case the folder list did not change at all. If only one or very few folders changed in the folder list it might make sense to call "GETANNOTATION" per folder. This could be quicker if the user has access to many folders. 4. Remarks i. The Kolab specific patch to the c-client library that implements the "GETANNOTATION" command is unable to deal with the return value of a 'GETANNOTATION "*"' call. Thus it is forced to deal with the folder type annotation one by one. This introduces significant problems when a user has many folders. At the current state the PHP IMAP extension cannot be recommend for such situations. None of the other supported IMAP drivers have this specific problem. They all support a multi-folder response. ii. Currently the folder STATUS is also checked on a per-folder basis. One might consider doing this for the complete folder list as well. This is however not supported by the Kolab server at the moment. And the number of folders checked for their status should also always be significantly smaller than the complete folder list. "Folder" -------- TBD "Data" ------ TBD Other Elements ============== The Kolab_Storage library also provides a number of supporting elements that are less visible within the API. Some of them should be mentioned though to highlight important features of the library. Driver ------ Currently there are five backend drivers available. Nearly all of them are IMAP based. In theory it would be possible to provide drivers that use alternative means to read and write the groupware data. One could imagine a file based driver that could be used for test purposes. So far the need for such experiments has not arisen though. The currently supported drivers: - "Cclient": based on the PHP IMAP extension (which uses the c-client library) - "Imap": based on the Horde_Imap_Client library (a pure PHP implementation for IMAP access) - "Rcube": based on the roundcube IMAP library (a pure PHP implementation for IMAP access) - "Pear": based on the PEAR-Net_IMAP library (a pure PHP implementation for IMAP access) - "Mock": a mock implementation that handles the data access purely in memory. This is being used for testing purposes. Folder Namespace ---------------- The newer variants of the Kolab_Storage library are capable of using the IMAP namespace information provided by servers with the NAMESPACE capability. Older versions were using hardcoded namespace information and strings such as "INBOX", "user/", "shared." were directly used in the code. While this works fine for the Kolab server it is hardly portable to many other IMAP setups. Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/COPYING0000644000175000017500000005764612207101545020771 0ustar janjan GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/TODO0000664000175000017500000000501012207101545020402 0ustar janjan===================================== Kolab_Storage Development TODO List ===================================== - [LIST/DATA] Fix the triggering decorator - [LIST/DATA] Consider quick triggering (https://bugzilla.kolabsys.com/show_bug.cgi?id=127) - [LIST/DATA] Support servers without annotation support - [LIST] Common folder listing UI: http://wiki.kolab.org/UI-Concepts/Folder-Listing - [LIST] Fix renaming of folder hierarchies with the list cache. - [LIST] Allow to lazy load permissions in Horde_Perms_Permission_Kolab_Storage so that only myRights() gets called if required and getAcl() called when required - [LIST] Decide on private share annotation data. - [DATA] Handle attachments / VFS - [DATA] Change synchronization machinery so that it does not only synchronize one data type but all data types in a folder. While at the same time optimizing single data retrieval. - [DATA] The UID stamp must originate from the data cache, not the exact previous stamp as we cannot be certain the previous sync was complete. - [DATA] Allow queued/step-wise sync - [DATA] Use IMAP Condstore - [DATA] Use IMAP CATENATE - [DATA] Support multiple-formats when writing the objects. - [DATA] Support a descriptive text of the groupware object in the primary MIME part. - [DATA] Verify if deleting a complete folder can fully adhere to the Kolab spec without too much hassle (alternative: The consumer of the API has to use the methods in correct order) - [DATA] Allow to size restrict loading objects and attachments to avoid memory issues - [DATA] Allow indication of broken objects in the frontend (it is irritating if the object is in the backend but is missing from the frontend). Would help if the maximal amount of information gets displayed to the user to get the issue fixed. - [DRIVER] Split the "Driver" part into a separate package. - [DRIVER] Handle TLS/SSL accross all drivers (see also the Storage factory in Core). - allow cli config file overriden by cli params - Error handling (exception catching/throwing) - Multi-Host support - Support remapping the "anonymous" user - Support creating "system" folders in the shared namespace - Check http://evolution-kolab.git.sourceforge.net/git/gitweb.cgi?p=evolution-kolab/evolution-kolab;a=blob;f=src/libekolab/kolab-mail-synchronizer.c;h=3eea832b3bb82b29f5f391f1b71dd0fa8cb8d2c0;hb=4d49c76e1d2f89ee6c6676b0aabeada9ce076eed - Check http://sourceforge.net/apps/mediawiki/evolution-kolab/index.php?title=Conversion_Issues Horde_Kolab_Storage-2.0.5/doc/Horde/Kolab/Storage/usage.txt0000644000175000017500000000000112207101545021550 0ustar janjan Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Cache/Data.php0000664000175000017500000003554012207101545022313 0ustar janjan * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A cache backend for Kolab storage data handlers. * * Copyright 2007-2013 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. * * @category Kolab * @package Kolab_Storage * @author Thomas Jarosch * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Cache_Data { /** Key for the backend ID to object ID mapping. */ const B2O = 'M'; /** Key for the object ID to backend ID mapping. */ const O2B = 'B'; /** Key for the objects. */ const OBJECTS = 'O'; /** Key for recording duplicate objects. */ const DUPLICATES = 'U'; /** Key for recording error objects. */ const ERRORS = 'E'; /** Key for the stamp. */ const STAMP = 'P'; /** Key for the data format version. */ const DATA_VERSION = 'D'; /** Key for the last time the data was synchronized. */ const SYNC = 'S'; /** Key for the cache format version. */ const VERSION = 'V'; /** Key for the data set parameters associated with this cache. */ const ID = 'I'; /** Holds the version number of the cache format. */ const FORMAT_VERSION = '1'; /** Holds query results. */ const QUERIES = 'Q'; /** * The core cache driver. * * @var Horde_Kolab_Storage_Cache */ private $_cache; /** * Data parameters that will be recorded in the cache. * * @var array */ private $_parameters; /** * Data ID. * * @var string */ private $_data_id; /** * The cache data. * * @var array */ private $_data = false; /** * Constructor. * * @param Horde_Kolab_Storage_Cache $cache The core cache driver. * @param array $parameters Data set parameters that * are only recorded and have * no further impact. */ public function __construct(Horde_Kolab_Storage_Cache $cache, $parameters = null) { $this->_cache = $cache; $this->_parameters = $parameters; } /** * The ID for the data cache. * * @param string $data_id The unique ID for the data used when caching it. * * @return NULL */ public function setDataId($data_id) { $this->_data_id = $data_id; } /** * Return the ID for the data cache. * * @return string The unique ID for the data used when caching it. */ public function getDataId() { if ($this->_data_id === null) { throw new Horde_Kolab_Storage_Exception( 'You must set the ID of the data cache!' ); } return $this->_data_id; } /** * Retrieve the cached list data. * * @return mixed The data of the object. */ private function _load() { if ($this->_data === false) { $this->_data = unserialize($this->_cache->loadData($this->getDataId())); if (!is_array($this->_data) || !isset($this->_data[self::SYNC]) || !isset($this->_data[self::VERSION]) || $this->_data[self::VERSION] != self::FORMAT_VERSION) { $this->_data = array(); } } } /** * Cache the data. * * @return NULL */ public function save() { $this->_cache->storeData($this->getDataId(), serialize($this->_data)); } /** * Check if the cache has been initialized. * * @return boolean True if cache data is available. */ public function isInitialized() { $this->_load(); return !empty($this->_data); } /** * Retrieve the object list from the cache. * * @return array The list of objects. */ public function getObjects() { return $this->_fetchCacheEntry(self::OBJECTS); } /** * Retrieve the specified object from the cache. * * @param string $obid The object ID to fetch. * * @return array The list of objects. */ public function getObjectByBackendId($obid) { $obids = $this->getBackendToObject(); if (isset($obids[$obid])) { $objects = $this->getObjects(); return $objects[$obids[$obid]]; } else { throw new Horde_Kolab_Storage_Exception( sprintf ('No such object %s!', $obid) ); } } /** * Return the object ID to backend ID mapping. * * @return array The mapping. */ public function getObjectToBackend() { return $this->_fetchCacheEntry(self::O2B); } /** * Return the backend ID to object ID mapping. * * @return array The mapping. */ public function getBackendToObject() { return $this->_fetchCacheEntry(self::B2O); } /** * Retrieve the last stamp. * * @return Horde_Kolab_Storage_Folder_Stamp The last recorded stamp. */ public function getStamp() { $this->_checkInit(self::STAMP); return $this->_data[self::STAMP]; } /** * Retrieve the data version. * * @return string The version of the stored data. */ public function getVersion() { $this->_checkInit(self::DATA_VERSION); return $this->_data[self::DATA_VERSION]; } /** * Retrieve the list of object duplicates. * * @return array The list of duplicates. */ public function getDuplicates() { return $this->_fetchCacheEntry(self::DUPLICATES); } /** * Retrieve the list of object errors. * * @return array The list of errors. */ public function getErrors() { return $this->_fetchCacheEntry(self::ERRORS); } /** * Retrieve an attachment. * * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * * @return resource A stream opened to the attachement data. */ public function getAttachment($obid, $attachment_id) { return $this->_cache->loadAttachment( $this->getDataId(), $obid, $attachment_id ); } /** * Retrieve an attachment by name. * * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * * @return array An array of attachment resources. */ public function getAttachmentByName($obid, $name) { $object = $this->getObjectByBackendId($obid); if (!isset($object['_attachments']['name'][$name])) { throw new Horde_Kolab_Storage_Exception( sprintf( 'No attachment named "%s" for object id %s!', $name, $obid ) ); } $result = array(); foreach ($object['_attachments']['name'][$name] as $attachment_id) { $result[$attachment_id] = $this->_cache->loadAttachment( $this->getDataId(), $obid, $attachment_id ); } return $result; } /** * Retrieve an attachment by name. * * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * * @return array An array of attachment resources. */ public function getAttachmentByType($obid, $type) { $object = $this->getObjectByBackendId($obid); if (!isset($object['_attachments']['type'][$type])) { throw new Horde_Kolab_Storage_Exception( sprintf( 'No attachment with type "%s" for object id %s!', $type, $obid ) ); } $result = array(); foreach ($object['_attachments']['type'][$type] as $attachment_id) { $result[$attachment_id] = $this->_cache->loadAttachment( $this->getDataId(), $obid, $attachment_id ); } return $result; } /** * Return the timestamp of the last synchronization. * * @return int Timestamp of the last sync. */ public function getLastSync() { $this->_load(); return isset($this->_data[self::SYNC]) ? $this->_data[self::SYNC] : false; } /** * Is the specified query data available in the cache? * * @param string $key The query key. * * @return boolean True in case cached data is available. */ public function hasQuery($key) { $this->_load(); return isset($this->_data[self::QUERIES][$key]); } /** * Return query information. * * @param string $key The query key. * * @return mixed The query data. */ public function getQuery($key) { if ($this->hasQuery($key)) { return $this->_data[self::QUERIES][$key]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Missing query cache data (Key: %s). Synchronize first!', $key) ); } } /** * Set query information. * * @param string $key The query key. * @param mixed $data The query data. * * @return NULL */ public function setQuery($key, $data) { $this->_load(); $this->_data[self::QUERIES][$key] = $data; } /** * Fetch the specified cache entry in case it is present. Returns an empty * array otherwise. * * @param string $key The key in the cached data array. * * @return array The cache entry. */ private function _fetchCacheEntry($key) { $this->_checkInit($key); if (isset($this->_data[$key])) { return $this->_data[$key]; } else { return array(); } } /** * Verify that the data cache is initialized. * * @param string $key The key in the cached data array. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case the cache has not been * initialized. */ private function _checkInit($key) { if (!$this->isInitialized()) { throw new Horde_Kolab_Storage_Exception( sprintf('Missing cache data (Key: %s). Synchronize first!', $key) ); } } /** * Map backend IDs to object ids. * * @param array $backend_ids The list of backend IDs * * @return array A list that associates object IDs (values) to backend IDs * (keys). */ public function backendMap($backend_ids) { if (empty($backend_ids)) { return array(); } $map = array(); foreach ($backend_ids as $item) { $map[$item] = $this->_data[self::B2O][$item]; } return $map; } /** * Store the objects list in the cache. * * @param array $object The object data to store. * @param Horde_Kolab_Storage_Folder_Stamp $stamp The current stamp. * @param string $version The format version of * the provided data. * @param array $delete Backend IDs that were removed. * * @return NULL */ public function store(array $objects, Horde_Kolab_Storage_Folder_Stamp $stamp, $version, array $delete = array()) { $this->_load(); if (!empty($delete)) { foreach ($delete as $obid => $object_id) { $object = $this->_data[self::OBJECTS][$object_id]; if (isset($object['_attachments'])) { foreach ($object['_attachments']['id'] as $id) { $this->_cache->deleteAttachment( $this->getDataId(), $obid, $id ); } } unset($this->_data[self::O2B][$object_id]); unset($this->_data[self::OBJECTS][$object_id]); unset($this->_data[self::B2O][$obid]); } } foreach ($objects as $obid => $object) { if (!empty($object) && isset($object['uid'])) { if (isset($this->_data[self::O2B][$object['uid']])) { if (!isset($this->_data[self::DUPLICATES][$object['uid']])) { $this->_data[self::DUPLICATES][$object['uid']][] = $this->_data[self::O2B][$object['uid']]; } $this->_data[self::DUPLICATES][$object['uid']][] = $obid; } $this->_data[self::B2O][$obid] = $object['uid']; $this->_data[self::O2B][$object['uid']] = $obid; if (isset($object['_attachments'])) { $attachments = array(); foreach ($object['_attachments'] as $id => $attachment) { $attachments['id'][] = $id; if (isset($attachment['name'])) { $attachments['name'][$attachment['name']][] = $id; } if (isset($attachment['type'])) { $attachments['type'][$attachment['type']][] = $id; } $this->_cache->storeAttachment($this->getDataId(), $obid, $id, $attachment['content']); } $object['_attachments'] = $attachments; } $this->_data[self::OBJECTS][$object['uid']] = $object; } else { $this->_data[self::B2O][$obid] = false; $this->_data[self::ERRORS][] = $obid; } } $this->_data[self::QUERIES] = array(); $this->_data[self::STAMP] = serialize($stamp); $this->_data[self::DATA_VERSION] = $version; $this->_data[self::VERSION] = self::FORMAT_VERSION; $this->_data[self::ID] = serialize($this->_parameters); $this->_data[self::SYNC] = time(); } /** * Initialize the cache structure. * * @return NULL */ public function reset() { $this->_data = array(); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Decorator/Log.php0000664000175000017500000003433112207101545023750 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A log decorator for the data handlers. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Decorator_Log implements Horde_Kolab_Storage_Data, Horde_Kolab_Storage_Data_Query { /** * Decorated data handler. * * @var Horde_Kolab_Storage_Data */ private $_data; /** * A log handler. * * @var mixed */ private $_logger; /** * Constructor. * * @param Horde_Kolab_Storage_Data $data The original data handler. * @param mixed $logger The log handler. This instance * must provide the debug() and * debug() methods. */ public function __construct(Horde_Kolab_Storage_Data $data, $logger) { $this->_data = $data; $this->_logger = $logger; } /** * Return the folder path for this data handler. * * @return string The folder path. */ public function getPath() { return $this->_data->getPath(); } /** * Return the ID of the current user. * * @return string The current user. */ public function getAuth() { return $this->_data->getAuth(); } /** * Return the ID of this data handler. * * @return string The ID. */ public function getId() { return $this->_data->getId(); } /** * Return the ID parameters for this data handler. * * @return array The ID parameters. */ public function getIdParameters() { return $this->_data->getIdParameters(); } /** * Return the data type represented by this object. * * @return string The type of data this instance handles. */ public function getType() { return $this->_data->getType(); } /** * Return the data version. * * @return string The data version. */ public function getVersion() { return $this->_data->getVersion(); } /** * Report the status of this folder. * * @return Horde_Kolab_Storage_Folder_Stamp The stamp that can be used for * detecting folder changes. */ public function getStamp() { return $this->_data->getStamp(); } /** * Create a new object. * * @param array &$object The array that holds the object data. * @param boolean $raw True if the data to be stored has been provided in * raw format. * * @return string The ID of the new object or true in case the backend does * not support this return value. * * @throws Horde_Kolab_Storage_Exception In case an error occured while * saving the data. */ public function create(&$object, $raw = false) { $this->_logger->debug( sprintf('Creating new data object in %s.', $this->_data->getPath()) ); $result = $this->_data->create($object, $raw); $this->_logger->debug( sprintf( 'Created data object %s in %s [backend: %s].', $object['uid'], $this->_data->getPath(), $result ) ); return $result; } /** * Modify an existing object. * * @param array $object The array that holds the updated object data. * @param boolean $raw True if the data to be stored has been provided in * raw format. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case an error occured while * saving the data. */ public function modify($object, $raw = false) { $this->_logger->debug( sprintf( 'Modifying data object %s in %s.', $object['uid'], $this->_data->getPath() ) ); $this->_data->modify($object, $raw); $this->_logger->debug( sprintf( 'Modified data object %s in %s.', $object['uid'], $this->_data->getPath() ) ); } /** * Retrieves the objects for the given UIDs. * * @param array $uids The message UIDs. * * @return array An array of objects. */ public function fetch($uids) { $this->_logger->debug( sprintf( 'Fetching data objects %s in %s.', join(',', $uids), $this->_data->getPath() ) ); return $this->_data->fetch($uids); } /** * Retrieves the complete message for the given UID. * * @param string $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($uid) { $this->_logger->debug( sprintf( 'Fetching complete message id %s in %s.', $uid, $this->_data->getPath() ) ); return $this->_data->fetchComplete($uid); } /** * Return the backend ID for the given object ID. * * @param string $object_uid The object ID. * * @return string The backend ID for the object. */ public function getBackendId($object_id) { $result = $this->_data->getBackendId($object_id); $this->_logger->debug( sprintf( 'Backend id for object %s is %s in %s.', $object_id, $result, $this->_data->getPath() ) ); return $result; } /** * Check if the given object ID exists. * * @param string $object_id The object ID. * * @return boolean True if the ID was found, false otherwise. */ public function objectIdExists($object_id) { return $this->_data->objectIdExists($object_id); } /** * Return the specified object. * * @param string $object_id The object id. * * @return array The object data as an array. */ public function getObject($object_id) { return $this->_data->getObject($object_id); } /** * Return the specified attachment. * * @param string $attachment_id The attachment id. * * @return resource An open stream to the attachment data. */ public function getAttachment($attachment_id) { return $this->_data->getAttachment($attachment_id); } /** * Retrieve all object ids in the current folder. * * @return array The object ids. */ public function getObjectIds() { $result = $this->_data->getObjectIds(); if (count($result < 20)) { $ids = '[' . join(', ', $result) . ']'; } else { $ids = '[too many to list]'; } $this->_logger->debug( sprintf( '%s has %s objects %s.', $this->_data->getPath(), count($result), $ids ) ); return $result; } /** * Retrieve all objects in the current folder. * * @return array An array of all objects. */ public function getObjects() { $result = $this->_data->getObjects(); if (count($result < 20)) { $ids = '[' . join(', ', array_keys($result)) . ']'; } else { $ids = '[too many to list]'; } $this->_logger->debug( sprintf( '%s has %s objects %s.', $this->_data->getPath(), count($result), $ids ) ); return $result; } /** * Retrieve all objects in the current folder by backend id. * * @return array An array of all objects. */ public function getObjectsByBackendId() { $result = $this->_data->getObjectsByBackendId(); if (count($result < 20)) { $ids = '[backend ids: ' . join(', ', array_keys($result)) . ']'; } else { $ids = '[too many to list]'; } $this->_logger->debug( sprintf( '%s has %s objects %s.', $this->_data->getPath(), count($result), $ids ) ); return $result; } /** * Retrieve an object in the current folder by backend id. * * @param string $uid Backend id of the object to be returned. * * @return array An array of all objects. */ public function getObjectByBackendId($uid) { return $this->_data->getObjectByBackendId($uid); } /** * Return the mapping of object IDs to backend IDs. * * @return array The object to backend mapping. */ public function getObjectToBackend() { return $this->_data->getObjectToBackend(); } /** * Retrieve the list of object duplicates. * * @return array The list of duplicates. */ public function getDuplicates() { return $this->_data->getDuplicates(); } /** * Retrieve the list of object errors. * * @return array The list of errors. */ public function getErrors() { return $this->_data->getErrors(); } /** * Move the specified message from the current folder into a new * folder. * * @param string $object_id ID of the message to be moved. * @param string $new_folder Target folder. * * @return NULL */ public function move($object_id, $new_folder) { $this->_logger->debug( sprintf( 'Moving data object %s in %s to %s.', $object_id, $this->_data->getPath(), $new_folder ) ); $this->_data->move($object_id, $new_folder); $this->_logger->debug( sprintf( 'Moved data object %s in %s to %s.', $object_id, $this->_data->getPath(), $new_folder ) ); } /** * Delete the specified objects from this data set. * * @param array|string $object_ids Id(s) of the object to be deleted. * * @return NULL */ public function delete($object_ids) { if (is_array($object_ids)) { $ids = join(', ', $object_ids); } else { $ids = $object_ids; } $this->_logger->debug( sprintf( 'Deleting data object(s) %s in %s.', $ids, $this->_data->getPath() ) ); $this->_data->delete($object_ids); $this->_logger->debug( sprintf( 'Deleted data object(s) %s in %s.', $ids, $this->_data->getPath() ) ); } /** * Delete all objects from this data set. * * @return NULL */ public function deleteAll() { $this->_logger->debug( sprintf( 'Deleting all data objects in %s.', $this->_data->getPath() ) ); $this->_data->deleteAll(); $this->_logger->debug( sprintf( 'Deleted all data objects in %s.', $this->_data->getPath() ) ); } /** * Delete the specified messages from this folder. * * @param array|string $uids Backend id(s) of the message to be deleted. * * @return NULL */ public function deleteBackendIds($uids) { if (is_array($uids)) { $ids = join(', ', $uids); } else { $ids = $uids; } $this->_logger->debug( sprintf( 'Deleting backend data object(s) %s in %s.', $ids, $this->_data->getPath() ) ); $this->_data->deleteBackendIds($uids); $this->_logger->debug( sprintf( 'Deleted backend data object(s) %s in %s.', $ids, $this->_data->getPath() ) ); } /** * Synchronize the list information with the information from the backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { $this->_data->synchronize(); $this->_logger->debug( sprintf( 'Synchronized data cache for %s.', $this->_data->getPath() ) ); } /** * Register a query to be updated if the underlying data changes. * * @param string $name The query name. * @param Horde_Kolab_Storage_Query $query The query to register. * * @return NULL */ public function registerQuery($name, Horde_Kolab_Storage_Query $query) { $this->_data->registerQuery($name, $query); } /** * Return a registered query. * * @param string $name The query name. * * @return Horde_Kolab_Storage_Query The requested query. * * @throws Horde_Kolab_Storage_Exception In case the requested query does * not exist. */ public function getQuery($name = null) { return $this->_data->getQuery($name); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query/History/Base.php0000664000175000017500000000730712207101545024730 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The hook that updates the Horde history information once data gets * synchronized with the Kolab backend. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Query_History_Base implements Horde_Kolab_Storage_Data_Query_History { /** * The queriable data. * * @var Horde_Kolab_Storage_Data */ protected $data; /** * The history handler. * * @var Horde_History */ protected $history; /** * Constructor. * * @param Horde_Kolab_Storage_Data $data The queriable data. * @param array $params Additional parameters. */ public function __construct(Horde_Kolab_Storage_Data $data, $params) { $this->data = $data; $this->history = $params['factory']->createHistory($data->getAuth()); } /** * Synchronize the preferences information with the information from the * backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { $stamp = $this->data->getStamp(); if (isset($params['changes'])) { foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED] as $bid => $object) { $this->_updateLog($object['uid'], $bid, $stamp); } foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] as $bid => $object) { $this->history->log( $object, array('action' => 'delete', 'bid' => $bid, 'stamp' => $stamp) ); } } else { foreach ($this->data->getObjectToBackend() as $object => $bid) { $this->_updateLog($object, $bid, $stamp); } } } /** * Update the history log for an object. * * @param string $object The object ID. * @param string $bid The backend ID of * the object. * @param Horde_Kolab_Storage_Folder_Stamp $stamp The folder stamp. * * @return NULL */ private function _updateLog($object, $bid, $stamp) { $log = $this->history->getHistory($object); if (count($log) == 0) { $this->history->log( $object, array('action' => 'add', 'bid' => $bid, 'stamp' => $stamp) ); } else { $last = array('ts' => 0); foreach ($log as $entry) { if ($entry['ts'] > $last['ts']) { $last = $entry; } } if (!isset($last['bid']) || $last['bid'] != $bid || (isset($last['stamp']) && $last['stamp']->isReset($stamp))) { $this->history->log( $object, array('action' => 'modify', 'bid' => $bid, 'stamp' => $stamp) ); } } } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query/History/Cache.php0000664000175000017500000000360012207101545025051 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The cache based hook that updates the Horde history information once data * gets synchronized with the Kolab backend. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Query_History_Cache extends Horde_Kolab_Storage_Data_Query_History_Base { /** * Synchronize the preferences information with the information from the * backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { if (isset($params['last_sync']) && ($params['last_sync'] === false || $params['last_sync'] !== $this->history->getActionTimestamp(__CLASS__ , 'sync'))) { /** * Ignore current changeset and do a full synchronization as we are * out of sync */ unset($params['changes']); } parent::synchronize($params); if (isset($params['current_sync'])) { $this->history->log( __CLASS__ , array('action' => 'sync', 'ts' => $params['current_sync']) ); } } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query/Preferences/Base.php0000664000175000017500000000564612207101545025534 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Basic query for preferences data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Query_Preferences_Base implements Horde_Kolab_Storage_Data_Query_Preferences { /** * The queriable data. * * @var Horde_Kolab_Storage_Data */ private $_data; /** * The cached preference mapping. * * @var array */ private $_mapping; /** * Constructor. * * @param Horde_Kolab_Storage_Data $data The queriable data. * @param array $params Additional parameters. */ public function __construct(Horde_Kolab_Storage_Data $data, $params) { $this->_data = $data; } /** * Return the preferences for the specified application. * * @param string $application The application. * * @return array The preferences. */ public function getApplicationPreferences($application) { $this->_initMapping(); if (isset($this->_mapping[$application])) { return $this->_data->getObject($this->_mapping[$application]); } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'No preferences for application %s available', $application ) ); } } /** * Return the applications for which preferences exist in the backend. * * @param string $application The application. * * @return array The applications. */ public function getApplications() { $this->_initMapping(); return array_keys($this->_mapping); } /** * Initialize the application <-> object mapping. * * @return NULL */ private function _initMapping() { if ($this->_mapping === null) { foreach ($this->_data->getObjects() as $id => $data) { $this->_mapping[$data['application']] = $id; } } } /** * Synchronize the preferences information with the information from the * backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query/Preferences/Cache.php0000664000175000017500000000663712207101545025666 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Cached access to the preferences data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Query_Preferences_Cache implements Horde_Kolab_Storage_Data_Query_Preferences { /** The preferences query data */ const PREFS = 'PREFS'; /** * The data cache. * * @var Horde_Kolab_Storage_Cache_Data */ private $_data_cache; /** * The queriable data. * * @var Horde_Kolab_Storage_Data */ private $_data; /** * The cached preference mapping. * * @var array */ private $_mapping; /** * Constructor. * * @param Horde_Kolab_Storage_Data $data The queriable data. * @param array $params Additional parameters. */ public function __construct(Horde_Kolab_Storage_Data $data, $params) { $this->_data = $data; $this->_data_cache = $params['cache']; } /** * Ensure we have the query data. * * @return NULL */ private function _init() { if ($this->_mapping !== null) { return; } if ($this->_data_cache->hasQuery(self::PREFS)) { $this->_mapping = $this->_data_cache->getQuery(self::PREFS); } else { $this->synchronize(); } } /** * Return the preferences for the specified application. * * @param string $application The application. * * @return array The preferences. */ public function getApplicationPreferences($application) { $this->_init(); if (isset($this->_mapping[$application])) { return $this->_data->getObject($this->_mapping[$application]); } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'No preferences for application %s available', $application ) ); } } /** * Return the applications for which preferences exist in the backend. * * @param string $application The application. * * @return array The applications. */ public function getApplications() { $this->_init(); return array_keys($this->_mapping); } /** * Synchronize the preferences information with the information from the * backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { $this->_mapping = array(); foreach ($this->_data->getObjects() as $id => $data) { $this->_mapping[$data['application']] = $id; } $this->_data_cache->setQuery(self::PREFS, $this->_mapping); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query/History.php0000664000175000017500000000160612207101545024052 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Defines the data synchronization hook for history data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Data_Query_History extends Horde_Kolab_Storage_Data_Query { } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query/Preferences.php0000664000175000017500000000252012207101545024646 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Defines the data query for preferences data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Data_Query_Preferences extends Horde_Kolab_Storage_Data_Query { /** * Return the preferences for the specified application. * * @param string $application The application. * * @return array The preferences. */ public function getApplicationPreferences($application); /** * Return the applications for which preferences exist in the backend. * * @param string $application The application. * * @return array The applications. */ public function getApplications(); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Base.php0000664000175000017500000004666212207101545022171 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The basic handler for data objects in a Kolab storage folder. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Base implements Horde_Kolab_Storage_Data, Horde_Kolab_Storage_Data_Query { /** * The link to the parent folder object. * * @var Horde_Kolab_Storage_Folder */ private $_folder; /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * The factory for generating additional resources. * * @var Horde_Kolab_Storage_Factory */ private $_factory; /** * The folder type. * * @var string */ private $_type; /** * The version of the data. * * @var int */ private $_version; /** * The list of registered queries. * * @var array */ private $_queries = array(); /** * Constructor. * * @param Horde_Kolab_Storage_Folder $folder The folder to retrieve the * data from. * @param Horde_Kolab_Storage_Driver $driver The primary connection driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param string $type The type of data we want to * access in the folder. * @param int $version Format version of the object * data. */ public function __construct(Horde_Kolab_Storage_Folder $folder, Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Factory $factory, $type = null, $version = 1) { $this->_folder = $folder; $this->_driver = $driver; $this->_factory = $factory; $this->_type = $type; $this->_version = $version; } /** * Return the folder path for this data handler. * * @return string The folder path. */ public function getPath() { return $this->_folder->getPath(); } /** * Return the ID of the current user. * * @return string The current user. */ public function getAuth() { return $this->_driver->getAuth(); } /** * Return the ID of this data handler. * * @return string The ID. */ public function getId() { $id = $this->_driver->getParameters(); unset($id['user']); $id['owner'] = $this->_folder->getOwner(); $id['prefix'] = $this->_folder->getPrefix(); $id['folder'] = $this->_folder->getSubpath(); $id['type'] = $this->getType(); ksort($id); return md5(serialize($id)); } /** * Return the ID parameters for this data handler. * * @return array The ID parameters. */ public function getIdParameters() { $id = $this->_driver->getParameters(); unset($id['user']); $id['owner'] = $this->_folder->getOwner(); $id['prefix'] = $this->_folder->getPrefix(); $id['folder'] = $this->_folder->getSubpath(); $id['type'] = $this->getType(); return $id; } /** * Return the data type represented by this object. * * @return string The type of data this instance handles. */ public function getType() { if ($this->_type === null) { $this->_type = $this->_folder->getType(); } return $this->_type; } /** * Return the data version. * * @return string The data version. */ public function getVersion() { return $this->_version; } /** * Report the status of this folder. * * @return Horde_Kolab_Storage_Folder_Stamp The stamp that can be used for * detecting folder changes. */ public function getStamp() { return $this->_driver->getStamp($this->_folder->getPath()); } /** * Create a new object. * * @param array &$object The array that holds the object data. * @param boolean $raw True if the data to be stored has been provided in * raw format. * * @return string The ID of the new object or true in case the backend does * not support this return value. * * @throws Horde_Kolab_Storage_Exception In case an error occured while * saving the data. */ public function create(&$object, $raw = false) { if ($raw === false) { $writer = new Horde_Kolab_Storage_Object_Writer_Format( new Horde_Kolab_Format_Factory(), array('version' => $this->_version) ); } else { $writer = new Horde_Kolab_Storage_Object_Writer_Raw(); } $storage_object = new Horde_Kolab_Storage_Object(); $storage_object->setDriver($this->_driver); $storage_object->setData($object); $result = $storage_object->create($this->_folder, $writer, $this->getType()); if ($result === true) { $params = array(); } else { $params = array( 'changes' => array( Horde_Kolab_Storage_Folder_Stamp::ADDED => array( $result => $storage_object ), Horde_Kolab_Storage_Folder_Stamp::DELETED => array() ) ); } $this->synchronize($params); return $result; } /** * Modify an existing object. * * @param array $object The array that holds the updated object data. * @param boolean $raw True if the data to be stored has been provided in * raw format. * * @return string The new backend ID of the modified object or true in case * the backend does not support this return value. * * @throws Horde_Kolab_Storage_Exception In case an error occured while * saving the data. */ public function modify($object, $raw = false) { if (!isset($object['uid'])) { throw new Horde_Kolab_Storage_Exception( 'The provided object data contains no ID value!' ); } try { $obid = $this->getBackendId($object['uid']); } catch (Horde_Kolab_Storage_Exception $e) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( 'The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %s' ), $object['uid'], $e->getMessage() ) ); } if ($raw === false) { $writer = new Horde_Kolab_Storage_Object_Writer_Format( new Horde_Kolab_Format_Factory(), array('version' => $this->_version) ); } else { $writer = new Horde_Kolab_Storage_Object_Writer_Raw(); } if (!$object instanceOf Horde_Kolab_Storage_Object) { $object_array = $object; $object = $this->getObject($object_array['uid']); $object->setData($object_array); } $object->setDriver($this->_driver); $result = $object->save($writer); if ($result === true) { $params = array(); } else { $params = array( 'changes' => array( Horde_Kolab_Storage_Folder_Stamp::ADDED => array( $result => $object ), Horde_Kolab_Storage_Folder_Stamp::DELETED => array( $obid => $object['uid']) ) ); } $this->synchronize($params); return $result; } /** * Retrieves the complete message for the given UID. * * @param string $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($uid) { return $this->_driver->fetchComplete($this->_folder->getPath(), $uid); } /** * Retrieves the body part for the given UID and mime part ID. * * @param string $uid The message UID. * @param string $id The mime part ID. * * @return resource The message part as stream resource. */ public function fetchPart($uid, $id) { return $this->_driver->fetchBodypart( $this->_folder->getPath(), $uid, $id ); } /** * Retrieves the objects for the given UIDs. * * @param array $uids The message UIDs. * @param boolean $raw True if the raw format should be returned rather than * the parsed data. * * @return array An array of objects. */ public function fetch($uids, $raw = false) { if (empty($uids)) { return array(); } if ($raw === false) { $writer = new Horde_Kolab_Storage_Object_Writer_Format( new Horde_Kolab_Format_Factory(), array('version' => $this->_version) ); } else { $writer = new Horde_Kolab_Storage_Object_Writer_Raw(); } $objects = array(); $structures = $this->_driver->fetchStructure($this->_folder->getPath(), $uids); foreach ($structures as $uid => $structure) { if (!isset($structure['structure'])) { throw new Horde_Kolab_Storage_Exception( 'Backend returned a structure without the expected "structure" element.' ); } $object = new Horde_Kolab_Storage_Object(); $object->setDriver($this->_driver); $object->load($uid, $this->_folder, $writer, $structure['structure']); $objects[$uid] = $object; } return $objects; } /** * Return the backend ID for the given object ID. * * @param string $object_uid The object ID. * * @return string The backend ID for the object. */ public function getBackendId($object_id) { $by_obid = $this->fetch($this->getStamp()->ids()); foreach ($by_obid as $obid => $object) { if ($object['uid'] == $object_id) { return $obid; } } throw new Horde_Kolab_Storage_Exception( sprintf('Object ID %s does not exist!', $object_id) ); } /** * Check if the given object ID exists. * * @param string $object_id The object ID. * * @return boolean True if the ID was found, false otherwise. */ public function objectIdExists($object_id) { return array_key_exists( $object_id, $this->getObjects() ); } /** * Return the specified object. * * @param string $object_id The object id. * * @return array The object data as an array. */ public function getObject($object_id) { $objects = $this->getObjects(); if (isset($objects[$object_id])) { return $objects[$object_id]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Object ID %s does not exist!', $object_id) ); } } /** * Return the specified attachment. * * @param string $attachment_id The attachment id. * * @return resource An open stream to the attachment data. */ public function getAttachment($attachment_id) { //@todo: implement } /** * Retrieve all object ids in the current folder. * * @return array The object ids. */ public function getObjectIds() { return array_keys($this->getObjects()); } /** * Retrieve all objects in the current folder. * * @return array An array of all objects. */ public function getObjects() { $by_oid = array(); $by_obid = $this->fetch($this->getStamp()->ids()); foreach ($by_obid as $obid => $object) { $by_oid[$object['uid']] = $object; } return $by_oid; } /** * Retrieve all objects in the current folder by backend id. * * @return array An array of all objects. */ public function getObjectsByBackendId() { return $this->fetch($this->getStamp()->ids()); } /** * Retrieve an object in the current folder by backend id. * * @param string $uid Backend id of the object to be returned. * * @return array An array of all objects. */ public function getObjectByBackendId($uid) { $fetched = $this->fetch(array($uid)); return array_pop($fetched); } /** * Return the mapping of object IDs to backend IDs. * * @return array The object to backend mapping. */ public function getObjectToBackend() { $bid = array(); $by_obid = $this->fetch($this->getStamp()->ids()); foreach ($by_obid as $obid => $object) { $bid[$object['uid']] = $obid; } return $bid; } /** * Retrieve the list of object duplicates. * * @return array The list of duplicates. */ public function getDuplicates() { $existing = array(); $duplicates = array(); $by_obid = $this->fetch($this->getStamp()->ids()); foreach ($by_obid as $obid => $object) { if (isset($existing[$object['uid']])) { if (!isset($duplicates[$object['uid']])) { $duplicates[$object['uid']][] = $existing[$object['uid']]; } $duplicates[$object['uid']][] = $obid; } else { $existing[$object['uid']] = $obid; } } return $duplicates; } /** * Retrieve the list of object errors. * * @return array The list of errors. */ public function getErrors() { $errors = array(); $by_obid = $this->fetch($this->getStamp()->ids()); foreach ($by_obid as $obid => $object) { if ($object->hasParseErrors()) { $errors[$obid] = $object; } } return $errors; } /** * Move the specified message from the current folder into a new * folder. * * @param string $object_id ID of the message to be moved. * @param string $new_folder Target folder. * * @return NULL */ public function move($object_id, $new_folder) { if ($this->objectIdExists($object_id)) { $uid = $this->getBackendId($object_id); } else { throw new Horde_Kolab_Storage_Exception( sprintf('No such object %s!', $object_id) ); } $this->_driver->moveMessage( $uid, $this->_folder->getPath(), $new_folder ); $this->synchronize( array( 'changes' => array( Horde_Kolab_Storage_Folder_Stamp::ADDED => array(), Horde_Kolab_Storage_Folder_Stamp::DELETED => array($uid => $object_id) ) ) ); } /** * Delete the specified objects from this data set. * * @param array|string $object_ids Id(s) of the object to be deleted. * * @return NULL */ public function delete($object_ids) { if (!is_array($object_ids)) { $object_ids = array($object_ids); } $uids = array(); foreach ($object_ids as $id) { if ($this->objectIdExists($id)) { $uids[$this->getBackendId($id)] = $id; } else { throw new Horde_Kolab_Storage_Exception( sprintf('No such object %s!', $id) ); } } $this->deleteBackendIds(array_keys($uids)); $this->synchronize( array( 'changes' => array( Horde_Kolab_Storage_Folder_Stamp::ADDED => array(), Horde_Kolab_Storage_Folder_Stamp::DELETED => $uids ) ) ); } /** * Delete all objects from this data set. * * @return NULL */ public function deleteAll() { $this->delete($this->getObjectIds()); } /** * Delete the specified messages from this folder. * * @param array|string $uids Backend id(s) of the message to be deleted. * * @return NULL */ public function deleteBackendIds($uids) { if (!is_array($uids)) { $uids = array($uids); } $this->_driver->deleteMessages($this->_folder->getPath(), $uids); $this->_driver->expunge($this->_folder->getPath()); } /** * Register a query to be updated if the underlying data changes. * * @param string $name The query name. * @param Horde_Kolab_Storage_Query $query The query to register. * * @return NULL */ public function registerQuery($name, Horde_Kolab_Storage_Query $query) { if (!$query instanceOf Horde_Kolab_Storage_Data_Query) { throw new Horde_Kolab_Storage_Exception( 'The provided query is no data query.' ); } $this->_queries[$name] = $query; } /** * Synchronize the data information with the information from the backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { foreach ($this->_queries as $name => $query) { $query->synchronize($params); } } /** * Return a registered query. * * @param string $name The query name. * * @return Horde_Kolab_Storage_Query The requested query. * * @throws Horde_Kolab_Storage_Exception In case the requested query does * not exist. */ public function getQuery($name = null) { if (isset($this->_queries[$name])) { return $this->_queries[$name]; } else { throw new Horde_Kolab_Storage_Exception('No such query!'); } } /** * Generate a unique object ID. * * @return string The unique ID. */ public function generateUid() { return strval(new Horde_Support_Uuid()); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Cached.php0000664000175000017500000002040712207101545022453 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The cache decorator for Kolab storage data handlers. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Cached extends Horde_Kolab_Storage_Data_Base { /** * The data cache. * * @var Horde_Kolab_Storage_Cache_Data */ private $_data_cache; /** * Has the cache already been loaded and validated? * * @var boolean */ private $_init = false; /** * Constructor. * * @param Horde_Kolab_Storage_Folder $folder The folder to retrieve the * data from. * @param Horde_Kolab_Storage_Driver $driver The primary connection driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param Horde_Kolab_Storage_Cache $cache The cache storing data for * this decorator. * @param string $type The type of data we want to * access in the folder. * @param int $version Format version of the object * data. */ public function __construct(Horde_Kolab_Storage_Folder $folder, Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Factory $factory, Horde_Kolab_Storage_Cache $cache, $type = null, $version = 1) { parent::__construct($folder, $driver, $factory, $type, $version); $this->_data_cache = $cache->getDataCache($this->getIdParameters()); } /** * Check if the cache has been initialized. * * @return NULL */ private function _isInitialized() { return ($this->_init || $this->_data_cache->isInitialized()); } /** * Check if the cache has been initialized at all and synchronize it if not. * * @return NULL */ private function _init() { if (!$this->_isInitialized()) { $this->synchronize(); } } /** * Return the backend ID for the given object ID. * * @param string $object_uid The object ID. * * @return string The backend ID for the object. */ public function getBackendId($object_id) { $this->_init(); $mapping = $this->_data_cache->getObjectToBackend(); if (isset($mapping[$object_id])) { return $mapping[$object_id]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Object ID %s does not exist!', $object_id) ); } } /** * Check if the given object ID exists. * * @param string $object_id The object ID. * * @return boolean True if the ID was found, false otherwise. */ public function objectIdExists($object_id) { $this->_init(); return array_key_exists( $object_id, $this->_data_cache->getObjects() ); } /** * Return the specified object. * * @param string $object_id The object id. * * @return array The object data as an array. */ public function getObject($object_id) { $this->_init(); $objects = $this->_data_cache->getObjects(); if (isset($objects[$object_id])) { return $objects[$object_id]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Object ID %s does not exist!', $object_id) ); } } /** * Return the specified attachment. * * @param string $attachment_id The attachment id. * * @return resource An open stream to the attachment data. */ public function getAttachment($attachment_id) { //@todo } /** * Retrieve all object ids in the current folder. * * @return array The object ids. */ public function getObjectIds() { $this->_init(); return array_keys($this->_data_cache->getObjects()); } /** * Retrieve all objects in the current folder. * * @return array An array of all objects. */ public function getObjects() { $this->_init(); return $this->_data_cache->getObjects(); } /** * Return the mapping of object IDs to backend IDs. * * @return array The object to backend mapping. */ public function getObjectToBackend() { $this->_init(); return $this->_data_cache->getObjectToBackend(); } /** * Retrieve the list of object duplicates. * * @return array The list of duplicates. */ public function getDuplicates() { $this->_init(); return $this->_data_cache->getDuplicates(); } /** * Retrieve the list of object errors. * * @return array The list of errors. */ public function getErrors() { $this->_init(); return $this->_data_cache->getErrors(); } /** * Synchronize the query data with the information from the backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { $current = $this->getStamp(); if (!$this->_data_cache->isInitialized()) { $this->_completeSynchronization($current); return; } $previous = unserialize($this->_data_cache->getStamp()); if ($previous === false || $previous->isReset($current)) { $this->_completeSynchronization($current); return; } if (!isset($params['changes'])) { $changes = $previous->getChanges($current); $params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED] = $this->fetch( $changes[Horde_Kolab_Storage_Folder_Stamp::ADDED] ); $params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] = $this->_data_cache->backendMap( $changes[Horde_Kolab_Storage_Folder_Stamp::DELETED] ); } if ($params['changes'] !== false) { $params['last_sync'] = $this->_data_cache->getLastSync(); $this->_data_cache->store( $params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED], $current, $this->getVersion(), $params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] ); $params['current_sync'] = $this->_data_cache->getLastSync(); parent::synchronize($params); $this->_data_cache->save(); } $this->_init = true; } /** * Perform a complete synchronization. * * @param Horde_Kolab_Storage_Folder_Stamp $stamp The current stamp. * @param array $params Additional parameters. * * @return NULL */ private function _completeSynchronization(Horde_Kolab_Storage_Folder_Stamp $stamp, $params = array()) { $this->_data_cache->reset(); $ids = $stamp->ids(); $params['last_sync'] = false; $params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED] = empty($ids) ? array() : $this->fetch($ids); $this->_data_cache->store( $params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED], $stamp, $this->getVersion() ); $params['current_sync'] = $this->_data_cache->getLastSync(); parent::synchronize($params); $this->_data_cache->save(); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Exception.php0000664000175000017500000000162312207101545023241 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The exception marker for data specific Horde_Kolab_Storage errors. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Exception extends Horde_Kolab_Storage_Exception { } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Old.php0000664000175000017500000003521712207101545022027 0ustar janjan * @author Thomas Jarosch * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Kolab_Data class represents a data type in a Kolab storage * folder on the Kolab server. * * Copyright 2009-2013 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. * * @category Kolab * @package Kolab_Storage * @author Stuart Binge * @author Thomas Jarosch * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Data_Old { /** * The link to the parent folder object. * * @var Kolab_Folder */ private $_folder; /** * The folder type. * * @var string */ private $_type; /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * The factory for generating additional resources. * * @var Horde_Kolab_Storage_Factory */ private $_factory; /** * The object type of the data. * * @var string */ private $_object_type; /** * The version of the data. * * @var int */ private $_data_version; /** * The data cache. * * @var Kolab_Cache */ private $_cache; /** * The Id of this data object in the cache. * * @var string */ private $_cache_key; /** * An addition to the cache key in case we are operating on * something other than the default type. * * @var string */ private $_type_key; /** * Do we optimize for cyrus IMAPD? * * @var boolean */ private $_cache_cyrus_optimize = true; /** * Creates a Kolab Folder Data representation. * * @param string $folder Name/ID of the folder. * @param string $type Type of the folder. * @param Horde_Kolab_Storage_Driver $driver The primary connection driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param string $object_type Type of the objects we want to read. * @param int $data_version Format version of the object data. */ public function __construct($folder, $type, $driver, $factory, $object_type = null, $data_version = 1) { $this->_type = $type; if (!empty($object_type)) { $this->_object_type = $object_type; } else { $this->_object_type = $type; } $this->_data_version = $data_version; if ($this->_object_type != $this->_type) { $this->_type_key = '@' . $this->_object_type; } else { $this->_type_key = ''; } } /** * Delete the specified message from this folder. * * @param string $object_uid Id of the message to be deleted. * * @return boolean|PEAR_Error True is successful, false if the * message does not exist. */ public function delete($object_uid) { if (!$this->objectUidExists($object_uid)) { return false; } // Find the storage ID $id = $this->getStorageId($object_uid); if ($id === false) { return false; } $result = $this->_folder->deleteMessage($id); if (is_a($result, 'PEAR_Error')) { return $result; } unset($this->_cache->objects[$object_uid]); unset($this->_cache->uids[$id]); $this->_cache->save(); return true; } /** * Delete all messages from the current folder. * * @return boolean|PEAR_Error True if successful. */ public function deleteAll() { $this->_cache->load($this->_cache_key, $this->_data_version); if (empty($this->_cache->uids)) { return true; } foreach ($this->_cache->uids as $id => $object_uid) { $this->_folder->deleteMessage($id, false); unset($this->_cache->objects[$object_uid]); unset($this->_cache->uids[$id]); } $this->_cache->save(); $result = $this->_folder->trigger(); if (is_a($result, 'PEAR_Error')) { Horde::logMessage(sprintf('Failed triggering folder %s!', $this->_folder->name), 'ERR'); } return true; } /** * Move the specified message from the current folder into a new * folder. * * @param string $object_uid ID of the message to be deleted. * @param string $new_share ID of the target share. * * @return boolean|PEAR_Error True is successful, false if the * object does not exist. */ public function move($object_uid, $new_share) { if (!$this->objectUidExists($object_uid)) { return false; } // Find the storage ID $id = $this->getStorageId($object_uid); if ($id === false) { return false; } $result = $this->_folder->moveMessageToShare($id, $new_share); unset($this->_cache->objects[$object_uid]); unset($this->_cache->uids[$id]); $this->_cache->save(); return true; } /** * Save an object. * * @param array $object The array that holds the data object. * @param string $old_object_id The id of the object if it existed before. * * @return boolean True on success. * * @throws Horde_Kolab_Storage_Exception In case the given old object id * is invalid or an error occured * while saving the data. */ public function save($object, $old_object_id = null) { // update existing kolab object if ($old_object_id != null) { // check if object really exists if (!$this->objectUidExists($old_object_id)) { throw new Horde_Kolab_Storage_Exception(sprintf(Horde_Kolab_Storage_Translation::t("Old object %s does not exist."), $old_object_id)); } // get the storage ID $id = $this->getStorageId($old_object_id); if ($id === false) { throw new Horde_Kolab_Storage_Exception(sprintf(Horde_Kolab_Storage_Translation::t("Old object %s does not map to a uid."), $old_object_id)); } $old_object = $this->getObject($old_object_id); } else { $id = null; $old_object = null; } $this->_folder->saveObject($object, $this->_data_version, $this->_object_type, $id, $old_object); $this->synchronize($old_object_id); return true; } /** * Synchronize the data cache for the current folder. * * @param string $history_ignore Object uid that should not be * updated in the History * * @return NULL */ public function synchronize($history_ignore = null) { $this->_cache->load($this->_cache_key, $this->_data_version); $result = $this->_folder->getStatus(); list($validity, $nextid, $ids) = $result; $changes = $this->_folderChanged($validity, $nextid, array_keys($this->_cache->uids), $ids); if ($changes) { $modified = array(); $recent_uids = array_diff($ids, array_keys($this->_cache->uids)); $formats = $this->_folder->getFormats(); $handler = Horde_Kolab_Format::factory('Xml', $this->_object_type, $this->_data_version); $count = 0; foreach ($recent_uids as $id) { if ($this->_type == 'annotation' && $id != 1) { continue; } try { $mime = $this->_folder->parseMessage($id, $handler->getMimeType(), false); $text = $mime[0]; } catch (Horde_Kolab_Storage_Exception $e) { Horde::logMessage($mime, 'WARN'); $text = false; } if ($text) { $object = $handler->load($text); if (is_a($object, 'PEAR_Error')) { $this->_cache->ignore($id); $object->addUserInfo('STORAGE ID: ' . $id); Horde::logMessage($object, 'WARN'); continue; } } else { $object = false; } if ($object !== false) { $message = &$mime[2]; $handler_type = $handler->getMimeType(); foreach ($message->getParts() as $part) { $name = $part->getName(); $type = $part->getType(); $dp = $part->getDispositionParameter('x-kolab-type'); if (!empty($name) && $type != $handler_type || (!empty($dp) && in_array($dp, $formats))) { $object['_attachments'][$name]['type'] = $type; $object['_attachments'][$name]['key'] = $this->_cache_key . '/' . $object['uid'] . ':' . $name; //@todo: Check what to do with this call //$part->transferDecodeContents(); $result = $this->_cache->storeAttachment($object['_attachments'][$name]['key'], $part->getContents()); if (is_a($result, 'PEAR_Error')) { Horde::logMessage(sprintf('Failed storing attachment of object %s: %s', $id, $result->getMessage()), 'ERR'); $object = false; break; } } } } if ($object !== false) { $this->_cache->store($id, $object['uid'], $object); $mod_ts = time(); if (is_array($changes) && in_array($object['uid'], $changes) && $object['uid'] != $history_ignore) { $this->_updateHistory($object['uid'], $mod_ts, 'modify'); $modified[] = $object['uid']; } else { $this->_updateHistory($object['uid'], $mod_ts, 'add'); } } else { $this->_cache->ignore($id); } // write out cache once in a while so if the browser times out // we don't have to start from the beginning. if ($count > 500) { $count = 0; $this->_cache->save(); } $count++; } $this->_cache->save(); if (is_array($changes)) { $deleted = array_diff($changes, $modified); foreach ($deleted as $deleted_oid) { if ($deleted_oid != $history_ignore) { $this->_updateHistory($deleted_oid, time(), 'delete'); } } } } } /** * Update the Horde history in case an element was modified * outside of Horde. * * @param string $object_uid Object uid that should be updated. * @param int $mod_ts Timestamp of the modification. * @param string $action The action that was performed. * * @return NULL */ private function _updateHistory($object_uid, $mod_ts, $action) { global $registry; if (!isset($registry)) { return; } $app = $registry->getApp(); if (empty($app) || is_a($app, 'PEAR_Error')) { /** * Ignore the history if we are not in application * context. */ return $app; } if (!class_exists('Horde_History')) { return; } /* Log the action on this item in the history log. */ try { $GLOBALS['injector']->getInstance('Horde_History') ->log($app . ':' . $this->_folder->getShareId() . ':' . $object_uid, array('action' => $action, 'ts' => $mod_ts), true); } catch (Horde_Exception $e) { } } /** * Test if the storage ID exists. * * @param int $uid The storage ID. * * @return boolean True if the ID exists. */ public function storageIdExists($uid) { $this->_cache->load($this->_cache_key, $this->_data_version); return array_key_exists($uid, $this->_cache->uids); } /** * Generate a unique object id. * * @return string The unique id. */ public function generateUID() { do { $key = md5(uniqid(mt_rand(), true)); } while ($this->objectUidExists($key)); return $key; } /** * Return the specified attachment. * * @param string $attachment_id The attachment id. * * @return string|PEAR_Error The attachment data as a string. */ public function getAttachment($attachment_id) { $this->_cache->load($this->_cache_key, $this->_data_version); return $this->_cache->loadAttachment($attachment_id); } /** * Retrieve all objects in the current folder as an array. * * @return array The object data array. */ public function getObjectArray() { $this->_cache->load($this->_cache_key, $this->_data_version); return $this->_cache->objects; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data/Query.php0000664000175000017500000000147412207101545022414 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Represents a data query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Data_Query extends Horde_Kolab_Storage_Query { } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Decorator/Log.php0000664000175000017500000000607312207101545023101 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A log decorator for the Kolab storage handler. * * Copyright 2004-2013 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. * * @deprecated * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Decorator_Log implements Horde_Kolab_Storage { /** * The decorated storage handler. * * @var Horde_Kolab_Storage */ private $_storage; /** * A log handler. * * @var mixed */ private $_logger; /** * Constructor. * * @param Horde_Kolab_Storage $storage The storage handler. * @param mixed $logger The log handler. This instance * must provide the debug() method. */ public function __construct(Horde_Kolab_Storage $storage, $logger) { $this->_storage = $storage; $this->_logger = $logger; } /** * Get the folder list object. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getList() { return $this->_storage->getList(); } /** * Get a folder list object for a "system" user. * * @param string $type The type of system user. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getSystemList($type) { return $this->_storage->getSystemList($type); } /** * Get a Folder object. * * @param string $folder The folder name. * * @return Horde_Kolab_Storage_Folder The Kolab folder object. */ public function getFolder($folder) { return $this->getList()->getFolder($folder); } /** * Return a data handler for accessing data in the specified * folder. * * @param string $folder The name of the folder. * @param string $object_type The type of data we want to * access in the folder. * @param int $data_version Format version of the object data. * * @return Horde_Kolab_Storage_Data The data object. */ public function getData($folder, $object_type = null, $data_version = 1) { return new Horde_Kolab_Storage_Data_Decorator_Log( $this->_storage->getData($folder, $object_type, $data_version), $this->_logger ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Decorator/Synchronization.php0000664000175000017500000000651512207101545025562 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A synchronization decorator for the Kolab storage handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Decorator_Synchronization implements Horde_Kolab_Storage { /** * The decorated storage handler. * * @var Horde_Kolab_Storage */ private $_storage; /** * The synchronization strategy * * @var Horde_Kolab_Storage_Synchronization */ private $_synchronization; /** * Constructor. * * @param Horde_Kolab_Storage $storage The storage handler. * @param Horde_Kolab_Storage_Synchronization $synchronization The synchronization strategy. */ public function __construct(Horde_Kolab_Storage $storage, Horde_Kolab_Storage_Synchronization $synchronization) { $this->_storage = $storage; $this->_synchronization = $synchronization; } /** * Get the folder list object. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getList() { $list = $this->_storage->getList(); $this->_synchronization->synchronizeList($list); return $list; } /** * Get a folder list object for a "system" user. * * @param string $type The type of system user. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getSystemList($type) { $list = $this->_storage->getSystemList($type); $this->_synchronization->synchronizeList($list); return $list; } /** * Get a Folder object. * * @param string $folder The folder name. * * @return Horde_Kolab_Storage_Folder The Kolab folder object. */ public function getFolder($folder) { return $this->_storage->getFolder($folder); } /** * Return a data handler for accessing data in the specified * folder. * * @param string $folder The name of the folder. * @param string $object_type The type of data we want to * access in the folder. * @param int $data_version Format version of the object data. * * @return Horde_Kolab_Storage_Data The data object. */ public function getData($folder, $object_type = null, $data_version = 1) { $data = $this->_storage->getData($folder, $object_type, $data_version); $this->_synchronization->synchronizeData($data); return $data; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Decorator/Base.php0000664000175000017500000002732312207101545024466 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The basic driver decorator definition for accessing Kolab storage. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Decorator_Base implements Horde_Kolab_Storage_Driver { /** * The decorated driver. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The decorated driver. */ public function __construct(Horde_Kolab_Storage_Driver $driver) { $this->_driver = $driver; } /** * Return the class name of the decorated driver. * * @return string The class name of the decorated driver. */ public function getDriverName() { return get_class($this->_driver); } /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { return $this->_driver->createBackend(); } /** * Returns the actual backend driver. * * If there is no driver set the driver should be constructed within this * method. * * @return mixed The backend driver. */ public function getBackend() { return $this->_driver->getBackend(); } /** * Set the backend driver. * * @param mixed $backend The driver that should be used. * * @return NULL */ public function setBackend($backend) { $this->_driver->setBackend($backend); } /** * Returns the parser for data objects. * * @return Horde_Kolab_Storage_Data_Parser The parser. */ public function getParser() { return $this->_driver->getParser(); } /** * Set the data parser. * * @param mixed $parser The parser that should be used. * * @return NULL */ public function setParser(Horde_Kolab_Storage_Data_Parser $parser) { $this->_driver->setParser($parser); } /** * Return the id of the user currently authenticated. * * @return string The id of the user that opened the connection. */ public function getAuth() { return $this->_driver->getAuth(); } /** * Return the unique connection id. * * @return string The connection id. */ public function getId() { return $this->_driver->getId(); } /** * Return the connection parameters. * * @return array The connection parameters. */ public function getParameters() { return $this->_driver->getParameters(); } /** * Checks if the backend supports CATENATE. * * @return boolean True if the backend supports CATENATE. */ public function hasCatenateSupport() { return $this->_driver->hasCatenateSupport(); } /** * Retrieves a list of mailboxes from the server. * * @return array The list of mailboxes. */ public function listFolders() { return $this->_driver->listFolders(); } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { $this->_driver->create($folder); } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { $this->_driver->delete($folder); } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { return $this->_driver->rename($old, $new); } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { return $this->_driver->hasAclSupport(); } /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { return $this->_driver->getAcl($folder); } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { return $this->_driver->getMyAcl($folder); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $this->_driver->setAcl($folder, $user, $acl); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->_driver->deleteAcl($folder, $user); } /** * Retrieves the specified annotation for the complete list of mailboxes. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { return $this->_driver->listAnnotation($annotation); } /** * Fetches the annotation on a folder. * * @param string $entry The entry to fetch. * @param string $folder The name of the folder. * * @return string The annotation value. */ public function getAnnotation($entry, $folder) { return $this->_driver->getAnnotation($entry, $folder); } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { $this->_driver->setAnnotation($folder, $annotation, $value); } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { return $this->_driver->getNamespace(); } /** * Returns a stamp for the current folder status. This stamp can be used to * identify changes in the folder data. * * @param string $folder Return the stamp for this folder. * * @return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current * folder status. */ public function getStamp($folder) { return $this->_driver->getStamp($folder); } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { return $this->_driver->status($folder); } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { return $this->_driver->getUids($folder); } /** * Fetches the objects for the specified UIDs. * * @param string $folder The folder to access. * * @return array The parsed objects. */ public function fetch($folder, $uids, $options = array()) { return $this->_driver->fetch($folder, $uids, $options); } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { return $this->_driver->fetchStructure($folder, $uids); } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { return $this->_driver->fetchBodypart($folder, $uid, $id); } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { return $this->_driver->fetchComplete($folder, $uid); } /** * Retrieves the message headers. * * @param string $folder The folder to fetch the message from. * @param array $uid The message UID. * * @return Horde_Mime_Headers The message headers. */ public function fetchHeaders($folder, $uid) { return $this->_driver->fetchHeaders($folder, $uid); } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { return $this->_driver->appendMessage($folder, $msg); } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { $this->_driver->deleteMessages($folder, $uids); } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { $this->_driver->moveMessage($uid, $old_folder, $new_folder); } /** * Expunges messages in the current folder. * * @param string $folder The folder to expunge. * * @return NULL */ public function expunge($folder) { $this->_driver->expunge($folder); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Decorator/Log.php0000664000175000017500000001650112207101545024331 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A log decorator definition for the Kolab storage drivers. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Decorator_Log extends Horde_Kolab_Storage_Driver_Decorator_Base { /** * A log handler. * * @var mixed */ private $_logger; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The decorated driver. * @param mixed $logger The log handler. This instance * must provide the debug() method. */ public function __construct(Horde_Kolab_Storage_Driver $driver, $logger) { $this->_logger = $logger; parent::__construct($driver); } /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { $this->_logger->debug( sprintf('Driver "%s": Creating backend.', $this->getDriverName()) ); $result = $this->_driver->createBackend(); $this->_logger->debug( sprintf( 'Driver "%s": Backend successfully created', $this->getDriverName() ) ); return $result; } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { $this->_logger->debug( sprintf( 'Driver "%s": Creating folder %s.', $this->getDriverName(), $folder ) ); $result = parent::create($folder); $this->_logger->debug( sprintf( 'Driver "%s": Successfully created folder %s.', $this->getDriverName(), $folder ) ); } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { $this->_logger->debug( sprintf( 'Driver "%s": Deleting folder %s.', $this->getDriverName(), $folder ) ); $result = parent::delete($folder); $this->_logger->debug( sprintf( 'Driver "%s": Successfully deleted folder %s.', $this->getDriverName(), $folder ) ); } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { $this->_logger->debug( sprintf( 'Driver "%s": Renaming folder %s.', $this->getDriverName(), $old ) ); $result = parent::rename($old, $new); $this->_logger->debug( sprintf( 'Driver "%s": Successfully renamed folder %s to %s.', $this->getDriverName(), $old, $new ) ); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $this->_logger->debug( sprintf( 'Driver "%s": Setting ACL %s for user %s on folder %s.', $this->getDriverName(), $acl, $user, $folder ) ); parent::setAcl($folder, $user, $acl); $this->_logger->debug( sprintf( 'Driver "%s": Successfully set ACL on folder %s to %s.', $this->getDriverName(), $folder, $acl ) ); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->_logger->debug( sprintf( 'Driver "%s": Deleting ACL for user %s on folder %s.', $this->getDriverName(), $user, $folder ) ); parent::deleteAcl($folder, $user); $this->_logger->debug( sprintf( 'Driver "%s": Successfully deleted ACL on folder %s.', $this->getDriverName(), $folder ) ); } /** * Retrieves a list of mailboxes from the server. * * @return array The list of mailboxes. */ public function listFolders() { $this->_logger->debug( sprintf('Driver "%s": Listing folders.', $this->getDriverName()) ); $result = parent::listFolders(); $this->_logger->debug( sprintf( 'Driver "%s": List contained %s folders.', $this->getDriverName(), count($result)) ); return $result; } /** * Retrieves the specified annotation for the complete list of mailboxes. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { $this->_logger->debug( sprintf('Driver "%s": Listing annotation "%s".', $this->getDriverName(), $annotation) ); $result = parent::listAnnotation($annotation); $this->_logger->debug( sprintf( 'Driver "%s": List contained %s folder annotations.', $this->getDriverName(), count($result)) ); return $result; } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { $this->_logger->debug( sprintf('Driver "%s": Retrieving namespaces.', $this->getDriverName()) ); $result = parent::getNamespace(); $this->_logger->debug( sprintf( 'Driver "%s": Retrieved namespaces [%s].', $this->getDriverName(), (string)$result ) ); return $result; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Decorator/Timer.php0000664000175000017500000001236612207101545024675 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A stop watch decorator for outgoing requests from the Kolab storage drivers. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Decorator_Timer extends Horde_Kolab_Storage_Driver_Decorator_Base { /** * A log handler. * * @var mixed */ private $_logger; /** * A stop watch. * * @var Horde_Support_Timer */ private $_timer; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The decorated driver. * @param Horde_Support_Timer $timer A stop watch. * @param mixed $logger The log handler. This instance * must provide the debug() method. */ public function __construct(Horde_Kolab_Storage_Driver $driver, Horde_Support_Timer $timer, $logger) { $this->_logger = $logger; $this->_timer = $timer; parent::__construct($driver); } /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { $this->_timer->push(); $result = parent::createBackend(); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [construct]', floor($this->_timer->pop() * 1000) ) ); return $result; } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { $this->_timer->push(); $result = parent::create($folder); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [createFolder]', floor($this->_timer->pop() * 1000) ) ); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $this->_timer->push(); parent::setAcl($folder, $user, $acl); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [setAcl]', floor($this->_timer->pop() * 1000) ) ); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->_timer->push(); parent::deleteAcl($folder, $user); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [deleteAcl]', floor($this->_timer->pop() * 1000) ) ); } /** * Retrieves a list of mailboxes from the server. * * @return array The list of mailboxes. */ public function listFolders() { $this->_timer->push(); $result = parent::listFolders(); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [listFolders]', floor($this->_timer->pop() * 1000) ) ); return $result; } /** * Retrieves the specified annotation for the complete list of mailboxes. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { $this->_timer->push(); $result = parent::listAnnotation($annotation); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [listAnnotation]', floor($this->_timer->pop() * 1000) ) ); return $result; } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { $this->_timer->push(); $result = parent::getNamespace(); $this->_logger->debug( sprintf( 'REQUEST OUT IMAP: %s ms [getNamespace]', floor($this->_timer->pop() * 1000) ) ); return $result; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Mock/Data.php0000664000175000017500000003121112207101545023423 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Data storage for the mock driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Mock_Data implements ArrayAccess { /** Flag to indicated a deleted message*/ const FLAG_DELETED = 1; /** * The data array. * * @var array */ private $_data; /** * The currently selected folder. * * @var string */ private $_selected; /** * Constructor. * * @param array $data This may be match the internal format used by this * class to represent the IMAP mock data or it can be an * abbreviated format (@see * Horde_Kolab_Storage_Driver_Mock_Data::_setupBrief). */ public function __construct($data) { if (isset($data['format'])) { $format = $data['format']; unset($data['format']); switch ($format) { case 'brief': $data = $this->_convertBrief($data); break; default: break; } } $this->_data = $data; } /** * Generate the internal mock data representation from an abbreviated mock * data format. * * @todo Document the format * * @param array $data The abbreviated data format. */ private function _convertBrief(array $data) { $result = array(); foreach ($data as $path => $element) { if (!isset($element['p'])) { $folder = array('permissions' => array('anyone' => 'alrid')); } else { $folder = array('permissions' => $element['p']); } if (isset($element['a'])) { $folder['annotations'] = $element['a']; } if (isset($element['t'])) { $folder['annotations'] = array( '/shared/vendor/kolab/folder-type' => $element['t'], ); } if (isset($element['m'])) { $folder['mails'] = $element['m']; foreach ($element['m'] as $uid => $mail) { if (isset($mail['structure'])) { $folder['mails'][$uid]['structure'] = unserialize( base64_decode(file_get_contents($mail['structure'])) ); } if (isset($mail['parts'])) { $folder['mails'][$uid]['structure']['parts'] = $mail['parts']; } if (isset($mail['file'])) { $folder['mails'][$uid]['stream'] = fopen($mail['file'], 'r'); } } } if (isset($element['s'])) { $folder['status'] = $element['s']; } else { $folder['status'] = array( 'uidvalidity' => time(), 'uidnext' => !empty($folder['mails']) ? max(array_keys($folder['mails'])) + 1 : 1 ); } $result[$path] = $folder; } return $result; } /** * Returns the value of the given offset in this array. * * @param string|int $offset The array offset. * * @return mixed The data value. */ public function offsetGet($offset) { return $this->_data[$offset]; } /** * Sets the value of the given offset in this array. * * @param string|int $offset The array offset. * @param mi $offset The array offset. * * @return NULL */ public function offsetSet($offset, $value) { $this->_data[$offset] = $value; } /** * Tests if the value of the given offset exists in this array. * * @param string|int $offset The array offset. * * @return boolean True if the offset exists. */ public function offsetExists($offset) { return isset($this->_data[$offset]); } /** * Removes the given offset exists from this array. * * @param string|int $offset The array offset. * * @return NULL */ public function offsetUnset($offset) { unset($this->_data[$offset]); } /** * Returns the array keys of this array. * * @return array The keys of this array. */ public function arrayKeys() { return array_keys($this->_data); } public function hasPermissions($folder) { return isset($this->_data[$folder]['permissions']); } public function getPermissions($folder) { return $this->_data[$folder]['permissions']; } public function hasUserPermissions($folder, $user) { return isset($this->_data[$folder]['permissions'][$user]); } public function getUserPermissions($folder, $user) { return $this->_data[$folder]['permissions'][$user]; } public function setUserPermissions($folder, $user, $acl) { $this->_data[$folder]['permissions'][$user] = $acl; } public function deleteUserPermissions($folder, $user) { unset($this->_data[$folder]['permissions'][$user]); } public function hasAnnotation($folder, $annotation) { return isset($this->_data[$folder]['annotations'][$annotation]); } public function getAnnotation($folder, $annotation) { return $this->_data[$folder]['annotations'][$annotation]; } public function setAnnotation($folder, $annotation, $value) { $this->_data[$folder]['annotations'][$annotation] = $value; } public function deleteAnnotation($folder, $annotation) { unset($this->_data[$folder]['annotations'][$annotation]); } public function select($folder) { if (!isset($this->_data[$folder])) { throw new Horde_Kolab_Storage_Exception( sprintf('Folder %s does not exist!', $folder) ); } if ($this->_selected !== $this->_data[$folder]) { $this->_selected = &$this->_data[$folder]; } } public function status($folder) { $this->select($folder); return $this->_selected['status']; } public function getUids($folder) { $this->select($folder); if (empty($this->_selected['mails'])) { return array(); } else { return array_keys( array_filter($this->_selected['mails'], array($this, '_notDeleted')) ); } } /** * Indicates if a message is considered deleted. * * @param array $message The message information. * * @return boolean True if the message has not been marked as deleted. */ public function _notDeleted($message) { return !isset($message['flags']) || !($message['flags'] & self::FLAG_DELETED); } public function fetchComplete($folder, $uid) { $this->select($folder); if (isset($this->_selected['mails'][$uid]['stream'])) { rewind($this->_selected['mails'][$uid]['stream']); $msg = stream_get_contents($this->_selected['mails'][$uid]['stream']); return array( Horde_Mime_Headers::parseHeaders($msg), Horde_Mime_Part::parseMessage($msg) ); } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'No message %s in folder %s!', $uid, $folder ) ); } } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { $this->select($folder); $result = array(); foreach ($uids as $uid) { if (isset($this->_selected['mails'][$uid]['structure'])) { $result[$uid]['structure'] = $this->_selected['mails'][$uid]['structure']; } else if (isset($this->_selected['mails'][$uid]['stream'])) { rewind($this->_selected['mails'][$uid]['stream']); $result[$uid]['structure'] = Horde_Mime_Part::parseMessage( stream_get_contents($this->_selected['mails'][$uid]['stream']) ); } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'No message %s in folder %s!', $uid, $folder ) ); } } return $result; } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { $this->select($folder); if (isset($this->_selected['mails'][$uid]['parts'][$id])) { if (isset($this->_selected['mails'][$uid]['parts'][$id]['file'])) { return fopen( $this->_selected['mails'][$uid]['parts'][$id]['file'], 'r' ); } } else if (isset($this->_selected['mails'][$uid]['stream'])) { rewind($this->_selected['mails'][$uid]['stream']); return Horde_Mime_Part::parseMessage( stream_get_contents($this->_selected['mails'][$uid]['stream']) )->getPart($id)->getContents(); } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'No such part %s for message uid %s in folder %s!', $id, $uid, $folder ) ); } } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { rewind($msg); $this->select($folder); $this->_selected['mails'][$this->_selected['status']['uidnext']] = array( 'flags' => 0, 'stream' => $msg, ); return $this->_selected['status']['uidnext']++; } public function deleteMessages($folder, $uids) { $this->select($folder); foreach ($uids as $uid) { if (isset($this->_selected['mails'][$uid]['flags'])) { $this->_selected['mails'][$uid]['flags'] |= self::FLAG_DELETED; } else { $this->_selected['mails'][$uid]['flags'] = self::FLAG_DELETED; } } } public function moveMessage($uid, $old_folder, $new_folder) { $this->select($old_folder); if (!isset($this->_selected['mails'][$uid])) { throw new Horde_Kolab_Storage_Exception(sprintf("No IMAP message %s!", $uid)); } $mail = $this->_selected['mails'][$uid]; $this->deleteMessages($old_folder, array($uid)); $this->appendMessage($new_folder, $mail['stream']); $this->expunge($old_folder); } public function expunge($folder) { $this->select($folder); $delete = array(); foreach ($this->_selected['mails'] as $uid => $mail) { if (isset($mail['flags']) && ($mail['flags'] & self::FLAG_DELETED)) { $delete[] = $uid; } } foreach ($delete as $uid) { unset($this->_selected['mails'][$uid]); } } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Base.php0000664000175000017500000002461412207101545022544 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The base driver definition for accessing Kolab storage drivers. * * Copyright 2009-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_Driver_Base implements Horde_Kolab_Storage_Driver { /** * Factory for generating helper objects. * * @var Horde_Kolab_Storage_Factory */ private $_factory; /** * Additional connection parameters. * * @var array */ private $_params; /** * Memory cache for the namespace of this driver. * * @var Horde_Kolab_Storage_Folder_Namespace */ protected $_namespace; /** * The backend to use. * * @var mixed */ private $_backend; /** * Charset used by this driver. * * @var string */ protected $charset = 'UTF7-IMAP'; /** * Constructor. * * @param Horde_Kolab_Storage_Factory $factory A factory for helper objects. * @param array $params Connection parameters. */ public function __construct(Horde_Kolab_Storage_Factory $factory, $params = array()) { $this->_factory = $factory; if (isset($params['backend'])) { $this->setBackend($params['backend']); } $this->_params = $params; } /** * Returns the actual backend driver. * * If there is no driver set the driver should be constructed within this * method. * * @return mixed The backend driver. */ public function getBackend() { if ($this->_backend === null) { $this->_backend = $this->createBackend(); } return $this->_backend; } /** * Set the backend driver. * * @param mixed $backend The driver that should be used. * * @return NULL */ public function setBackend($backend) { $this->_backend = $backend; } /** * Return all parameter settings for this connection. * * @return array The parameters. */ public function getParams() { return $this->_params; } /** * Return a parameter setting for this connection. * * @param string $key The parameter key. * @param mixed $default An optional default value. * * @return mixed The parameter value. */ public function getParam($key, $default = null) { return isset($this->_params[$key]) ? $this->_params[$key] : $default; } /** * Set a parameter setting for this connection. * * @param string $key The parameter key. * @param mixed $value The parameter value. * * @return NULL */ public function setParam($key, $value) { $this->_params[$key] = $value; } /** * Return the id of the user currently authenticated. * * @return string The id of the user that opened the IMAP connection. */ public function getAuth() { return $this->getParam('username'); } /** * Return the unique connection id. * * @return string The connection id. */ public function getId() { return $this->getAuth() . '@' . $this->getParam('host') . ':' . $this->getParam('port'); } /** * Return the connection parameters. * * @return array The connection parameters. */ public function getParameters() { return array( 'user' => $this->getAuth(), 'host' => $this->getParam('host'), 'port' => $this->getParam('port') ); } /** * Return the factory. * * @return Horde_Kolab_Storage_Factory The factory. */ protected function getFactory() { return $this->_factory; } /** * Encode IMAP path names from UTF-8 to the driver charset. * * @param string $path The UTF-8 encoded path name. * * @return string The path name in the driver charset. */ protected function encodePath($path) { return Horde_String::convertCharset($path, 'UTF-8', $this->charset); } /** * Decode IMAP path names from the driver charset to UTF-8. * * @param string $path The the driver charset encoded path name. * * @return string The path name in UTF-8. */ protected function decodePath($path) { return Horde_String::convertCharset($path, $this->charset, 'UTF-8'); } /** * Decode a list of IMAP path names from the driver charset to UTF-8. * * @param array $list The the driver charset encoded path names. * * @return array The path names in UTF-8. */ protected function decodeList(array $list) { return array_map(array($this, 'decodePath'), $list); } /** * Decode the keys of a list of IMAP path names from the driver charset to * UTF-8. * * @param array $list The list with the driver charset encoded path names as * keys. * * @return array The list with path names in UTF-8 as keys. */ protected function decodeListKeys(array $list) { $result = array(); foreach ($list as $key => $value) { $result[$this->decodePath($key)] = $value; } return $result; } /** * Checks if the backend supports CATENATE. * * @return boolean True if the backend supports CATENATE. */ public function hasCatenateSupport() { return false; } /** * Return a modifiable message object. * * @param string $folder The folder to access. * @param string $obid The backend ID of the object to retrieve from the folder. * @param array $object The object data. * * @return Horde_Kolab_Storage_Driver_Modifiable The modifiable message object. */ public function getModifiable($folder, $obid, $object) { return new Horde_Kolab_Storage_Data_Modifiable( $this, $folder, $this->fetchComplete($folder, $obid) ); } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Folder_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->_namespace === null) { if (isset($this->_params['namespaces'])) { $this->_namespace = $this->_factory->createNamespace( 'config', $this->getAuth(), $this->_params['namespaces'] ); } else { $this->_namespace = $this->_factory->createNamespace( 'fixed', $this->getAuth() ); } } return $this->_namespace; } /** * Returns a stamp for the current folder status. This stamp can be used to * identify changes in the folder data. * * @param string $folder Return the stamp for this folder. * * @return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current * folder status. */ public function getStamp($folder) { return new Horde_Kolab_Storage_Folder_Stamp_Uids( $this->status($folder), $this->getUids($folder) ); } /** * Retrieves the messages for the given message ids. * * @param string $mailbox The mailbox to fetch the messages from. * @param array $uids The message UIDs. * * @return Horde_Mime_Part The message structure parsed into a * Horde_Mime_Part instance. */ public function fetchStructure($mailbox, $uids) { throw new Horde_Kolab_Storage_Exception('"fetchStructure() not supported by this driver!'); } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $mailbox The mailbox to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource The body part, in a stream resource. */ public function fetchBodypart($mailbox, $uid, $id) { throw new Horde_Kolab_Storage_Exception('"fetchBodypart() not supported by this driver!'); } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { throw new Horde_Kolab_Storage_Exception('"fetchComplete() not supported by this driver!'); } /** * Retrieves the message headers. * * @param string $folder The folder to fetch the message from. * @param array $uid The message UID. * * @return Horde_Mime_Headers The message headers. */ public function fetchHeaders($folder, $uid) { $result = $this->fetchComplete($folder, $uid); return $result[0]; } /** * Split a name for the METADATA extension into the correct syntax for the * older ANNOTATEMORE version. * * @param string $name A name for a metadata entry. * * @return array A list of two elements: The entry name and the value * type. * @throws Horde_Imap_Client_Exception */ protected function _getAnnotateMoreEntry($name) { if (substr($name, 0, 7) == '/shared') { return array(substr($name, 7), 'value.shared'); } else if (substr($name, 0, 8) == '/private') { return array(substr($name, 8), 'value.priv'); } $this->_exception('Invalid METADATA entry: ' . $name); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Cclient.php0000664000175000017500000006541012207101545023252 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * An cclient based Kolab storage driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Cclient extends Horde_Kolab_Storage_Driver_Base { /** * The c-client code -> MIME type conversion table. * * @var array */ protected $_mimeTypes = array( TYPETEXT => 'text', TYPEMULTIPART => 'multipart', TYPEMESSAGE => 'message', TYPEAPPLICATION => 'application', TYPEAUDIO => 'audio', TYPEIMAGE => 'image', TYPEVIDEO => 'video', TYPEMODEL => 'model', TYPEOTHER => 'other' ); /** * The c-client code -> MIME encodings conversion table. * * @var array */ protected $_mimeEncodings = array( ENC7BIT => '7bit', ENC8BIT => '8bit', ENCBINARY => 'binary', ENCBASE64 => 'base64', ENCQUOTEDPRINTABLE => 'quoted-printable', ENCOTHER => 'unknown' ); /** * Server name. * * @var string */ private $_host; /** * Basic IMAP connection string. * * @var string */ private $_base_mbox; /** * The currently selected folder. * * @var string */ private $_selected; /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { if (!function_exists('imap_open')) { throw new Horde_Kolab_Storage_Exception('The IMAP extension is not available!'); } $result = @imap_open( $this->_getBaseMbox(), $this->getParam('username'), $this->getParam('password'), OP_HALFOPEN ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Connecting to server %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getHost(), imap_last_error() ) ); } return $result; } /** * Return the root folder of the current user. * * @return string The id of the user that opened the IMAP connection. */ private function _getBaseMbox() { if (!isset($this->_base_mbox)) { $this->_base_mbox = '{' . $this->_getHost() . ':' . $this->getParam('port') . '/imap'; $secure = $this->getParam('secure'); if (!empty($secure)) { $this->_base_mbox .= '/' . $secure . '/novalidate-cert'; } else { $this->_base_mbox .= '/notls'; } $this->_base_mbox .= '}'; } return $this->_base_mbox; } /** * Return the root folder of the current user. * * @return string The id of the user that opened the IMAP connection. */ private function _getHost() { if (!isset($this->_host)) { $this->_host = $this->getParam('host'); if (empty($this->_host)) { throw new Horde_Kolab_Storage_Exception( Horde_Kolab_Storage_Translation::t( "Missing \"host\" parameter!" ) ); } } return $this->_host; } /** * Retrieves a list of folders on the server. * * @return array The list of folders. * * @throws Horde_Kolab_Storage_Exception In case listing the folders failed. */ public function listFolders() { return $this->decodeList($this->_listFolders()); } /** * Retrieves a UTF7-IMAP encoded list of folders on the server. * * @return array The list of folders. * * @throws Horde_Kolab_Storage_Exception In case listing the folders failed. */ private function _listFolders() { $folders = array(); $result = imap_list($this->getBackend(), $this->_getBaseMbox(), '*'); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Listing folders for %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox(), imap_last_error() ) ); } $root = $this->_getBaseMbox(); $server_len = strlen($root); foreach ($result as $folder) { if (substr($folder, 0, $server_len) == $root) { $folders[] = substr($folder, $server_len); } } return $folders; } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { $result = imap_createmailbox( $this->getBackend(), $this->_getBaseMbox() . $this->encodePath($folder) ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Creating folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox() . $folder, imap_last_error() ) ); } } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { $result = imap_deletemailbox( $this->getBackend(), $this->_getBaseMbox() . $this->encodePath($folder) ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Deleting folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox() . $folder, imap_last_error() ) ); } } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { $result = imap_renamemailbox( $this->getBackend(), $this->_getBaseMbox() . $this->encodePath($old), $this->_getBaseMbox() . $this->encodePath($new) ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Renaming folder %s to %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox() . $old, $this->_getBaseMbox() . $new, imap_last_error() ) ); } } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { @imap_getacl( $this->getBackend(), $this->_getBaseMbox() ); if (imap_last_error() == 'ACL not available on this IMAP server') { return false; } else { return true; } } /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { $result = imap_getacl($this->getBackend(), $this->encodePath($folder)); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed reading ACL on folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, imap_last_error() ) ); } return $result; } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { if (!function_exists('imap_myrights')) { throw new Horde_Kolab_Storage_Exception('PHP does not support imap_myrights.'); } $result = imap_myrights($this->getBackend(), $this->encodePath($folder)); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed reading user rights on folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, imap_last_error() ) ); } return $result; } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $result = imap_setacl($this->getBackend(), $this->encodePath($folder), $user, $acl); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed setting ACL on folder %s for user %s to %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $user, $acl, imap_last_error() ) ); } return $result; } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->setAcl($folder, $user, ''); } /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { if (!function_exists('imap_getannotation')) { throw new Horde_Kolab_Storage_Exception( 'This driver is not supported by your variant of PHP. The function "imap_getannotation" is missing!' ); } list($entry, $value) = $this->_getAnnotateMoreEntry($annotation); $list = array(); foreach ($this->_listFolders() as $folder) { $result = imap_getannotation($this->getBackend(), $folder, $entry, $value); if (isset($result[$value])) { $list[$folder] = $result[$value]; } } return $this->decodeListKeys($list); } /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation) { list($entry, $key) = $this->_getAnnotateMoreEntry($annotation); $result = imap_getannotation( $this->getBackend(), $this->encodePath($folder), $entry, $key ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Retrieving annotation %s[%s] on folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $entry, $key, $this->_getBaseMbox() . $folder, imap_last_error() ) ); } return $result[$key]; } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { list($entry, $key) = $this->_getAnnotateMoreEntry($annotation); $result = imap_setannotation( $this->getBackend(), $this->encodePath($folder), $entry, $key, $value ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Setting annotation %s[%s] on folder %s to %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $entry, $key, $this->_getBaseMbox() . $folder, $value, imap_last_error() ) ); } } /** * Opens the given folder. * * @param string $folder The folder to open * * @return NULL */ public function select($folder) { $selection = $this->_getBaseMbox() . $this->encodePath($folder); if ($this->_selected != $selection) { $result = imap_reopen($this->getBackend(), $selection); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed opening folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s" ), $this->_getBaseMbox() . $folder, imap_last_error() ) ); } } } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { $this->select($folder); $status = imap_status_current($this->getBackend(), SA_MESSAGES | SA_UIDVALIDITY | SA_UIDNEXT); if (!$status) { /** * @todo: The cclient method seems pretty much unable to detect * missing folders. It always returns "true" */ throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed retrieving status information for folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox() . $folder, imap_last_error() ) ); } return array( 'uidvalidity' => $status->uidvalidity, 'uidnext' => $status->uidnext ); } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { $this->select($folder); $uids = imap_search($this->getBackend(), 'UNDELETED', SE_UID); /** * @todo Error recognition? Nada... :( */ if (!is_array($uids)) { $uids = array(); } return $uids; } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { $this->select($folder); $headers = @imap_fetchheader($this->getBackend(), $uid, FT_UID | FT_PREFETCHTEXT); $body = @imap_body($this->getBackend(), $uid, FT_UID); if ($headers && $body) { return array( Horde_Mime_Headers::parseHeaders($headers), Horde_Mime_Part::parseMessage($body) ); } else { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed fetching message %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $uid, $this->_getBaseMbox() . $folder, imap_last_error() ) ); } } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { $result = array(); $this->select($folder); foreach ($uids as $uid) { $structure = @imap_fetchstructure($this->getBackend(), $uid, FT_UID); if ($structure) { $ob = $this->_parseStructure($structure); $ob->buildMimeIds(); $result[$uid]['structure'] = $ob; } else { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed fetching structure information for messages %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s" ), join(',', $uids), $this->_getBaseMbox() . $folder, imap_last_error() ) ); } } return $result; } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { $this->select($folder); $result = @imap_fetchbody($this->getBackend(), $uid, $id, FT_UID); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed fetching body part %s for message %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $id, $uid, $this->_getBaseMbox() . $folder, imap_last_error() ) ); } return $result; } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { rewind($msg); $result = @imap_append( $this->getBackend(), $this->_getBaseMbox() . $this->encodePath($folder), stream_get_contents($msg) ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed appending new message to folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $this->_getBaseMbox() . $folder, imap_last_error() ) ); } return $result; } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { $this->select($folder); foreach ($uids as $uid) { $result = @imap_delete( $this->getBackend(), $uid, FT_UID ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed deleting message %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s" ), $uid, $folder, imap_last_error() ) ); } } } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { $this->select($old_folder); $result = @imap_mail_move( $this->getBackend(), $uid, $this->encodePath($new_folder), CP_UID ); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed moving message %s from folder %s to folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $uid, $old_folder, $new_folder, imap_last_error() ) ); } } /** * Expunges messages in the current folder. * * @param string $folder The folder to append the message(s) to. Either * in UTF7-IMAP or UTF-8. * * @return mixed True or a PEAR error in case of an error. */ public function expunge($folder) { $this->select($folder); $result = @imap_expunge($this->getBackend()); if (!$result) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed expunging folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, imap_last_error() ) ); } } /** * Parse the output from imap_fetchstructure() into a MIME Part object. * * @param object $data Data from imap_fetchstructure(). * * @return Horde_Mime_Part A MIME Part object. */ protected function _parseStructure($data) { $ob = new Horde_Mime_Part(); $ob->setType($this->_mimeTypes[$data->type] . '/' . ($data->ifsubtype ? strtolower($data->subtype) : Horde_Mime_Part::UNKNOWN)); // Optional for multipart-parts, required for all others if ($data->ifparameters) { $params = array(); foreach ($data->parameters as $val) { $params[$val->attribute] = $val->value; } $params = Horde_Mime::decodeParam('content-type', $params); foreach ($params['params'] as $key => $val) { $ob->setContentTypeParameter($key, $val); } } // Optional entries. 'location' and 'language' not supported if ($data->ifdisposition) { $ob->setDisposition($data->disposition); if ($data->ifdparameters) { $dparams = array(); foreach ($data->dparameters as $val) { $dparams[$val->attribute] = $val->value; } $dparams = Horde_Mime::decodeParam('content-disposition', $dparams); foreach ($dparams['params'] as $key => $val) { $ob->setDispositionParameter($key, $val); } } } if ($ob->getPrimaryType() == 'multipart') { // multipart/* specific entries foreach ($data->parts as $val) { $ob->addPart($this->_parseStructure($val)); } } else { // Required options if ($data->ifid) { $ob->setContentId($data->id); } if ($data->ifdescription) { $ob->setDescription(Horde_Mime::decode($data->description)); } $ob->setTransferEncoding($this->_mimeEncodings[$data->encoding]); $ob->setBytes($data->bytes); if ($ob->getType() == 'message/rfc822') { $ob->addPart($this->_parseStructure(reset($data->parts))); } } return $ob; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Imap.php0000664000175000017500000004743412207101545022565 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The IMAP driver class for accessing Kolab storage. * * Copyright 2009-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Imap extends Horde_Kolab_Storage_Driver_Base { /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { $config = $this->getParams(); $config['hostspec'] = $config['host']; unset($config['host']); if (isset($config['debug']) && $config['debug'] == 'STDOUT') { $config['debug'] = STDOUT; } return new Horde_Imap_Client_Socket($config); } /** * Retrieves a list of folders from the server. * * @return array The list of folders. */ public function listFolders() { try { return $this->getBackend()->listMailboxes( '*', Horde_Imap_Client::MBOX_ALL, array('flat' => true)); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { try { return $this->getBackend()->createMailbox($folder); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { try { $this->getBackend()->deleteMailbox($folder); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { try { $this->getBackend()->renameMailbox($old, $new); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { try { $this->getBackend()->login(); return $this->getBackend()->queryCapability('ACL'); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Retrieve the access rights for a folder. * * @param Horde_Kolab_Storage_Folder $folder The folder to retrieve the ACL for. * * @return An array of rights. */ public function getAcl($folder) { try { $acl = $this->getBackend()->getACL($folder); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } $result = array(); foreach ($acl as $user => $rights) { $result[$user] = strval($rights); } return $result; } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { try { return strval($this->getBackend()->getMyACLRights($folder)); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { try { $this->getBackend()->setACL($folder, $user, array('rights' => $acl)); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { try { $this->getBackend()->deleteACL($folder, $user); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { try { $result = $this->getBackend()->getMetadata('*', $annotation); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } $data = array(); foreach ($result as $folder => $annotations) { if (isset($annotations[$annotation])) { $data[$folder] = $annotations[$annotation]; } } return $data; } /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation) { try { $this->getBackend()->login(); $result = $this->getBackend()->getMetadata($folder, $annotation); } catch (Exception $e) { return ''; } return isset($result[$folder][$annotation]) ? $result[$folder][$annotation] : ''; } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { try { $this->getBackend()->login(); return $this->getBackend()->setMetadata( $folder, array($annotation => $value) ); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->_namespace !== null) { return parent::getNamespace(); } try { $this->getBackend()->login(); if ($this->getBackend()->queryCapability('NAMESPACE') === true) { $c = array(); $configuration = $this->getParam('namespaces', array()); foreach ($this->getBackend()->getNamespaces() as $namespace) { if (in_array($namespace['name'], array_keys($configuration))) { $namespace = array_merge($namespace, $configuration[$namespace['name']]); } switch ($namespace['type']) { case Horde_Imap_Client::NS_PERSONAL: $namespace['type'] = Horde_Kolab_Storage_Folder_Namespace::PERSONAL; break; case Horde_Imap_Client::NS_OTHER: $namespace['type'] = Horde_Kolab_Storage_Folder_Namespace::OTHER; break; case Horde_Imap_Client::NS_SHARED: $namespace['type'] = Horde_Kolab_Storage_Folder_Namespace::SHARED; break; } $c[] = $namespace; } $this->_namespace = $this->getFactory()->createNamespace('imap', $this->getAuth(), $c); } } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } return parent::getNamespace(); } /** * Opens the given folder. * * @param string $folder The folder to open * * @return NULL */ public function select($folder, $mode = Horde_Imap_Client::OPEN_AUTO) { try { $this->getBackend()->openMailbox($folder, $mode); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { // @todo: Condstore try { return $this->getBackend()->status( $folder, Horde_Imap_Client::STATUS_UIDNEXT | Horde_Imap_Client::STATUS_UIDVALIDITY | Horde_Imap_Client::STATUS_FORCE_REFRESH ); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { $search_query = new Horde_Imap_Client_Search_Query(); $search_query->flag('DELETED', false); try { $uidsearch = $this->getBackend()->search($folder, $search_query); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } $uids = $uidsearch['match']; return $uids->ids; } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { $query = new Horde_Imap_Client_Fetch_Query(); $query->fullText(); try { $ret = $this->getBackend()->fetch( $folder, $query, array('ids' => new Horde_Imap_Client_Ids($uid)) ); if (!isset($ret[$uid])) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed fetching message %s in folder %s." ), $uid, $folder ) ); } $msg = $ret[$uid]->getFullMsg(); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } return array( Horde_Mime_Headers::parseHeaders($msg), Horde_Mime_Part::parseMessage($msg) ); } /** * Retrieves the message headers. * * @param string $folder The folder to fetch the message from. * @param array $uid The message UID. * * @return Horde_Mime_Headers The message headers. */ public function fetchHeaders($folder, $uid) { $query = new Horde_Imap_Client_Fetch_Query(); $query->headerText(); try { $ret = $this->getBackend()->fetch( $folder, $query, array('ids' => new Horde_Imap_Client_Ids($uid)) ); $msg = $ret[$uid]->getHeaderText(); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } return Horde_Mime_Headers::parseHeaders($msg); } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { if (empty($uids)) { return array(); } $query = new Horde_Imap_Client_Fetch_Query(); $query->structure(); try { $ret = $this->getBackend()->fetch( $folder, $query, array('ids' => new Horde_Imap_Client_Ids($uids)) ); $out = array(); foreach ($ret as $key => $result) { $out[$key]['structure'] = $result->getStructure(); } } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } return $out; } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { $query = new Horde_Imap_Client_Fetch_Query(); $query->bodyPart($id); try { $ret = $this->getBackend()->fetch( $folder, $query, array('ids' => new Horde_Imap_Client_Ids($uid)) ); return $ret[$uid]->getBodyPart($id, true); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { try { $result = $this->getBackend() ->append($folder, array(array('data' => $msg))); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } return $result->ids[0]; } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { try { return $this->getBackend()->store($folder, array( 'add' => array('\\deleted'), 'ids' => new Horde_Imap_Client_Ids($uids) )); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { $options = array('ids' => new Horde_Imap_Client_Ids($uid), 'move' => true); try { return $this->getBackend() ->copy($old_folder, $new_folder, $options); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } /** * Expunges messages in the current folder. * * @param string $folder The folder to expunge. * * @return NULL */ public function expunge($folder) { try { return $this->getBackend()->expunge($folder); } catch (Horde_Imap_Client_Exception_ServerResponse $e) { throw new Horde_Kolab_Storage_Exception($e->details); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Kolab_Storage_Exception($e); } } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Mock.php0000664000175000017500000005043612207101545022564 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * An Kolab storage mock driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Mock extends Horde_Kolab_Storage_Driver_Base { /** * The data of the folders. * * @var Horde_Kolab_Storage_Driver_Mock_Data */ private $_data; /** * The regular expression for converting folder names. * * @var string */ private $_conversion_pattern; /** * The data of the folder currently opened * * @var array */ private $_mbox = null; /** * The name of the folder currently opened * * @var array */ private $_mboxname = null; /** * A list of groups (associates users [key] with an array of group names * [value]). * * @var array */ private $_groups = array(); /** * Constructor. * * @param Horde_Kolab_Storage_Factory $factory A factory for helper objects. * @param array $params Connection parameters. */ public function __construct(Horde_Kolab_Storage_Factory $factory, $params = array()) { if (isset($params['data'])) { if (is_array($params['data'])) { $params['data'] = new Horde_Kolab_Storage_Driver_Mock_Data( $params['data'] ); } $this->_data = $params['data']; unset($params['data']); } else { $this->_data = new Horde_Kolab_Storage_Driver_Mock_Data(array()); } parent::__construct($factory, $params); } /** * Convert the external folder id to an internal folder name. * * @param string $folder The external folder name. * * @return string The internal folder id. */ private function _convertToInternal($folder) { if (substr($folder, 0, 5) == 'INBOX') { $user = explode('@', $this->getAuth()); return 'user/' . $user[0] . substr($folder, 5); } return $folder; } /** * Convert the internal folder name into an external folder id. * * @param string $mbox The internal folder name. * * @return string The external folder id. */ private function _convertToExternal($mbox) { if ($this->_conversion_pattern === null) { if ($this->getAuth() != '') { $user = explode('@', $this->getAuth()); $this->_conversion_pattern = '#^user/' . $user[0] . '#'; } else { /** * @todo: FIXME, this is a hack for the current state of the * Kolab share driver which does not yet know how to properly * deal with system shares. */ if ($mbox == 'user/') { return 'INBOX'; } else { return preg_replace('#^user//#', 'INBOX/', $mbox); } } } return preg_replace($this->_conversion_pattern, 'INBOX', $mbox); } /** * Set a group list. * * @param array $groups A list of groups. User names are the keys, an array * of group names are the values. * * @return NULL */ public function setGroups($groups) { $this->_groups = $groups; } /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { } /** * Return the unique connection id. * * @return string The connection id. */ public function getId() { return $this->getAuth() . '@mock:0'; } /** * Retrieves a list of folders on the server. * * @return array The list of folders. */ public function listFolders() { $result = array(); foreach ($this->_data->arrayKeys() as $mbox) { if ($this->_folderVisible($mbox, $this->getAuth())) { $result[] = $this->_convertToExternal($mbox); } } return $result; } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { $folder = $this->_convertToInternal($folder); if (isset($this->_data[$folder])) { throw new Horde_Kolab_Storage_Exception( sprintf("IMAP folder %s does already exist!", $folder) ); } $this->_data[$folder] = array( 'status' => array( 'uidvalidity' => time(), 'uidnext' => 1 ), 'mails' => array(), 'permissions' => array($this->getAuth() => 'lrswipkxtecda'), 'annotations' => array(), ); } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { $folder = $this->_convertToInternal($folder); if (!isset($this->_data[$folder])) { throw new Horde_Kolab_Storage_Exception( sprintf("IMAP folder %s does not exist!", $folder) ); } unset($this->_data[$folder]); } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { $old = $this->_convertToInternal($old); $new = $this->_convertToInternal($new); if (!isset($this->_data[$old])) { throw new Horde_Kolab_Storage_Exception( sprintf("IMAP folder %s does not exist!", $old) ); } if (isset($this->_data[$new])) { throw new Horde_Kolab_Storage_Exception( sprintf("IMAP folder %s does already exist!", $new) ); } $this->_data[$new] = $this->_data[$old]; unset($this->_data[$old]); } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { return true; } /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { $folder = $this->_convertToInternal($folder); $this->_failOnMissingFolder($folder); $this->_failOnNoAdmin($folder); if ($this->_data->hasPermissions($folder)) { return $this->_data->getPermissions($folder); } return array(); } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { $folder = $this->_convertToInternal($folder); $this->_failOnMissingFolder($folder); $myacl = array(); $users = array($this->getAuth(), 'anyone', 'anonymous'); if (isset($this->_groups[$this->getAuth()])) { foreach ($this->_groups[$this->getAuth()] as $group) { $users[] = 'group:' . $group; } } foreach ($users as $user) { if ($this->_data->hasUserPermissions($folder, $user)) { $myacl = array_merge($myacl, str_split($this->_data->getUserPermissions($folder, $user))); } } return join('', $myacl); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $folder = $this->_convertToInternal($folder); $this->_failOnMissingFolder($folder); $this->_failOnNoAdmin($folder); $this->_data->setUserPermissions($folder, $user, $acl); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $folder = $this->_convertToInternal($folder); $this->_failOnMissingFolder($folder); $this->_failOnNoAdmin($folder); if ($this->_data->hasUserPermissions($folder, $user)) { $this->_data->deleteUserPermissions($folder, $user); } } /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { $result = array(); foreach ($this->_data->arrayKeys() as $folder) { if ($this->_folderVisible($folder, $this->getAuth())) { if ($this->_data->hasAnnotation($folder, $annotation)) { $result[$this->_convertToExternal($folder)] = $this->_data->getAnnotation($folder, $annotation); } } } return $result; } /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation) { $folder = $this->_convertToInternal($folder); $this->_failOnMissingFolder($folder); if ($this->_data->hasAnnotation($folder, $annotation)) { return $this->_data->getAnnotation($folder, $annotation); } return ''; } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { $folder = $this->_convertToInternal($folder); $this->_failOnMissingFolder($folder); $this->_data->setAnnotation($folder, $annotation, $value); } /** * Error out in case the provided folder is missing. * * @param string $folder The folder. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case the folder is missing. */ private function _failOnMissingFolder($folder) { if (!isset($this->_data[$folder]) || !$this->_folderVisible($folder, $this->getAuth())) { $this->_folderMissing($folder); } } /** * Is the folder visible to the specified user (or a global group)? * * @param string $folder The folder. * @param string $user The user. * * @return boolean True if the folder is visible. */ private function _folderVisible($folder, $user) { return empty($user) || $this->_folderVisibleToUnique($folder, $user) || $this->_folderVisibleToGroup($folder, $user) || $this->_folderVisibleToUnique($folder, 'anyone') || $this->_folderVisibleToUnique($folder, 'anonymous'); } /** * Is the folder visible to a group the user belongs to? * * @param string $folder The folder. * @param string $user The user. * * @return boolean True if the folder is visible. */ private function _folderVisibleToGroup($folder, $user) { if (isset($this->_groups[$user])) { foreach ($this->_groups[$user] as $group) { if ($this->_folderVisibleToUnique($folder, 'group:' . $group)) { return true; } } } return false; } /** * Is the folder visible to exactly the specified user? * * @param string $folder The folder. * @param string $user The user. * * @return boolean True if the folder is visible. */ private function _folderVisibleToUnique($folder, $user) { if ($this->_data->hasUserPermissions($folder, $user)) { if (strpos($this->_data->getUserPermissions($folder, $user), 'l') !== false || strpos($this->_data->getUserPermissions($folder, $user), 'r') !== false || strpos($this->_data->getUserPermissions($folder, $user), 'a') !== false) { return true; } } return false; } /** * Error out indicating that the user does not have the required * permissions. * * @param string $folder The folder. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case the folder is missing. */ private function _folderMissing($folder) { throw new Horde_Kolab_Storage_Exception( sprintf('The folder %s does not exist!', $folder) ); } /** * Error out in case the user is no admin of the specified folder. * * @param string $folder The folder. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case the user has no admin rights. */ private function _failOnNoAdmin($folder) { if (!isset($this->_data[$folder]) || !$this->_folderAdmin($folder, $this->getAuth())) { $this->_permissionDenied(); } } /** * Is the user a folder admin (or one of the global groups)? * * @param string $folder The folder. * @param string $user The user. * * @return boolean True if the user has admin rights on the folder. */ private function _folderAdmin($folder, $user) { return empty($user) || $this->_folderAdminForUnique($folder, $user) || $this->_folderAdminForGroup($folder, $user) || $this->_folderAdminForUnique($folder, 'anyone') || $this->_folderAdminForUnique($folder, 'anonymous'); } /** * Is the folder visible to a group the user belongs to? * * @param string $folder The folder. * @param string $user The user. * * @return boolean True if the folder is visible. */ private function _folderAdminForGroup($folder, $user) { if (isset($this->_groups[$user])) { foreach ($this->_groups[$user] as $group) { if ($this->_folderAdminForUnique($folder, 'group:' . $group)) { return true; } } } return false; } /** * Is the exact specified user an admin for the folder? * * @param string $folder The folder. * @param string $user The user. * * @return boolean True if the user has admin rights on the folder. */ private function _folderAdminForUnique($folder, $user) { if ($this->_data->hasUserPermissions($folder, $user) && strpos($this->_data->getUserPermissions($folder, $user), 'a') !== false) { return true; } return false; } /** * Error out indicating that the user does not have the required * permissions. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case the folder is missing. */ private function _permissionDenied() { throw new Horde_Kolab_Storage_Exception('Permission denied!'); } /** * Opens the given folder. * * @param string $folder The folder to open * * @return NULL */ public function select($folder) { $this->_data->select($this->_convertToInternal($folder)); } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { return $this->_data->status($this->_convertToInternal($folder)); } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { return $this->_data->getUids($this->_convertToInternal($folder)); } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { return $this->_data->fetchStructure( $this->_convertToInternal($folder), $uids ); } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { return $this->_data->fetchComplete( $this->_convertToInternal($folder), $uid ); } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { return $this->_data->fetchBodypart( $this->_convertToInternal($folder), $uid, $id ); } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { return $this->_data->appendMessage( $this->_convertToInternal($folder), $msg ); } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { $this->_data->deleteMessages( $this->_convertToInternal($folder), $uids ); } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { $this->_data->moveMessage( $uid, $this->_convertToInternal($old_folder), $this->_convertToInternal($new_folder) ); } /** * Expunges messages in the current folder. * * @param string $folder The folder to expunge. * * @return NULL */ public function expunge($folder) { $this->_data->expunge($this->_convertToInternal($folder)); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Pear.php0000664000175000017500000004017512207101545022561 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * An PEAR-Net_Imap based Kolab storage driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Pear extends Horde_Kolab_Storage_Driver_Base { /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { $config = $this->getParams(); if (isset($config['secure']) && $config['secure'] == 'ssl') { $prefix = 'ssl://'; } else { $prefix = ''; } $client = new Net_IMAP( $prefix . $config['host'], $config['port'], isset($config['secure']) && $config['secure'] == 'tls' ); $client->_useUTF_7 = false; if (isset($config['debug'])) { if ($config['debug'] == 'STDOUT') { $client->setDebug(true); } else { throw new Horde_Kolab_Storage_Exception('This driver does not support debug logging into a file.'); } } Horde_Kolab_Storage_Exception_Pear::catchError( $client->login($config['username'], $config['password'], true, false) ); return $client; } /** * Retrieves a list of folders on the server. * * @return array The list of folders. */ public function listFolders() { $list = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getMailboxes() ); return $this->decodeList($list); } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->createMailbox($this->encodePath($folder)) ); } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->deleteMailbox($this->encodePath($folder)) ); } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->renameMailbox( $this->encodePath($old), $this->encodePath($new) ) ); } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { return $this->getBackend()->hasCapability('ACL'); } /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { $result = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getACL($this->encodePath($folder)) ); $acl = array(); foreach ($result as $user) { $acl[$user['USER']] = $user['RIGHTS']; } return $acl; } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { return Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getMyRights($this->encodePath($folder)) ); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->setACL($this->encodePath($folder), $user, $acl) ); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->deleteACL($this->encodePath($folder), $user) ); } /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { list($entry, $value) = $this->_getAnnotateMoreEntry($annotation); $list = array(); $result = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getAnnotation($entry, $value, '*') ); foreach ($result as $element) { if (isset($element['ATTRIBUTES'][$value])) { $list[$element['MAILBOX']] = $element['ATTRIBUTES'][$value]; } } return $this->decodeListKeys($list); } /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation) { list($entry, $type) = $this->_getAnnotateMoreEntry($annotation); $result = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getAnnotation( $entry, $type, $this->encodePath($folder) ) );var_dump($result); foreach ($result as $element) { if (isset($element['ATTRIBUTES'][$type])) { return $element['ATTRIBUTES'][$type]; } } return ''; } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { list($entry, $type) = $this->_getAnnotateMoreEntry($annotation); Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->setAnnotation( $entry, array($type => $value), $this->encodePath($folder) ) ); } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->getBackend()->hasCapability('NAMESPACE') === true) { $namespaces = array(); foreach ($this->getBackend()->getNamespace() as $type => $elements) { foreach ($elements as $namespace) { switch ($type) { case 'others': $namespace['type'] = 'other'; break; default: $namespace['type'] = $type; break; } $namespace['delimiter'] = $namespace['delimter']; $namespaces[] = $namespace; } } return new Horde_Kolab_Storage_Folder_Namespace_Imap( $this->getAuth(), $namespaces, $this->getParam('namespaces', array()) ); } return parent::getNamespace(); } /** * Opens the given folder. * * @param string $folder The folder to open * * @return NULL */ public function select($folder) { Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->selectMailbox($this->encodePath($folder)) ); } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { $result = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getStatus($this->encodePath($folder)) ); return array( 'uidvalidity' => $result['UIDVALIDITY'], 'uidnext' => $result['UIDNEXT'] ); } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { $this->select($folder); $uids = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->search('UNDELETED', true) ); if (!is_array($uids)) { $uids = array(); } return $uids; } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { $this->select($folder); return array( Horde_Mime_Headers::parseHeaders( Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getRawHeaders($uid, '', true) ) ), Horde_Mime_Part::parseMessage( Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getBody($uid, true) ) ) ); } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { $result = array(); $this->select($folder); foreach ($uids as $uid) { $structure = Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getStructure($uid, true) ); $ob = $this->_parseStructure($structure); $ob->buildMimeIds(); $result[$uid]['structure'] = $ob; } return $result; } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { $this->select($folder); return Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->getBodyPart($uid, $id, true) ); } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { rewind($msg); $this->select($folder); return Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->appendMessage(stream_get_contents($msg)) ); } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { $this->select($folder); return Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->deleteMessages($uids, true) ); } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { $this->select($old_folder); Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->copyMessage($uid, $new_folder) ); $this->deleteMessages($old_folder, array($uid)); $this->expunge($old_folder); } /** * Expunges messages in the current folder. * * @return mixed True or a PEAR error in case of an error. */ public function expunge($folder) { $this->select($folder); return Horde_Kolab_Storage_Exception_Pear::catchError( $this->getBackend()->expunge() ); } /** * Parse the output from imap_fetchstructure() into a MIME Part object. * * @param object $data Data from imap_fetchstructure(). * * @return Horde_Mime_Part A MIME Part object. */ protected function _parseStructure($data) { $ob = new Horde_Mime_Part(); $ob->setType(strtolower($data->type) . '/' . strtolower($data->subType)); // Optional for multipart-parts, required for all others if (isset($data->parameters)) { $params = array(); foreach ($data->parameters as $key => $value) { $params[strtolower($key)] = $value; } $params = Horde_Mime::decodeParam('content-type', $params); foreach ($params['params'] as $key => $value) { $ob->setContentTypeParameter($key, $value); } } // Optional entries. 'location' and 'language' not supported if (isset($data->disposition)) { $ob->setDisposition($data->disposition); if (isset($data->dparameters)) { $dparams = array(); foreach ($data->dparameters as $key => $value) { $dparams[strtolower($key)] = $value; } $dparams = Horde_Mime::decodeParam('content-disposition', $dparams); foreach ($dparams['params'] as $key => $value) { $ob->setDispositionParameter($key, $value); } } } if ($ob->getPrimaryType() == 'multipart') { // multipart/* specific entries foreach ($data->subParts as $val) { $ob->addPart($this->_parseStructure($val)); } } else { // Required options if (isset($data->partID)) { $ob->setContentId($data->partID); } $ob->setTransferEncoding(strtolower($data->encoding)); $ob->setBytes($data->bytes); if ($ob->getType() == 'message/rfc822') { $ob->addPart($this->_parseStructure(reset($data->subParts))); } } return $ob; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver/Rcube.php0000664000175000017500000006660712207101545022742 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A Roundcube Imap based Kolab storage driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Driver_Rcube extends Horde_Kolab_Storage_Driver_Base { /** * Debug log * * @var resource */ private $_debug_log; /** * Write a line of debugging output to the log. * * @return NULL */ public function debugLog($driver, $message) { fwrite($this->_debug_log, $message . "\n"); } /** * Destructor. */ public function __destruct() { if (is_resource($this->_debug_log)) { fflush($this->_debug_log); fclose($this->_debug_log); $this->_debug_log = null; } } /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { $config = $this->getParams(); $client = new rcube_imap_generic(); if (isset($config['debug'])) { if ($config['debug'] == 'STDOUT') { $client->setDebug(true); } else { $this->_debug_log = fopen($config['debug'], 'a'); $client->setDebug(true, array($this, 'debugLog')); } } $client->connect( $config['host'], $config['username'], $config['password'], array( 'ssl_mode' => $config['secure'], 'port' => $config['port'], 'timeout' => 0, 'force_caps' => false, ) ); return $client; } /** * Retrieves a list of folders on the server. * * @return array The list of folders. */ public function listFolders() { return $this->decodeList($this->getBackend()->listMailboxes('', '*')); } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { $this->getBackend()->createFolder($this->encodePath($folder)); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Creating folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { $this->getBackend()->deleteFolder($this->encodePath($folder)); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Deleting folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { $this->getBackend()->renameFolder( $this->encodePath($old), $this->encodePath($new) ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Renaming folder %s to %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $old, $new, $this->getBackend()->error ) ); } } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { return $this->getBackend()->getCapability('ACL'); } /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { $acl = $this->getBackend()->getACL($this->encodePath($folder)); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed reading ACL on folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } $result = array(); foreach ($acl as $user => $rights) { $result[$user] = join('', $rights); } return $result; } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { $result = $this->getBackend()->myRights($this->encodePath($folder)); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed reading user rights on folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } return join('', $result); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $this->getBackend()->setACL($this->encodePath($folder), $user, $acl); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed setting ACL on folder %s for user %s to %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $user, $acl, $this->getBackend()->error ) ); } } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->getBackend()->deleteACL($this->encodePath($folder), $user); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed deleting ACL on folder %s for user %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $user, $this->getBackend()->error ) ); } } /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { list($entry, $value) = $this->_getAnnotateMoreEntry($annotation); $result = $this->getBackend()->getAnnotation('*', $entry, $value); if (empty($result)) { return array(); } $data = array(); foreach ($result as $folder => $annotations) { if (isset($annotations[$annotation])) { $data[$folder] = $annotations[$annotation]; } } return $this->decodeListKeys($data); } /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation) { list($attr, $type) = $this->_getAnnotateMoreEntry($annotation); $result = $this->getBackend()->getAnnotation( $this->encodePath($folder), $attr, $type ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Setting annotation %s[%s] on folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $attr, $type, $folder, $this->getBackend()->error ) ); } return $result[$folder][$annotation]; } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { list($attr, $type) = $this->_getAnnotateMoreEntry($annotation); $this->getBackend()->setAnnotation( $this->encodePath($folder), array(array($attr, $type, $value)) ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Setting annotation %s[%s] on folder %s to %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $attr, $type, $folder, $value, $this->getBackend()->error ) ); } } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { if ($this->getBackend()->getCapability('NAMESPACE') === true) { $namespaces = array(); foreach ($this->getBackend()->getNamespace() as $type => $elements) { if (is_array($elements)) { foreach ($elements as $namespace) { $namespace['name'] = $namespace[0]; $namespace['delimiter'] = $namespace[1]; $namespace['type'] = $type; $namespaces[] = $namespace; } } } $this->_namespace = $this->getFactory()->createNamespace('imap', $this->getAuth(), $namespaces); } return parent::getNamespace(); } /** * Opens the given folder. * * @param string $folder The folder to open * * @return NULL */ public function select($folder) { $this->getBackend()->select($this->encodePath($folder)); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Selecting folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { $result = $this->getBackend()->status( $this->encodePath($folder), array('UIDVALIDITY', 'UIDNEXT') ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Retrieving the status for folder %s failed." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } return array( 'uidvalidity' => $result['UIDVALIDITY'], 'uidnext' => $result['UIDNEXT'] ); } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { $uids = $this->getBackend()->search( $this->encodePath($folder), 'UNDELETED', true ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed retrieving UIDs for folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } if (!is_array($uids)) { $uids = array(); } return $uids; } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { $msg = $this->getBackend()->handlePartBody( $this->encodePath($folder), $uid, true, '', null, false ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed fetching message %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $uid, $folder, $this->getBackend()->error ) ); } return array( Horde_Mime_Headers::parseHeaders($msg), Horde_Mime_Part::parseMessage( Horde_Mime_Part::getRawPartText($msg, 'body', 0) ) ); } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { $result = array(); foreach ($uids as $uid) { $structure = $this->getBackend()->tokenizeResponse( $this->getBackend()->fetchStructureString( $this->encodePath($folder), $uid, true ) ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed retrieving structure of message %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s" ), $uid, $folder, $this->getBackend()->error ) ); } $ob = $this->_parseStructure($structure[0]); $ob->buildMimeIds(); $result[$uid]['structure'] = $ob; } return $result; } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { $resource = fopen('php://temp', 'r+'); $this->getBackend()->handlePartBody( $this->encodePath($folder), $uid, true, $id, null, false, $resource ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed fetching body part %s for message %s in folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $id, $uid, $folder, $this->getBackend()->error ) ); } return $resource; } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { rewind($msg); $this->getBackend()->append( $this->encodePath($folder), stream_get_contents($msg) ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed appending new message to folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } return true; } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { $this->getBackend()->delete( $this->encodePath($folder), $uids ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed deleting messages from folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { $this->getBackend()->move( $uid, $this->encodePath($old_folder), $this->encodePath($new_folder) ); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed moving message %s from folder %s to folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $uid, $old_folder, $new_folder, $this->getBackend()->error ) ); } $this->expunge($old_folder); } /** * Expunges messages in the current folder. * * @return mixed True or a PEAR error in case of an error. */ public function expunge($folder) { $this->getBackend()->expunge($this->encodePath($folder)); if ($this->getBackend()->errornum != 0) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( "Failed expunging folder %s." ) . ' ' . Horde_Kolab_Storage_Translation::t("Error: %s"), $folder, $this->getBackend()->error ) ); } } /** * Parse the output from imap_fetchstructure() into a MIME Part object. * * @param object $data Data from imap_fetchstructure(). * * @return Horde_Mime_Part A MIME Part object. */ /** * Recursively parse BODYSTRUCTURE data from a FETCH return (see * RFC 3501 [7.4.2]). * * @param array $data The tokenized information from the server. * * @return array The array of bodystructure information. */ protected function _parseStructure($data) { $ob = new Horde_Mime_Part(); // If index 0 is an array, this is a multipart part. if (is_array($data[0])) { // Keep going through array values until we find a non-array. for ($i = 0, $cnt = count($data); $i < $cnt; ++$i) { if (!is_array($data[$i])) { break; } $ob->addPart($this->_parseStructure($data[$i])); } // The first string entry after an array entry gives us the // subpart type. $ob->setType('multipart/' . $data[$i]); // After the subtype is further extension information. This // information MAY not appear for BODYSTRUCTURE requests. // This is parameter information. if (isset($data[++$i]) && is_array($data[$i])) { foreach ($this->_parseStructureParams($data[$i], 'content-type') as $key => $val) { $ob->setContentTypeParameter($key, $val); } } // This is disposition information. if (isset($data[++$i]) && is_array($data[$i])) { $ob->setDisposition($data[$i][0]); foreach ($this->_parseStructureParams($data[$i][1], 'content-disposition') as $key => $val) { $ob->setDispositionParameter($key, $val); } } // This is language information. It is either a single value or // a list of values. if (isset($data[++$i])) { $ob->setLanguage($data[$i]); } // Ignore: location (RFC 2557) // There can be further information returned in the future, but // for now we are done. } else { $ob->setType($data[0] . '/' . $data[1]); foreach ($this->_parseStructureParams($data[2], 'content-type') as $key => $val) { $ob->setContentTypeParameter($key, $val); } if ($data[3] !== null) { $ob->setContentId($data[3]); } if ($data[4] !== null) { $ob->setDescription(Horde_Mime::decode($data[4])); } if ($data[5] !== null) { $ob->setTransferEncoding($data[5]); } if ($data[6] !== null) { $ob->setBytes($data[6]); } // If the type is 'message/rfc822' or 'text/*', several extra // fields are included switch ($ob->getPrimaryType()) { case 'message': if ($ob->getSubType() == 'rfc822') { // Ignore: envelope $ob->addPart($this->_parseStructure($data[8])); // Ignore: lines $i = 10; } else { $i = 7; } break; case 'text': // Ignore: lines $i = 8; break; default: $i = 7; break; } // After the subtype is further extension information. This // information MAY appear for BODYSTRUCTURE requests. // Ignore: MD5 // This is disposition information if (isset($data[++$i]) && is_array($data[$i])) { $ob->setDisposition($data[$i][0]); foreach ($this->_parseStructureParams($data[$i][1], 'content-disposition') as $key => $val) { $ob->setDispositionParameter($key, $val); } } // This is language information. It is either a single value or // a list of values. if (isset($data[++$i])) { $ob->setLanguage($data[$i]); } // Ignore: location (RFC 2557) } return $ob; } /** * Helper function to parse a parameters-like tokenized array. * * @param array $data The tokenized data. * @param string $type The header name. * * @return array The parameter array. */ protected function _parseStructureParams($data, $type) { $params = array(); if (is_array($data)) { for ($i = 0, $cnt = count($data); $i < $cnt; ++$i) { $params[strtolower($data[$i])] = $data[++$i]; } } $ret = Horde_Mime::decodeParam($type, $params); return $ret['params']; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Exception/Pear.php0000664000175000017500000000251412207101545023257 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * This class converts PEAR errors into exceptions for the Kolab_Storage * package. * * Copyright 2010-2013 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. * * @category Horde * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Exception_Pear extends Horde_Exception_Pear { /** * Exception handling. * * @param mixed $result The result to be checked for a PEAR_Error. * * @return mixed Returns the original result if it was no PEAR_Error. * * @throws Horde_Exception_Pear In case the result was a PEAR_Error. */ static public function catchError($result) { self::$_class = __CLASS__; return parent::catchError($result); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Element/Other.php0000664000175000017500000000572512207101545026222 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Element_Other:: class represents the * namespace for folders of other users. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Element_Other extends Horde_Kolab_Storage_Folder_Namespace_Element { /** * Return the type of this namespace (personal, other, or shared). * * @return string The type. */ public function getType() { return Horde_Kolab_Storage_Folder_Namespace::OTHER; } /** * Return the owner of a folder. * * @param string $name The name of the folder. * * @return string|boolean The owner of the folder. */ public function getOwner($name) { $path = explode($this->_delimiter, $name); $user = $path[1]; if (strpos($user, '@') === false) { $domain = strstr(array_pop($path), '@'); if (!empty($domain)) { $user .= $domain; } else { $domain = strstr($this->_user, '@'); if (!empty($domain)) { $user .= $domain; } } } return $user; } /** * Generate a folder path for the given subpath and owner. * * @param string $subpath The subpath of the folder. * @param string $owner The folder owner. * * @return string The name of the folder. */ public function generatePath($subpath, $owner) { if (strpos($owner, '@') !== false) { $local = strstr($owner, '@', true); } else { $local = $owner; } $start = join( array($this->_name, $local, $subpath), $this->_delimiter ); if (strstr($this->_user, '@') !== strstr($owner, '@')) { return $start . strstr($owner, '@'); } else { return $start; } } /** * Return an array describing the path elements of the folder. * * @param string $name The name of the folder. * * @return array The path elements. */ protected function _subpath($name) { $path = parent::_subpath($name); array_shift($path); return $path; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Element/Personal.php0000664000175000017500000000307212207101545026715 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Element_Personal:: class represents * the namespace for folders owned by the currently authenticated user. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Element_Personal extends Horde_Kolab_Storage_Folder_Namespace_Element { /** * Return the type of this namespace (personal, other, or shared). * * @return string The type. */ public function getType() { return Horde_Kolab_Storage_Folder_Namespace::PERSONAL; } /** * Return the owner of a folder. * * @param string $name The name of the folder. * * @return string|boolean The owner of the folder. */ public function getOwner($name) { return $this->_user; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Element/Shared.php0000664000175000017500000000271512207101545026343 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Element_Shared:: class represents * the shared namespace. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Element_Shared extends Horde_Kolab_Storage_Folder_Namespace_Element { /** * Return the type of this namespace (personal, other, or shared). * * @return string The type. */ public function getType() { return Horde_Kolab_Storage_Folder_Namespace::SHARED; } /** * Return the owner of a folder. * * @param string $name The name of the folder. * * @return string|boolean The owner of the folder. */ public function getOwner($name) { return false; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Element/SharedWithPrefix.php0000664000175000017500000000543212207101545030354 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Element_Shared:: class represents * the shared namespace and hides the prefix of that shared namespace. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Element_SharedWithPrefix extends Horde_Kolab_Storage_Folder_Namespace_Element_Shared { /** * The prefix to hide when referencing this namespace. * * @var string */ protected $_prefix; /** * Constructor. * * @param string $name The prefix identifying this namespace. * @param string $delimiter The delimiter used for this namespace. * @param string $user The current user. * @param string $prefix The prefix to hide. */ public function __construct($name, $delimiter, $user, $prefix) { parent::__construct($name, $delimiter, $user); $this->_prefix = $prefix; } /** * Return an array describing the path elements of the folder. * * @param string $name The name of the folder. * * @return array The path elements. */ protected function _subpath($name) { $path = parent::_subpath($name); if (!empty($path) && strpos($path[0], $this->_prefix) === 0) { $path[0] = substr($path[0], strlen($this->_prefix)); } return $path; } /** * Generate a folder path for the given path in this namespace. * * @param array $path The path of the folder. * * @return string The name of the folder. */ public function generateName($path) { return $this->_prefix . parent::generateName($path); } /** * Generate a folder path for the given subpath and owner. * * @param string $subpath The subpath of the folder. * @param string $owner The folder owner. * * @return string The name of the folder. */ public function generatePath($subpath, $owner) { return $this->_prefix . parent::generatePath($subpath, $owner); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Config.php0000664000175000017500000000614412207101545024751 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Config:: allows to configure the available * IMAP namespaces on the Kolab server. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Config extends Horde_Kolab_Storage_Folder_Namespace { /** * The namespace configuration. * * @var array */ protected $configuration; /** * Constructor. * * @param string $user The current user. * @param array $configuration The namespace configuration. */ public function __construct($user, array $configuration) { $this->user = $user; $this->configuration = $configuration; parent::__construct($this->_initializeData()); } /** * Initialize the namespace elements. * * @return array The namespace elements. */ private function _initializeData() { $namespace = array(); foreach ($this->configuration as $element) { if ($element['type'] == Horde_Kolab_Storage_Folder_Namespace::SHARED && isset($element['prefix'])) { $namespace_element = new Horde_Kolab_Storage_Folder_Namespace_Element_SharedWithPrefix( $element['name'], $element['delimiter'], $this->user, $element['prefix'] ); } else { $class = 'Horde_Kolab_Storage_Folder_Namespace_Element_' . ucfirst($element['type']); if (!class_exists($class)) { throw new Horde_Kolab_Storage_Exception( sprintf('Unkown namespace type "%s"', $element['type']) ); } $namespace_element = new $class($element['name'], $element['delimiter'], $this->user); } $namespaces[] = $namespace_element; } return $namespaces; } /** * Serialize this object. * * @return string The serialized data. */ public function serialize() { return serialize(array($this->user, $this->configuration)); } /** * Reconstruct the object from serialized data. * * @param string $data The serialized data. */ public function unserialize($data) { list($this->user, $this->configuration) = @unserialize($data); $this->initialize($this->_initializeData()); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Element.php0000664000175000017500000001230612207101545025132 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Element:: class represents a namespace type. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_Folder_Namespace_Element { /** * The prefix identifying this namespace. * * @var string */ protected $_name; /** * The delimiter used for this namespace. * * @var string */ protected $_delimiter; /** * The current user. * * @var string */ protected $_user; /** * Constructor. * * @param string $name The prefix identifying this namespace. * @param string $delimiter The delimiter used for this namespace. * @param string $user The current user. */ public function __construct($name, $delimiter, $user) { if (substr($name, -1) == $delimiter) { $name = substr($name, 0, -1); } $this->_name = $name; $this->_delimiter = $delimiter; $this->_user = $user; } /** * Return the type of this namespace (personal, other, or shared). * * @return string The type. */ abstract public function getType(); /** * Return the name of this namespace. * * @return string The name/prefix. */ public function getName() { return $this->_name; } /** * Return the delimiter for this namespace. * * @return string The delimiter. */ public function getDelimiter() { return $this->_delimiter; } /** * Does the folder name lie in this namespace? * * @param string $name The name of the folder. * * @return boolean True if the folder is element of this namespace. */ public function matches($name) { return (strpos($name, $this->_name) === 0); } /** * Return the owner of a folder. * * @param string $name The name of the folder. * * @return string|boolean The owner of the folder. */ abstract public function getOwner($name); /** * Return the title of a folder. * * @param string $name The name of the folder. * * @return string The title of the folder. */ public function getTitle($name) { $subpath = $this->_subpath($name); if (!empty($subpath)) { return array_pop($subpath); } else { return ''; } } /** * Get the sub path for the given folder name. * * @param string $name The folder name. * * @return string The sub path. */ public function getSubpath($name) { return join($this->_subpath($name), $this->_delimiter); } /** * Get the parent for the given folder name. * * @param string $name The parent folder name. * * @return string The parent. */ public function getParent($name) { $path = explode($this->_delimiter, $name); array_pop($path); return join($path, $this->_delimiter); } /** * Return an array describing the path elements of the folder. * * @param string $name The name of the folder. * * @return array The path elements. */ protected function _subpath($name) { $path = explode($this->_delimiter, $name); if ($path[0] == $this->_name) { array_shift($path); } //@todo: What about the potential trailing domain? return $path; } /** * Generate a folder path for the given path in this namespace. * * @param array $path The path of the folder. * * @return string The name of the folder. */ public function generateName($path) { if (!empty($this->_name)) { array_unshift($path, $this->_name); } return join($path, $this->_delimiter); } /** * Generate a folder path for the given subpath and owner. * * @param string $subpath The subpath of the folder. * @param string $owner The folder owner. * * @return string The name of the folder. */ public function generatePath($subpath, $owner) { return empty($this->_name) ? $subpath : $this->_name . $this->_delimiter . $subpath; } /** * Convert the namespace description to a string. * * @return string The namespace description. */ public function __toString() { return '"' . $this->_name . '" (' . $this->getType() . ', "' . $this->_delimiter . '")'; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Fixed.php0000664000175000017500000000414012207101545024575 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Fixed:: implements the default IMAP * namespaces on the Kolab server. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Fixed extends Horde_Kolab_Storage_Folder_Namespace { /** * Constructor. */ public function __construct($user) { $this->user = $user; parent::__construct($this->_initializeData()); } /** * Initialize the namespace elements. * * @return array The namespace elements. */ private function _initializeData() { return array( new Horde_Kolab_Storage_Folder_Namespace_Element_Personal('INBOX/', '/', $this->user), new Horde_Kolab_Storage_Folder_Namespace_Element_Other('user/', '/', $this->user), new Horde_Kolab_Storage_Folder_Namespace_Element_SharedWithPrefix('', '/', $this->user, 'shared.') ); } /** * Serialize this object. * * @return string The serialized data. */ public function serialize() { return serialize($this->user); } /** * Reconstruct the object from serialized data. * * @param string $data The serialized data. */ public function unserialize($data) { $this->user = @unserialize($data); $this->initialize($this->_initializeData()); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace/Imap.php0000664000175000017500000000217012207101545024425 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace_Config:: allows to use the information from * the IMAP NAMESPACE command to identify the IMAP namespaces on the Kolab * server. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Namespace_Imap extends Horde_Kolab_Storage_Folder_Namespace_Config { }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Stamp/Uids.php0000664000175000017500000001127212207101545023636 0ustar janjan * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A folder stamp that includes a list of UIDs. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Thomas Jarosch * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Stamp_Uids implements Horde_Kolab_Storage_Folder_Stamp { /** The UID validity status */ const UIDVALIDITY = 'uidvalidity'; /** The next UID status */ const UIDNEXT = 'uidnext'; /** * The folder status. * * @var array */ private $_status; /** * The list of backend object IDs. * * @var array */ private $_ids; /** * Constructor. * * @param array $status The folder status. * @param array $ids The list of undeleted objects in the folder. */ public function __construct($status, $ids) { $this->_status = $status; $this->_ids = $ids; } /** * Return the folder UID validity. * * @return string The folder UID validity marker. */ public function uidvalidity() { return $this->_status[self::UIDVALIDITY]; } /** * Return the folder next UID number. * * @return string The next UID number. */ public function uidnext() { return $this->_status[self::UIDNEXT]; } /** * Return the backend object IDs in the folder. * * @return array The list of backend IDs. */ public function ids() { return $this->_ids; } /** * Indicate if there was a complete folder reset. * * @param Horde_Kolab_Storage_Folder_Stamp_Uids The stamp to compare against. * * @return boolean True if there was a complete folder reset stamps are * different, false if not. */ public function isReset(Horde_Kolab_Storage_Folder_Stamp $stamp) { if (!$stamp instanceOf Horde_Kolab_Storage_Folder_Stamp_Uids) { throw new Horde_Kolab_Storage_Exception('This stamp can only be compared against stamps of its own type.'); } if ($this->uidvalidity() != $stamp->uidvalidity()) { return true; } else { return false; } } /** * What changed between this old stamp and the new provided stamp? * * @param Horde_Kolab_Storage_Folder_Stamp_Uids The new stamp to compare against. * * @return array|boolean False if there was no change, an array of two * elements (added IDs, deleted IDs) otherwise. */ public function getChanges(Horde_Kolab_Storage_Folder_Stamp $stamp) { if (!$stamp instanceOf Horde_Kolab_Storage_Folder_Stamp_Uids) { throw new Horde_Kolab_Storage_Exception('This stamp can only be compared against stamps of its own type.'); } if ($this->uidnext() != $stamp->uidnext() || count($this->ids()) != count($stamp->ids())) { return array( self::DELETED => array_values( array_diff($this->ids(), $stamp->ids()) ), self::ADDED => array_values( array_diff($stamp->ids(), $this->ids()) ) ); } return false; } /** * Serialize this object. * * @return string The serialized data. */ public function serialize() { return serialize(array($this->_status, $this->_ids)); } /** * Reconstruct the object from serialized data. * * @param string $data The serialized data. */ public function unserialize($data) { list($this->_status, $this->_ids) = @unserialize($data); } /** * Convert the instance into a string. * * @return string The string representation for this instance. */ public function __toString() { return sprintf( "uidvalidity: %s\nuidnext: %s\nuids: %s", $this->uidvalidity(), $this->uidnext(), join(', ', $this->ids()) ); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Base.php0000664000175000017500000001054412207101545022521 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Kolab_Folder class represents an single folder in the Kolab * backend. * * Copyright 2004-2013 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 * @author Gunnar Wrobel * @author Thomas Jarosch * @package Kolab_Storage */ class Horde_Kolab_Storage_Folder_Base implements Horde_Kolab_Storage_Folder { /** * The handler for the list of folders. * * @var Horde_Kolab_Storage_List */ private $_list; /** * The folder path. * * @var string */ private $_path; /** * Additional folder information. * * @var array */ private $_data; /** * Constructor. * * @param Horde_Kolab_Storage_List_Query_List $list The query handler for * the list of folders. * @param string $path Path of the folder. */ public function __construct(Horde_Kolab_Storage_List_Query_List $list, $path) { $this->_list = $list; $this->_path = $path; } /** * Fetch the data array. * * @return NULL */ private function _init() { if ($this->_data === null) { $this->_data = $this->_list->folderData($this->_path); } } /** * Fetch a data value. * * @param string $key The name of the data value to fetch. * * @return mixed The data value */ public function get($key) { $this->_init(); if (isset($this->_data[$key])) { return $this->_data[$key]; } throw new Horde_Kolab_Storage_Exception( sprintf('No "%s" information available!', $key) ); } /** * Fetch a data value and accept a missing value (represented by the return value NULL). * * @param string $key The name of the data value to fetch. * * @return mixed The data value */ public function getWithNull($key) { $this->_init(); if (isset($this->_data[$key])) { return $this->_data[$key]; } } /** * Return the storage path of the folder. * * @return string The storage path of the folder. */ public function getPath() { return $this->_path; } /** * Return the namespace type of the folder. * * @return string The namespace type of the folder. */ public function getNamespace() { return $this->get('namespace'); } /** * Return the namespace prefix of the folder. * * @return string The namespace prefix of the folder. */ public function getPrefix() { return $this->get('prefix'); } /** * Returns a readable title for this folder. * * @return string The folder title. */ public function getTitle() { return $this->get('name'); } /** * Returns the owner of the folder. * * @return string The owner of this folder. */ public function getOwner() { return $this->getWithNull('owner'); } /** * Returns the folder path without namespace components. * * @return string The subpath of this folder. */ public function getSubpath() { return $this->get('subpath'); } /** * Returns the folder parent. * * @return string The parent of this folder. */ public function getParent() { return $this->get('parent'); } /** * Is this a default folder? * * @return boolean Boolean that indicates the default status. */ public function isDefault() { return $this->get('default'); } /** * The type of this folder. * * @return string The folder type. */ public function getType() { return $this->get('type'); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Data.php0000664000175000017500000000475012207101545022522 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A helper for folder data. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Data { /** * Folder path. * * @var string */ private $_path; /** * Folder type. * * @var Horde_Kolab_Storage_Folder_Type */ private $_type; /** * Namespace handler * * @var Horde_Kolab_Storage_Folder_Namespace */ private $_namespace; /** * Constructor. * * @param string $path The folder path. * @param Horde_Kolab_Storage_Folder_Type $type The folder type. * @param Horde_Kolab_Storage_Folder_Namespace $namespace The namespace hanlder. */ public function __construct($path, Horde_Kolab_Storage_Folder_Type $type, Horde_Kolab_Storage_Folder_Namespace $namespace) { $this->_path = $path; $this->_type = $type; $this->_namespace = $namespace; } /** * Prepare an array representing the folder data. * * @return array The folder data. */ public function toArray() { return array( 'folder' => $this->_path, 'type' => $this->_type->getType(), 'default' => $this->_type->isDefault(), 'owner' => $this->_namespace->getOwner($this->_path), 'name' => $this->_namespace->getTitle($this->_path), 'subpath' => $this->_namespace->getSubpath($this->_path), 'parent' => $this->_namespace->getParent($this->_path), 'namespace' => $this->_namespace->matchNamespace($this->_path)->getType(), 'prefix' => $this->_namespace->matchNamespace($this->_path)->getName(), 'delimiter' => $this->_namespace->matchNamespace($this->_path)->getDelimiter(), ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Namespace.php0000664000175000017500000001727012207101545023546 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage_Folder_Namespace:: class handles IMAP namespaces and allows * to derive folder information from folder names. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_Folder_Namespace implements IteratorAggregate, Serializable { /** The possible namespace types (RFC 2342 [5]) */ const PERSONAL = 'personal'; const OTHER = 'other'; const SHARED = 'shared'; /** * The current user. * * @var string */ protected $user; /** * The namespaces. * * @var array */ private $_namespaces = array(); /** * The namespaces with a defined prefix. * * @var array */ private $_prefix_namespaces = array(); /** * The fallback namespace matching any path if no other namesace matches. * * @var Horde_Kolab_Storage_Folder_Namespace_Element */ private $_any; /** * Constructor. * * @param array $namespaces The namespaces. */ public function __construct(array $namespaces) { $this->initialize($namespaces); } /** * Initialize the class with a set of namespace configurations. * * @param array $namespaces The namespaces. * * @return NULL */ protected function initialize(array $namespaces) { $this->_namespaces = $namespaces; foreach ($this->_namespaces as $namespace) { if ($namespace->getName() == '') { $this->_any = $namespace; } else { $this->_prefix_namespaces[] = $namespace; } } } /** * Match a folder name with the corresponding namespace. * * @param string $name The name of the folder. * * @return Horde_Kolab_Storage_Folder_Namespace_Element The corresponding namespace. * * @throws Horde_Kolab_Storage_Exception If the namespace of the folder * cannot be determined. */ public function matchNamespace($name) { foreach ($this->_prefix_namespaces as $namespace) { if ($namespace->matches($name)) { return $namespace; } } if (!empty($this->_any)) { return $this->_any; } throw new Horde_Kolab_Storage_Exception( sprintf('Namespace of folder %s cannot be determined.', $name) ); } /** * Return the owner of a folder. * * @param string $name The name of the folder. * * @return string The owner of the folder. */ public function getOwner($name) { return $this->matchNamespace($name)->getOwner($name); } /** * Get the sub path for the given folder name. * * @param string $name The folder name. * * @return string The sub path. */ public function getSubpath($name) { return $this->matchNamespace($name)->getSubpath($name); } /** * Get the parent for the given folder name. * * @param string $name The parent folder name. * * @return string The parent. */ public function getParent($name) { return $this->matchNamespace($name)->getParent($name); } /** * Return the title of a folder. * * @param string $name The name of the folder. * * @return string The title of the folder. */ public function getTitle($name) { return $this->matchNamespace($name)->getTitle($name); } /** * Construct the Kolab storage folder name based on the folder * title and the owner. * * @param string $owner The owner of the folder. * @param string $subpath The folder subpath. * @param string $prefix The namespace prefix. * * @return string The folder name for the backend. */ public function constructFolderName($owner, $subpath, $prefix = null) { if (empty($owner)) { return $this->_getNamespace(self::SHARED, $prefix) ->generatePath($subpath, $owner); } else if ($owner == $this->user) { return $this->_getNamespace(self::PERSONAL, $prefix) ->generatePath($subpath, $owner); } else { return $this->_getNamespace(self::OTHER, $prefix) ->generatePath($subpath, $owner); } } /** * Generate an IMAP folder name in the personal namespace. * * @param string $title The new folder title. * * @return string The IMAP folder name. */ public function setTitle($title) { return $this->_getNamespace(self::PERSONAL) ->generateName(explode(':', $title)); } /** * Generate an IMAP folder name in the other namespace. * * @param string $title The new folder title. * @param string $owner The new owner of the folder. * * @return string The IMAP folder name. */ public function setTitleInOther($title, $owner) { $path = explode(':', $title); array_unshift($path, $owner); return $this->_getNamespace(self::OTHER)->generateName($path); } /** * Generate an IMAP folder name in the shared namespace. * * @param string $title The new folder title. * * @return string The IMAP folder name. */ public function setTitleInShared($title) { return $this->_getNamespace(self::SHARED) ->generateName(explode(':', $title)); } /** * Get the namespace matching the given type and (optional) prefix. * * @param string $type The namespace type. * @param string $prefix The namespace prefix * * @return Horde_Kolab_Storage_Folder_Namespace_Element The namespace. */ private function _getNamespace($type, $prefix = null) { $matching = array(); foreach ($this->_namespaces as $namespace) { if ($namespace->getType() == $type && ($prefix === null || $namespace->getName() === $prefix)) { $matching[] = $namespace; } } if (count($matching) == 1) { return $matching[0]; } else if (count($matching) > 1) { throw new Horde_Kolab_Storage_Exception( 'Multiple namespaces of the same type!' ); } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'No namespace of the type %s%s!', $type, ($prefix !== null) ? ' with prefix \"' . $prefix . '\"' : '' ) ); } } /** */ public function getIterator() { return new ArrayIterator($this->_namespaces); } /** * Convert the namespace description to a string. * * @return string The namespace description. */ public function __toString() { return get_class($this) . ': ' . join(', ', $this->_namespaces); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Stamp.php0000664000175000017500000000365312207101545022736 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Defines unique stamps that allow to determine if folder data has changed or * not. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Folder_Stamp extends Serializable { /** List of deleted IDs */ const DELETED = 'd'; /** List of added IDs */ const ADDED = 'a'; /** * Indicate if there was a complete folder reset. * * @param Horde_Kolab_Storage_Folder_Stamp_Uids The stamp to compare against. * * @return boolean True if there was a complete folder reset stamps are * different, false if not. */ public function isReset(Horde_Kolab_Storage_Folder_Stamp $stamp); /** * Return the backend object IDs in the folder. * * @return array The list of backend IDs. */ public function ids(); /** * What changed between this old stamp and the new provided stamp? * * @param Horde_Kolab_Storage_Folder_Stamp_Uids The new stamp to compare against. * * @return array|boolean False if there was no change, an array of two * elements (added IDs, deleted IDs) otherwise. */ public function getChanges(Horde_Kolab_Storage_Folder_Stamp $stamp); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Type.php0000664000175000017500000000316112207101545022565 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles folder types. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Type { /** * Folder type. * * @var string */ private $_type; /** * Default folder? * * @var boolean */ private $_default; /** * Constructor. * * @param string $annotation The folder type annotation value. */ public function __construct($annotation) { $elements = explode('.', $annotation); $this->_type = $elements[0]; $this->_default = isset($elements[1]) && $elements[1] == 'default'; } /** * Return the folder type. * * @return string The folder type. */ public function getType() { return $this->_type; } /** * Indicates if this is a default folder. * * @return boolean True if it is a default folder. */ public function isDefault() { return $this->_default; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder/Types.php0000664000175000017500000000251612207101545022753 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Factory for folder types. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Folder_Types { /** * Folder types that have been created so far. * * @var array */ private $_types; /** * Create a folder type handler. * * @param string $annotation The folder type annotation value. * * @return Horde_Kolab_Storage_Folder_Type The folder type handler. */ public function create($annotation) { if (!isset($this->_types[$annotation])) { $this->_types[$annotation] = new Horde_Kolab_Storage_Folder_Type($annotation); } return $this->_types[$annotation]; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Manipulation/Decorator/Log.php0000664000175000017500000000634612207101545026457 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Logs Kolab folder list manipulations. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Manipulation_Decorator_Log extends Horde_Kolab_Storage_List_Manipulation { /** * Decorated manipulation handler. * * @var Horde_Kolab_Storage_List_Manipulation */ private $_manipulation; /** * A log handler. * * @var mixed */ private $_logger; /** * Constructor. * * @param Horde_Kolab_Storage_List_Manipulation $manipulation The list manipulator. * @param mixed $logger The log handler. This instance must provide the debug() method. */ public function __construct(Horde_Kolab_Storage_List_Manipulation $manipulation, $logger) { $this->_manipulation = $manipulation; $this->_logger = $logger; } /** * Create a new folder. * * @param string $folder The path of the folder to create. * @param string $type An optional type for the folder. * * @return NULL */ public function createFolder($folder, $type = null) { $this->_logger->debug(sprintf('Creating folder %s.', $folder)); $result = $this->_manipulation->createFolder($folder, $type); $this->_logger->debug( sprintf('Successfully created folder %s [type: %s].', $folder, $type) ); } /** * Delete a folder. * * @param string $folder The path of the folder to delete. * * @return NULL */ public function deleteFolder($folder) { $this->_logger->debug(sprintf('Deleting folder %s.', $folder)); $result = $this->_manipulation->deleteFolder($folder); $this->_logger->debug( sprintf('Successfully deleted folder %s.', $folder) ); } /** * Rename a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function renameFolder($old, $new) { $this->_logger->debug(sprintf('Renaming folder %s.', $old)); $result = $this->_manipulation->renameFolder($old, $new); $this->_logger->debug( sprintf('Successfully renamed folder %s to %s.', $old, $new) ); } /** * Register a new manipulation listener. * * @param Horde_Kolab_Storage_List_Manipulation_Listener $listener The new listener. */ public function registerListener(Horde_Kolab_Storage_List_Manipulation_Listener $listener) { $this->_manipulation->registerListener($listener); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Manipulation/Base.php0000664000175000017500000000665412207101545024670 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles all manipulations of a Horde_Kolab_Storage_List. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Manipulation_Base extends Horde_Kolab_Storage_List_Manipulation { /** * The list of registered queries. * * @var Horde_Kolab_Storage_List_Manipulation_Listener[] */ private $_listeners = array(); /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The primary connection driver. */ public function __construct(Horde_Kolab_Storage_Driver $driver) { $this->_driver = $driver; } /** * Create a new folder. * * @param string $folder The path of the folder to create. * @param string $type An optional type for the folder. * * @return NULL */ public function createFolder($folder, $type = null) { $this->_driver->create($folder); if ($type) { $this->_driver->setAnnotation( $folder, Horde_Kolab_Storage_List_Query_List::ANNOTATION_FOLDER_TYPE, $type ); } foreach ($this->_listeners as $listener) { $listener->updateAfterCreateFolder($folder, $type); } } /** * Delete a folder. * * WARNING: Do not use this call in case there is still data present in the * folder. You are required to empty any data set *before* removing the * folder. Otherwise there is no guarantee you can adhere to that Kolab * specification that might require the triggering of remote systems to * inform them about the removal of the folder. * * @param string $folder The path of the folder to delete. * * @return NULL */ public function deleteFolder($folder) { $this->_driver->delete($folder); foreach ($this->_listeners as $listener) { $listener->updateAfterDeleteFolder($folder); } } /** * Rename a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function renameFolder($old, $new) { $this->_driver->rename($old, $new); foreach ($this->_listeners as $listener) { $listener->updateAfterRenameFolder($old, $new); } } /** * Register a new manipulation listener. * * @param Horde_Kolab_Storage_List_Manipulation_Listener $listener The new listener. */ public function registerListener(Horde_Kolab_Storage_List_Manipulation_Listener $listener) { $this->_listeners[] = $listener; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Manipulation/Listener.php0000664000175000017500000000314512207101545025573 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Describes a manipulation listener. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_List_Manipulation_Listener { /** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null); /** * Update the listener after deleting folder. * * @param string $folder The path of the folder that has been deleted. * * @return NULL */ public function updateAfterDeleteFolder($folder); /** * Update the listener after renaming a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function updateAfterRenameFolder($old, $new); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/Acl/Base.php0000664000175000017500000001011012207101545024012 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles a list of folder acls. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_Acl_Base extends Horde_Kolab_Storage_List_Query_Acl { /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The driver to access the backend. */ public function __construct(Horde_Kolab_Storage_Driver $driver) { $this->_driver = $driver; } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { return $this->_driver->hasAclSupport(); } /** * Retrieve the access rights for a folder. This method will use two calls * to the backend. It will first get the individual user rights via * getMyRights and will subsequently fetch all ACL if the user has admin * rights on a folder. If you already know the user has admin rights on a * folder it makes more sense to call getAllAcl() directly. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { if (!$this->hasAclSupport()) { return array($this->_driver->getAuth() => 'lrid'); } $acl = $this->getMyAcl($folder); if (strpos($acl, 'a') !== false) { try { return $this->_driver->getAcl($folder); } catch (Horde_Kolab_Storage_Exception $e) { } } return array($this->_driver->getAuth() => $acl); } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { if (!$this->hasAclSupport()) { return 'lrid'; } return $this->_driver->getMyAcl($folder); } /** * Retrieve the all access rights on a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return string The folder rights. */ public function getAllAcl($folder) { if (!$this->hasAclSupport()) { return array($this->_driver->getAuth() => 'lrid'); } return $this->_driver->getAcl($folder); } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $this->_failOnMissingAcl(); return $this->_driver->setAcl($folder, $user, $acl); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->_failOnMissingAcl(); return $this->_driver->deleteAcl($folder, $user); } private function _failOnMissingAcl() { if (!$this->hasAclSupport()) { throw new Horde_Kolab_Storage_Exception('The backend does not support ACL.'); } } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/Acl/Cache.php0000664000175000017500000001701312207101545024154 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles a cached list of folder acls. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_Acl_Cache extends Horde_Kolab_Storage_List_Query_Acl implements Horde_Kolab_Storage_List_Manipulation_Listener, Horde_Kolab_Storage_List_Synchronization_Listener { /** The acl support */ const CAPABILITY = 'ACL'; /** The ACL query data */ const ACL = 'ACL'; /** The user specific rights */ const MYRIGHTS = 'MYRIGHTS'; /** All rights */ const ALLRIGHTS = 'ALLRIGHTS'; /** * The underlying ACL query. * * @param Horde_Kolab_Storage_List_Query_Acl */ private $_query; /** * The list cache. * * @var Horde_Kolab_Storage_Cache_List */ private $_list_cache; /** * The cached ACL data. * * @var array */ private $_acl; /** * The cached user rights. * * @var array */ private $_my_rights; /** * The cached rights. * * @var array */ private $_all_rights; /** * Constructor. * * @param Horde_Kolab_Storage_List_Query_Acl $acl The underlying acl query. * @param Horde_Kolab_Storage_List_Cache $cache The list cache. */ public function __construct(Horde_Kolab_Storage_List_Query_Acl $query, Horde_Kolab_Storage_List_Cache $cache) { $this->_query = $query; $this->_list_cache = $cache; if ($this->_list_cache->hasQuery(self::ACL)) { $this->_acl = $this->_list_cache->getQuery(self::ACL); } else { $this->_acl = array(); } if ($this->_list_cache->hasQuery(self::MYRIGHTS)) { $this->_my_rights = $this->_list_cache->getQuery(self::MYRIGHTS); } else { $this->_my_rights = array(); } if ($this->_list_cache->hasQuery(self::ALLRIGHTS)) { $this->_all_rights = $this->_list_cache->getQuery(self::ALLRIGHTS); } else { $this->_all_rights = array(); } } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { if (!$this->_list_cache->issetSupport(self::CAPABILITY)) { $this->_list_cache->setSupport( self::CAPABILITY, $this->_query->hasAclSupport() ); $this->_list_cache->save(); } return $this->_list_cache->hasSupport(self::CAPABILITY); } /** * Retrieve the access rights for a folder. This method will use two calls * to the backend. It will first get the individual user rights via * getMyRights and will subsequently fetch all ACL if the user has admin * rights on a folder. If you already know the user has admin rights on a * folder it makes more sense to call getAllAcl() directly. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { if (!isset($this->_acl[$folder])) { $this->_acl[$folder] = $this->_query->getAcl($folder); $this->_list_cache->setQuery(self::ACL, $this->_acl); $this->_list_cache->save(); } return $this->_acl[$folder]; } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { if (!isset($this->_my_rights[$folder])) { $this->_my_rights[$folder] = $this->_query->getMyAcl($folder); $this->_list_cache->setQuery(self::MYRIGHTS, $this->_my_rights); $this->_list_cache->save(); } return $this->_my_rights[$folder]; } /** * Retrieve the all access rights on a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return string The folder rights. */ public function getAllAcl($folder) { if (!isset($this->_all_rights[$folder])) { $this->_all_rights[$folder] = $this->_query->getAllAcl($folder); $this->_list_cache->setQuery(self::ALLRIGHTS, $this->_all_rights); $this->_list_cache->save(); } return $this->_all_rights[$folder]; } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { $this->_query->setAcl($folder, $user, $acl); $this->_purgeFolder($folder); } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { $this->_query->deleteAcl($folder, $user); $this->_purgeFolder($folder); } /** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null) { } /** * Update the listener after deleting folder. * * @param string $folder The path of the folder that has been deleted. * * @return NULL */ public function updateAfterDeleteFolder($folder) { $this->_purgeFolder($folder); } /** * Update the listener after renaming a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function updateAfterRenameFolder($old, $new) { $this->_purgeFolder($old); } /** * Synchronize the ACL information with the information from the backend. * * @return NULL */ public function synchronize() { $this->_acl = array(); $this->_my_rights = array(); $this->_all_rights = array(); } /** * Remove outdated folder data from the cache. * * @param string $folder The folder name. * * @return NULL */ private function _purgeFolder($folder) { unset($this->_acl[$folder]); unset($this->_my_rights[$folder]); unset($this->_all_rights[$folder]); $this->_list_cache->setQuery(self::ACL, $this->_acl); $this->_list_cache->setQuery(self::MYRIGHTS, $this->_my_rights); $this->_list_cache->setQuery(self::MYRIGHTS, $this->_all_rights); $this->_list_cache->save(); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/ActiveSync/Base.php0000664000175000017500000000440612207101545025376 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles a active sync parameters. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_ActiveSync_Base extends Horde_Kolab_Storage_List_Query_ActiveSync { /** The active sync parameters */ /** @todo Shouldn't this be private data? */ const ANNOTATION_ACTIVE_SYNC = '/priv/vendor/kolab/activesync'; /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The driver to access the backend. */ public function __construct(Horde_Kolab_Storage_Driver $driver) { $this->_driver = $driver; } /** * Returns the active sync settings. * * @param string $folder The folder name. * * @return array The folder active sync parameters. */ public function getActiveSync($folder) { return json_decode( base64_decode( $this->_driver->getAnnotation( $folder, self::ANNOTATION_ACTIVE_SYNC ) ), true ); } /** * Set the active sync settings. * * @param string $folder The folder name. * @param array $data The active sync settings. * * @return string The encoded share parameters. */ public function setActiveSync($folder, array $data) { $this->_driver->setAnnotation( $folder, self::ANNOTATION_ACTIVE_SYNC, base64_encode(json_encode($data)) ); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/ActiveSync/Cache.php0000664000175000017500000001077512207101545025535 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Caches active sync parameters. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_ActiveSync_Cache extends Horde_Kolab_Storage_List_Query_ActiveSync implements Horde_Kolab_Storage_List_Manipulation_Listener, Horde_Kolab_Storage_List_Synchronization_Listener { /** The active sync information */ const ACTIVE_SYNC = 'ACTIVE_SYNC'; /** * The underlying ActiveSync query. * * @param Horde_Kolab_Storage_List_Query_ActiveSync */ private $_query; /** * The list cache. * * @var Horde_Kolab_Storage_Cache_List */ private $_list_cache; /** * The cached active sync data. * * @var array */ private $_active_sync; /** * Constructor. * * @param Horde_Kolab_Storage_List_Query_ActiveSync $query The underlying ActiveSync query. * @param Horde_Kolab_Storage_List_Cache $cache The list cache. */ public function __construct(Horde_Kolab_Storage_List_Query_ActiveSync $query, Horde_Kolab_Storage_List_Cache $cache) { $this->_query = $query; $this->_list_cache = $cache; if ($this->_list_cache->hasQuery(self::ACTIVE_SYNC)) { $this->_active_sync = $this->_list_cache->getQuery(self::ACTIVE_SYNC); } else { $this->_active_sync = array(); } } /** * Returns the active sync settings. * * @param string $folder The folder name. * * @return array The folder active sync parameters. */ public function getActiveSync($folder) { if (!isset($this->_active_sync[$folder])) { $this->_active_sync[$folder] = $this->_query->getActiveSync($folder); $this->_list_cache->setQuery(self::ACTIVE_SYNC, $this->_active_sync); $this->_list_cache->save(); } return $this->_active_sync[$folder]; } /** * Set the active sync settings. * * @param string $folder The folder name. * @param array $data The active sync settings. * * @return string The encoded share parameters. */ public function setActiveSync($folder, array $data) { $this->_query->setActiveSync($folder, $data); $this->_active_sync[$folder] = $data; $this->_list_cache->setQuery(self::ACTIVE_SYNC, $this->_active_sync); $this->_list_cache->save(); } /** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null) { } /** * Update the listener after deleting folder. * * @param string $folder The path of the folder that has been deleted. * * @return NULL */ public function updateAfterDeleteFolder($folder) { unset($this->_active_sync[$folder]); $this->_list_cache->setQuery(self::ACTIVE_SYNC, $this->_active_sync); $this->_list_cache->save(); } /** * Update the listener after renaming a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function updateAfterRenameFolder($old, $new) { if (isset($this->_active_sync[$old])) { $this->_active_sync[$new] = $this->_active_sync[$old]; unset($this->_active_sync[$old]); $this->_list_cache->setQuery(self::ACTIVE_SYNC, $this->_active_sync); } $this->_list_cache->save(); } /** * Purge all ActiveSync data and restart querying the backend. * * @return NULL */ public function synchronize() { $this->_active_sync = array(); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List/Cache/Synchronization.php0000664000175000017500000002347312207101545027600 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles synchronization of the list query cache. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_List_Cache_Synchronization { /** * The IMAP driver to query the backend. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * The factory for folder types. * * @var Horde_Kolab_Storage_Folder_Types */ private $_folder_types; /** * Handles default folders. * * @var Horde_Kolab_Storage_List_Query_List_Defaults */ private $_defaults; /** * The list cache. * * @var Horde_Kolab_Storage_List_Cache */ private $_cache; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The driver to access the backend. * @param Horde_Kolab_Storage_Folder_Types $types Handler of folder types. */ public function __construct(Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Folder_Types $types, Horde_Kolab_Storage_List_Query_List_Defaults $defaults) { $this->_driver = $driver; $this->_folder_types = $types; $this->_defaults = $defaults; } /** * Set the list cache. * * @param Horde_Kolab_Storage_List_Cache $cache The reference to the cache * that should reveive any updates. */ public function setCache($cache) { $this->_cache = $cache; } /** * Synchronize the query data with the information from the backend. */ public function synchronize() { $this->_synchronize( $this->_driver->getNamespace(), $this->_driver->listFolders(), $this->_driver->listAnnotation( Horde_Kolab_Storage_List_Query_List::ANNOTATION_FOLDER_TYPE ) ); } /** * Synchronize based on the given folder list. * * @param Horde_Kolab_Storage_List_Cache $cache The reference to the cache * that should reveive the update. * @param Horde_Kolab_Storage_Folder_Namespace $namespace The namespace handler * @param array $folder_list The list of folders. * @param array $annotation The list of folder annotations. * * @return NULL */ public function _synchronize(Horde_Kolab_Storage_Folder_Namespace $namespace, $folder_list, $annotations) { $folders = array(); $owners = array(); $types = array(); $by_type = array(); $mail_type = $this->_folder_types->create('mail'); $this->_defaults->reset(); foreach ($folder_list as $folder) { $folder = strval($folder); if (!isset($annotations[$folder])) { $type = $mail_type; } else { $type = $this->_folder_types->create($annotations[$folder]); } $folder_type = $type->getType(); $owner = $namespace->getOwner($folder); $owners[$folder] = $owner; $types[$folder] = $type->getType(); $data = new Horde_Kolab_Storage_Folder_Data( $folder, $type, $namespace ); $dataset = $data->toArray(); $folders[$folder] = $dataset; $by_type[$folder_type][$folder] = $dataset; if ($folders[$folder]['default']) { $this->_defaults->rememberDefault( $folder, $folder_type, $owner, $folders[$folder]['namespace'] == Horde_Kolab_Storage_Folder_Namespace::PERSONAL ); } } $this->_cache->store($folder_list, $annotations); if (!$this->_cache->hasNamespace()) { $this->_cache->setNamespace(serialize($namespace)); } $this->_cache->setQuery(Horde_Kolab_Storage_List_Query_List_Cache::TYPES, $types); $this->_cache->setQuery(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS, $folders); $this->_cache->setQuery(Horde_Kolab_Storage_List_Query_List_Cache::OWNERS, $owners); $this->_cache->setQuery(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE, $by_type); $this->_cache->setQuery( Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS, $this->_defaults->getDefaults() ); $this->_cache->setQuery( Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS, $this->_defaults->getPersonalDefaults() ); $this->_cache->save(); } /** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null) { if (!$this->_cache->hasNamespace()) { // Cache not synchronized yet. return; } $folder_list = $this->_cache->getFolders(); $folder_list[] = $folder; $annotations = $this->_cache->getFolderTypes(); if ($type !== null) { $annotations[$folder] = $type; } $namespace = unserialize($this->_cache->getNamespace()); $this->_synchronize($namespace, $folder_list, $annotations); } /** * Update the listener after deleting folder. * * @param string $folder The path of the folder that has been deleted. * * @return NULL */ public function updateAfterDeleteFolder($folder) { if (!$this->_cache->hasNamespace()) { // Cache not synchronized yet. return; } $folder_list = $this->_cache->getFolders(); $folder_list = array_diff($folder_list, array($folder)); $annotations = $this->_cache->getFolderTypes(); if (isset($annotations[$folder])) { unset($annotations[$folder]); } $namespace = unserialize($this->_cache->getNamespace()); $this->_synchronize($namespace, $folder_list, $annotations); } /** * Update the listener after renaming a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function updateAfterRenameFolder($old, $new) { if (!$this->_cache->hasNamespace()) { // Cache not synchronized yet. return; } $folder_list = $this->_cache->getFolders(); $folder_list = array_diff($folder_list, array($old)); $folder_list[] = $new; $annotations = $this->_cache->getFolderTypes(); if (isset($annotations[$old])) { $annotations[$new] = $annotations[$old]; unset($annotations[$old]); } $namespace = unserialize($this->_cache->getNamespace()); $this->_synchronize($namespace, $folder_list, $annotations); } /** * Set the specified folder as default for its current type. * * @param array $folder The folder data. * @param string|boolean $previous The previous default folder or false if there was none. */ public function setDefault($folder, $previous = false) { if (!$this->_cache->hasNamespace()) { // Cache not synchronized yet. return; } if ($folder['namespace'] !== Horde_Kolab_Storage_Folder_Namespace::PERSONAL) { throw new Horde_Kolab_Storage_List_Exception( sprintf( "Unable to mark %s as a default folder. It is not within your personal namespace!", $folder['folder'] ) ); } $annotations = $this->_cache->getFolderTypes(); if (!isset($annotations[$folder['folder']])) { throw new Horde_Kolab_Storage_List_Exception( sprintf( "The folder %s has no Kolab type. It cannot be marked as 'default' folder!", $folder['folder'] ) ); } if ($previous) { $this->_driver->setAnnotation( $previous, Horde_Kolab_Storage_List_Query_List::ANNOTATION_FOLDER_TYPE, $folder['type'] ); $annotations[$previous] = $folder['type']; } $this->_driver->setAnnotation( $folder['folder'], Horde_Kolab_Storage_List_Query_List::ANNOTATION_FOLDER_TYPE, $folder['type'] . '.default' ); $annotations[$folder['folder']] = $folder['type'] . '.default'; $folder_list = $this->_cache->getFolders(); $namespace = unserialize($this->_cache->getNamespace()); $this->_synchronize($namespace, $folder_list, $annotations); } /** * Return any default folder duplicates. * * @return array The list of duplicate default folders accessible to the current user. */ public function getDuplicateDefaults() { return $this->_defaults->getDuplicates(); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List/Defaults/Bail.php0000664000175000017500000000313712207101545026005 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Protects against more than one default folder per type by bailing out. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_List_Defaults_Bail extends Horde_Kolab_Storage_List_Query_List_Defaults { /** * React on detection of more than one default folder. * * @param string $first The first default folder name. * @param string $second The second default folder name. * @param string $type The folder type. * @param string $owner The folder owner. */ protected function doubleDefault($first, $second, $owner, $type) { throw new Horde_Kolab_Storage_List_Exception( sprintf( 'Both folders "%s" and "%s" of owner "%s" are marked as default folder of type "%s"!', $first, $second, $owner, $type ) ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List/Defaults/Log.php0000664000175000017500000000360012207101545025652 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Protects against more than one default folder per type by logging an error. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_List_Defaults_Log extends Horde_Kolab_Storage_List_Query_List_Defaults { /** * The logger. * * @var Horde_Log_Logger */ private $_logger; /** * Constructor * * @param Horde_Log_Logger $logger The logger. Must provide an err() method. */ public function __construct($logger) { $this->_logger = $logger; } /** * React on detection of more than one default folder. * * @param string $first The first default folder name. * @param string $second The second default folder name. * @param string $type The folder type. * @param string $owner The folder owner. */ protected function doubleDefault($first, $second, $owner, $type) { $this->_logger->err( sprintf( 'Both folders "%s" and "%s" of owner "%s" are marked as default folder of type "%s"!', $first, $second, $owner, $type ) ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List/Base.php0000664000175000017500000002167112207101545024244 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The basic list query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_List_Base extends Horde_Kolab_Storage_List_Query_List { /** * The IMAP driver to query the backend. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * The factory for folder types. * * @var Horde_Kolab_Storage_Folder_Types */ private $_folder_types; /** * Handles default folders. * * @var Horde_Kolab_Storage_List_Query_List_Defaults */ private $_defaults; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The driver to access the backend. * @param Horde_Kolab_Storage_Folder_Types $types Handler of folder types. * @param Horde_Kolab_Storage_List_Query_List_Defaults $defaults Handler of defaults. */ public function __construct(Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Folder_Types $types, Horde_Kolab_Storage_List_Query_List_Defaults $defaults) { $this->_driver = $driver; $this->_folder_types = $types; $this->_defaults = $defaults; } /** * Returns the folder type annotation as associative array. * * @return array The list folder types with the folder names as key and the * type handler as values. */ private function listFolderTypeAnnotations() { $result = array(); foreach ($this->_driver->listAnnotation(self::ANNOTATION_FOLDER_TYPE) as $folder => $annotation) { $result[$folder] = $this->_folder_types->create($annotation); } return $result; } /** * Returns the folder types as associative array. * * @return array The list folder types with the folder names as key and the * type as values. */ public function listTypes() { $result = array(); foreach ($this->listFolderTypeAnnotations() as $folder => $annotation) { $result[$folder] = $annotation->getType(); } return $result; } /** * List all folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ public function listByType($type) { $result = array(); foreach ($this->listTypes() as $folder => $folder_type) { if ($folder_type == $type) { $result[] = $folder; } } return $result; } /** * List basic folder data for the folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ public function dataByType($type) { $result = array(); $namespace = $this->_driver->getNamespace(); foreach ($this->listFolderTypeAnnotations() as $folder => $folder_type) { if ($folder_type->getType() == $type) { $data = new Horde_Kolab_Storage_Folder_Data( $folder, $folder_type, $namespace ); $result[$folder] = $data->toArray(); } } return $result; } /** * List basic folder data for the specified folder. * * @param string $folder The folder path. * * @return array The folder data. */ public function folderData($folder) { $list = $this->_driver->listFolders(); if (!in_array($folder, $list)) { throw new Horde_Kolab_Storage_List_Exception( sprintf('Folder %s does not exist!', $folder) ); } $annotations = $this->listFolderTypeAnnotations(); if (!isset($annotations[$folder])) { $type = $this->_folder_types->create('mail'); } else { $type = $annotations[$folder]; } $data = new Horde_Kolab_Storage_Folder_Data( $folder, $type, $this->_driver->getNamespace() ); return $data->toArray(); } /** * Get the folder owners. * * @return array The folder owners with the folder names as key and the * owner as values. */ public function listOwners() { $result = array(); $namespace = $this->_driver->getNamespace(); foreach ($this->_driver->listFolders() as $folder) { $result[$folder] = $namespace->getOwner($folder); } return $result; } /** * Set the specified folder as default for its current type. * * @param string $folder The folder name. */ public function setDefault($folder) { $types = $this->listTypes(); if (!isset($types[$folder])) { throw new Horde_Kolab_Storage_List_Exception( sprintf( "The folder %s has no Kolab type. It cannot be marked as 'default' folder!", $folder ) ); } $previous = $this->getDefault($types[$folder]); if ($previous) { $this->_driver->setAnnotation($previous, self::ANNOTATION_FOLDER_TYPE, $types[$folder]); } $this->_driver->setAnnotation($folder, self::ANNOTATION_FOLDER_TYPE, $types[$folder] . '.default'); } /** * Return the list of personal default folders. * * @return array An array that associates type (key) with the corresponding * default folder name (value). */ public function listPersonalDefaults() { return $this->_getPersonalDefaults(); } /** * Return the list of default folders. * * @return array An array with owners as keys and another array as * value. The second array associates type (key) with the * corresponding default folder (value). */ public function listDefaults() { return $this->_getDefaults(); } /** * Get the default folder for a certain type. * * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ public function getDefault($type) { $defaults = $this->_getPersonalDefaults(); if (!isset($defaults[$type])) { return false; } else { return $defaults[$type]; } } /** * Get the default folder for a certain type from a different owner. * * @param string $owner The folder owner. * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ public function getForeignDefault($owner, $type) { $defaults = $this->_getDefaults(); if (!isset($defaults[$owner][$type])) { return false; } else { return $defaults[$owner][$type]; } } /** * Return the list of personal defaults. */ private function _getPersonalDefaults() { $this->_initDefaults(); return $this->_defaults->getPersonalDefaults(); } /** * Return the complete list of defaults. */ private function _getDefaults() { $this->_initDefaults(); return $this->_defaults->getDefaults(); } /** * Initialize the list of defaults. */ private function _initDefaults() { if (!$this->_defaults->isComplete()) { $namespace = $this->_driver->getNamespace(); foreach ($this->listFolderTypeAnnotations() as $folder => $annotation) { if ($annotation->isDefault()) { $this->_defaults->rememberDefault( $folder, $annotation->getType(), $namespace->getOwner($folder), $namespace->matchNamespace($folder)->getType() == Horde_Kolab_Storage_Folder_Namespace::PERSONAL ); } } $this->_defaults->markComplete(); } } /** * Return the last sync stamp. * * @return string The stamp. */ public function getStamp() { return pack('Nn', time(), mt_rand()); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List/Cache.php0000664000175000017500000002060312207101545024367 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The cached list query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_List_Cache extends Horde_Kolab_Storage_List_Query_List implements Horde_Kolab_Storage_List_Manipulation_Listener, Horde_Kolab_Storage_List_Synchronization_Listener { /** The list of folder types */ const TYPES = 'TYPES'; /** The folder list sorted by type */ const BY_TYPE = 'BY_TYPE'; /** The list of folder data */ const FOLDERS = 'FOLDERS'; /** The folder owner list */ const OWNERS = 'OWNERS'; /** The default folder list for the current user */ const PERSONAL_DEFAULTS = 'PERSONAL_DEFAULTS'; /** The default folder list */ const DEFAULTS = 'DEFAULTS'; /** * The synchronization handler. * * @var Horde_Kolab_Storage_List_Query_List_Cache_Synchronization */ private $_sync; /** * The list cache. * * @var Horde_Kolab_Storage_List_Cache */ private $_list_cache; /** * Constructor. * * @param Horde_Kolab_Storage_List_Query_List_Cache_Synchronization $sync The synchronization handler.. * @param Horde_Kolab_Storage_List_Cache $cache The list cache. */ public function __construct(Horde_Kolab_Storage_List_Query_List_Cache_Synchronization $sync, Horde_Kolab_Storage_List_Cache $cache) { $this->_sync = $sync; $this->_list_cache = $cache; $this->_sync->setCache($cache); } /** * Ensure we have the query data. * * @param string $query The query data required. * * @return NULL */ private function _initQuery($query) { if (!$this->_list_cache->hasQuery($query)) { $this->_sync->synchronize($this->_list_cache); } } /** * Returns the folder types as associative array. * * @return array The list folder types with the folder names as key and the * type as values. */ public function listTypes() { $this->_initQuery(self::TYPES); return $this->_list_cache->getQuery(self::TYPES); } /** * List all folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ public function listByType($type) { $this->_initQuery(self::BY_TYPE); $by_type = $this->_list_cache->getQuery(self::BY_TYPE); if (isset($by_type[$type])) { return array_keys($by_type[$type]); } else { return array(); } } /** * List basic folder data for the folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ public function dataByType($type) { $this->_initQuery(self::BY_TYPE); $data_by_type = $this->_list_cache->getQuery(self::BY_TYPE); if (isset($data_by_type[$type])) { return $data_by_type[$type]; } else { return array(); } } /** * List basic folder data for the specified folder. * * @param string $folder The folder path. * * @return array The folder data. */ public function folderData($folder) { $this->_initQuery(self::FOLDERS); $folders = $this->_list_cache->getQuery(self::FOLDERS); if (isset($folders[$folder])) { return $folders[$folder]; } else { throw new Horde_Kolab_Storage_List_Exception( sprintf('Folder %s does not exist!', $folder) ); } } /** * Get the folder owners. * * @return array The folder owners with the folder names as key and the * owner as values. */ public function listOwners() { $this->_initQuery(self::OWNERS); return $this->_list_cache->getQuery(self::OWNERS); } /** * Set the specified folder as default for its current type. * * @param string $folder The folder name. */ public function setDefault($folder) { $data = $this->folderData($folder); $this->_sync->setDefault($data, $this->getDefault($data['type'])); } /** * Return the list of personal default folders. * * @return array An array that associates type (key) with the corresponding * default folder name (value). */ public function listPersonalDefaults() { $this->_initQuery(self::PERSONAL_DEFAULTS); return $this->_list_cache->getQuery(self::PERSONAL_DEFAULTS); } /** * Return the list of default folders. * * @return array An array with owners as keys and another array as * value. The second array associates type (key) with the * corresponding default folder (value). */ public function listDefaults() { $this->_initQuery(self::DEFAULTS); return $this->_list_cache->getQuery(self::DEFAULTS); } /** * Get the default folder for a certain type. * * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ public function getDefault($type) { $this->_initQuery(self::PERSONAL_DEFAULTS); $defaults = $this->_list_cache->getQuery(self::PERSONAL_DEFAULTS); if (isset($defaults[$type])) { return $defaults[$type]; } else { return false; } } /** * Get the default folder for a certain type from a different owner. * * @param string $owner The folder owner. * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ public function getForeignDefault($owner, $type) { $this->_initQuery(self::DEFAULTS); $defaults = $this->_list_cache->getQuery(self::DEFAULTS); if (isset($defaults[$owner][$type])) { return $defaults[$owner][$type]; } else { return false; } } /** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null) { $this->_sync->updateAfterCreateFolder($folder, $type); } /** * Update the listener after deleting folder. * * @param string $folder The path of the folder that has been deleted. * * @return NULL */ public function updateAfterDeleteFolder($folder) { $this->_sync->updateAfterDeleteFolder($folder); } /** * Update the listener after renaming a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function updateAfterRenameFolder($old, $new) { $this->_sync->updateAfterRenameFolder($old, $new); } /** * Return the last sync stamp. * * @return string The stamp. */ public function getStamp() { return $this->_list_cache->getStamp(); } /** * Return any default folder duplicates. * * @return array The list of duplicate default folders accessible to the current user. */ public function getDuplicateDefaults() { return $this->_sync->getDuplicateDefaults(); } /** * Synchronize the listener. */ public function synchronize() { $this->_sync->synchronize(); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List/Defaults.php0000664000175000017500000001011412207101545025127 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles the list of default folders and protects against more than default of * a single folder type. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Query_List_Defaults { /** * Has the list of defaults been assembled completely? * * @var boolean */ private $_complete = false; /** * The complete list of defaults. * * @var array */ private $_defaults = array(); /** * The complete list of personal defaults. * * @var array */ private $_personal_defaults = array(); /** * A list of duplicate personal defaults. * * @var array */ private $_duplicate_defaults = array(); /** * Remember a default folder. * * @param string $folder The folder name. * @param string $type The folder type. * @param string $owner The folder owner. * @param boolean $personal Is this a folder owned by the current user? */ public function rememberDefault($folder, $type, $owner, $personal) { if (isset($this->_defaults[$owner][$type])) { $this->doubleDefault($this->_defaults[$owner][$type], $folder, $owner, $type); if (!isset($this->_duplicate_defaults[$type][$owner])) { $this->_duplicate_defaults[$type][$owner] = array( $this->_defaults[$owner][$type], $folder ); } else { $this->_duplicate_defaults[$type][$owner][] = $folder; } } $this->_defaults[$owner][$type] = $folder; if ($personal) { $this->_personal_defaults[$type] = $folder; } } /** * Return the complete list of default folders available. * * @return array The list of default folders accessible to the current user. */ public function getDefaults() { return $this->_defaults; } /** * Reset the list of defaults. */ public function reset() { $this->_defaults = array(); $this->_personal_defaults = array(); $this->_duplicate_defaults = array(); } /** * Return the list of personal defaults of the current user. * * @return array The list of default folder owned by the current user. */ public function getPersonalDefaults() { return $this->_personal_defaults; } /** * Mark the list of defaults as completed. */ public function markComplete() { $this->_complete = true; } /** * Query if the list of defaults has been completely assembled. * * @return boolean True, if the list is complete. */ public function isComplete() { return $this->_complete; } /** * Return any duplicates. * * @return array The list of duplicate default folders accessible to the current user. */ public function getDuplicates() { return $this->_duplicate_defaults; } /** * React on detection of more than one default folder. * * @param string $first The first default folder name. * @param string $second The second default folder name. * @param string $type The folder type. * @param string $owner The folder owner. */ abstract protected function doubleDefault($first, $second, $owner, $type); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/Share/Base.php0000664000175000017500000000611012207101545024362 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles a share parameters. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_Share_Base extends Horde_Kolab_Storage_List_Query_Share { /** The folder description */ const ANNOTATION_DESCRIPTION = '/shared/comment'; /** The share parameters */ /** @todo Shouldn't this be private data? */ const ANNOTATION_SHARE_PARAMETERS = '/shared/vendor/horde/share-params'; /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The driver to access the backend. */ public function __construct(Horde_Kolab_Storage_Driver $driver) { $this->_driver = $driver; } /** * Returns the share description. * * @param string $folder The folder name. * * @return string The folder/share description. */ public function getDescription($folder) { return $this->_driver->getAnnotation( $folder, self::ANNOTATION_DESCRIPTION ); } /** * Returns the share parameters. * * @param string $folder The folder name. * * @return string The folder/share parameters. */ public function getParameters($folder) { $parameters = $this->_driver->getAnnotation( $folder, self::ANNOTATION_SHARE_PARAMETERS ); if (!empty($parameters)) { return unserialize(base64_decode($parameters)); } else { return array(); } } /** * Set the share description. * * @param string $folder The folder name. * @param string $description The share description. * * @return NULL */ public function setDescription($folder, $description) { $this->_driver->setAnnotation( $folder, self::ANNOTATION_DESCRIPTION, $description ); } /** * Set the share parameters. * * @param string $folder The folder name. * @param array $parameters The share parameters. * * @return string The encoded share parameters. */ public function setParameters($folder, array $parameters) { $this->_driver->setAnnotation( $folder, self::ANNOTATION_SHARE_PARAMETERS, base64_encode(serialize($parameters)) ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/Share/Cache.php0000664000175000017500000001473512207101545024527 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Caches share parameters. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Query_Share_Cache extends Horde_Kolab_Storage_List_Query_Share implements Horde_Kolab_Storage_List_Manipulation_Listener, Horde_Kolab_Storage_List_Synchronization_Listener { /** The share description */ const DESCRIPTIONS = 'SHARE_DESCRIPTIONS'; /** The share parameters */ const PARAMETERS = 'SHARE_PARAMETERS'; /** * The underlying Share query. * * @param Horde_Kolab_Storage_List_Query_Share */ private $_query; /** * The list cache. * * @var Horde_Kolab_Storage_Cache_List */ private $_list_cache; /** * The cached share descriptions. * * @var array */ private $_descriptions; /** * The cached share parameters. * * @var array */ private $_parameters; /** * Constructor. * * @param Horde_Kolab_Storage_List_Query_Share $query The underlying share query. * @param Horde_Kolab_Storage_List_Cache $cache The list cache. */ public function __construct(Horde_Kolab_Storage_List_Query_Share $query, Horde_Kolab_Storage_List_Cache $cache) { $this->_query = $query; $this->_list_cache = $cache; if ($this->_list_cache->hasQuery(self::DESCRIPTIONS)) { $this->_descriptions = $this->_list_cache->getQuery(self::DESCRIPTIONS); } else { $this->_descriptions = array(); } if ($this->_list_cache->hasLongTerm(self::PARAMETERS)) { $this->_parameters = $this->_list_cache->getLongTerm(self::PARAMETERS); } else { $this->_parameters = array(); } } /** * Returns the share description. * * @param string $folder The folder name. * * @return string The folder/share description. */ public function getDescription($folder) { if (!isset($this->_descriptions[$folder])) { $this->_descriptions[$folder] = $this->_query->getDescription($folder); $this->_list_cache->setQuery(self::DESCRIPTIONS, $this->_descriptions); $this->_list_cache->save(); } return $this->_descriptions[$folder]; } /** * Returns the share parameters. * * @param string $folder The folder name. * * @return string The folder/share parameters. */ public function getParameters($folder) { if (!isset($this->_parameters[$folder])) { $this->_parameters[$folder] = $this->_query->getParameters($folder); //@todo: This would only be long term data in case the IMAP is made private on the IMAP server $this->_list_cache->setLongTerm(self::PARAMETERS, $this->_parameters); $this->_list_cache->save(); } return $this->_parameters[$folder]; } /** * Returns the share description. * * @param string $folder The folder name. * @param string $description The share description. * * @return string The folder/share description. */ public function setDescription($folder, $description) { $this->_query->setDescription($folder, $description); $this->_descriptions[$folder] = $description; $this->_list_cache->setQuery(self::DESCRIPTIONS, $this->_descriptions); $this->_list_cache->save(); } /** * Returns the share parameters. * * @param string $folder The folder name. * @param array $parameters The share parameters. * * @return string The folder/share parameters. */ public function setParameters($folder, array $parameters) { $this->_query->setParameters($folder, $parameters); $this->_parameters[$folder] = $parameters; $this->_list_cache->setLongTerm(self::PARAMETERS, $this->_parameters); $this->_list_cache->save(); } /** * Update the listener after creating a new folder. * * @param string $folder The path of the folder that has been created. * @param string $type An optional type for the folder. * * @return NULL */ public function updateAfterCreateFolder($folder, $type = null) { } /** * Update the listener after deleting folder. * * @param string $folder The path of the folder that has been deleted. * * @return NULL */ public function updateAfterDeleteFolder($folder) { unset($this->_descriptions[$folder]); unset($this->_parameters[$folder]); $this->_list_cache->setQuery(self::DESCRIPTIONS, $this->_descriptions); $this->_list_cache->setLongTerm(self::PARAMETERS, $this->_parameters); $this->_list_cache->save(); } /** * Update the listener after renaming a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ public function updateAfterRenameFolder($old, $new) { if (isset($this->_descriptions[$old])) { $this->_descriptions[$new] = $this->_descriptions[$old]; unset($this->_descriptions[$old]); $this->_list_cache->setQuery(self::DESCRIPTIONS, $this->_descriptions); } if (isset($this->_parameters[$old])) { $this->_parameters[$new] = $this->_parameters[$old]; unset($this->_parameters[$old]); $this->_list_cache->setLongTerm(self::PARAMETERS, $this->_parameters); } $this->_list_cache->save(); } /** * Synchronize the ACL information with the information from the backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()) { $this->_descriptions = array(); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/Acl.php0000664000175000017500000000503512207101545023152 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Defines the ACL query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Query_Acl { /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ abstract public function hasAclSupport(); /** * Retrieve the access rights for a folder. This method will use two calls * to the backend. It will first get the individual user rights via * getMyRights and will subsequently fetch all ACL if the user has admin * rights on a folder. If you already know the user has admin rights on a * folder it makes more sense to call getAllAcl() directly. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ abstract public function getAcl($folder); /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ abstract public function getMyAcl($folder); /** * Retrieve the all access rights on a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return string The folder rights. */ abstract public function getAllAcl($folder); /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ abstract public function setAcl($folder, $user, $acl); /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ abstract public function deleteAcl($folder, $user); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/ActiveSync.php0000664000175000017500000000254212207101545024523 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The interface of the query for active sync settings. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Query_ActiveSync { /** * Returns the active sync settings. * * @param string $folder The folder name. * * @return array The folder active sync parameters. */ abstract public function getActiveSync($folder); /** * Set the active sync settings. * * @param string $folder The folder name. * @param array $data The active sync settings. * * @return string The encoded share parameters. */ abstract public function setActiveSync($folder, array $data); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/List.php0000664000175000017500000000620612207101545023367 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The interface of the basic list query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Query_List { /** The folder type annotation */ const ANNOTATION_FOLDER_TYPE = '/shared/vendor/kolab/folder-type'; /** * Returns the folder types as associative array. * * @return array The list folder types with the folder names as key and the * type as values. */ abstract public function listTypes(); /** * List basic folder data for the folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ abstract public function dataByType($type); /** * List basic folder data for the specified folder. * * @param string $folder The folder path. * * @return array The folder data. */ abstract public function folderData($folder); /** * List all folders of a specific type. * * @param string $type The folder type the listing should be limited to. * * @return array The list of folders. */ abstract public function listByType($type); /** * Get the folder owners. * * @return array The folder owners with the folder names as key and the * owner as values. */ abstract public function listOwners(); /** * Return the list of default folders. * * @return array An array with owners as keys and another array as * value. The second array associates type (key) with the * corresponding default folder (value). */ abstract public function listDefaults(); /** * Get the default folder for a certain type. * * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ abstract public function getDefault($type); /** * Get the default folder for a certain type from a different owner. * * @param string $owner The folder owner. * @param string $type The type of the share/folder. * * @return string|boolean The name of the default folder, false if there is no default. */ abstract public function getForeignDefault($owner, $type); /** * Return the last sync stamp. * * @return string The stamp. */ abstract public function getStamp(); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Query/Share.php0000664000175000017500000000352412207101545023516 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The interface of the share information query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Query_Share { /** * Returns the share description. * * @param string $folder The folder name. * * @return string The folder/share description. */ abstract public function getDescription($folder); /** * Returns the share parameters. * * @param string $folder The folder name. * * @return string The folder/share parameters. */ abstract public function getParameters($folder); /** * Returns the share description. * * @param string $folder The folder name. * @param string $description The share description. * * @return string The folder/share description. */ abstract public function setDescription($folder, $description); /** * Returns the share parameters. * * @param string $folder The folder name. * @param array $parameters The share parameters. * * @return string The folder/share parameters. */ abstract public function setParameters($folder, array $parameters); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Synchronization/Decorator/Log.php0000664000175000017500000000417512207101545027216 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Logs list synchronization requests. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Synchronization_Decorator_Log extends Horde_Kolab_Storage_List_Synchronization { /** * Decorated synchronization handler. * * @var Horde_Kolab_Storage_List_Synchronization */ private $_synchronization; /** * A log handler. * * @var mixed */ private $_logger; /** * Constructor. * * @param Horde_Kolab_Storage_List_Synchronization $synchronization The synchronization handler. * @param mixed $logger The log handler. This instance must provide the debug() method. */ public function __construct(Horde_Kolab_Storage_List_Synchronization $synchronization, $logger) { $this->_synchronization = $synchronization; $this->_logger = $logger; } /** * Inform all listeners about the synchronization call. */ public function synchronize() { $result = $this->_synchronization->synchronize(); $this->_logger->debug( sprintf('Synchronized the Kolab folder list!') ); } /** * Register a new synchronization listener. * * @param Horde_Kolab_Storage_List_Synchronization_Listener $listener The new listener. */ public function registerListener(Horde_Kolab_Storage_List_Synchronization_Listener $listener) { $this->_synchronization->registerListener($listener); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Synchronization/Base.php0000664000175000017500000000326712207101545025426 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Transmits a synchronization signal to all listeners caching information from * a Horde_Kolab_Storage_List. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Synchronization_Base extends Horde_Kolab_Storage_List_Synchronization { /** * The list of registered listeners. * * @var Horde_Kolab_Storage_List_Synchronization_Listener[] */ private $_listeners = array(); /** * Register a new synchronization listener. * * @param Horde_Kolab_Storage_List_Synchronization_Listener $listener The new listener. */ public function registerListener(Horde_Kolab_Storage_List_Synchronization_Listener $listener) { $this->_listeners[] = $listener; } /** * Inform all listeners about the synchronization call. */ public function synchronize() { foreach ($this->_listeners as $listener) { $listener->synchronize(); } } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Synchronization/Listener.php0000664000175000017500000000163112207101545026332 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Describes a synchronization listener. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_List_Synchronization_Listener { /** * Synchronize the listener. */ public function synchronize(); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Cache.php0000664000175000017500000002513012207101545022347 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A cache backend for Kolab storage list handlers. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Cache { /** Key for the folder list. */ const FOLDERS = 'F'; /** Key for the type list. */ const TYPES = 'T'; /** Key for the namespace data. */ const NAME_SPACE = 'N'; /** Key for the backend capabilities. */ const SUPPORT = 'C'; /** Holds query results. */ const QUERIES = 'Q'; /** Holds long term cache data. */ const LONG_TERM = 'L'; /** Key for the last time the list was synchronized. */ const SYNC = 'S'; /** Key for the cache format version. */ const VERSION = 'V'; /** Key for the connection ID associated with this list cache. */ const ID = 'I'; /** Holds the version number of the cache format. */ const FORMAT_VERSION = '1'; /** * The core cache driver. * * @var Horde_Kolab_Storage_Cache */ private $_cache; /** * List parameters that will be recorded in the cache. * * @var array */ private $_parameters; /** * List ID. * * @var string */ private $_list_id; /** * The list data. * * @var array */ private $_data = false; /** * Constructor. * * @param Horde_Kolab_Storage_Cache $cache The core cache driver. * @param array $parameters Connection parameters that * are only recorded and have * no further impact. */ public function __construct(Horde_Kolab_Storage_Cache $cache, $parameters = array()) { $this->_cache = $cache; $this->_parameters = $parameters; $this->_setListId(); } /** * Compose the list key. */ private function _setListId() { foreach (array('host', 'port', 'user') as $key) { $this->_cache->requireParameter($this->_parameters, 'list', $key); } ksort($this->_parameters); $this->_list_id = md5(serialize($this->_parameters)); } /** * Return the ID for the list cache. * * @return string The unique ID for the list used when caching it. */ public function getListId() { if ($this->_list_id === null) { throw new Horde_Kolab_Storage_Exception( 'You must set the ID of the list cache!' ); } return $this->_list_id; } /** * Retrieve the cached list data. * * @return mixed The data of the object. */ private function _load() { if ($this->_data === false) { $this->_data = unserialize($this->_cache->loadList($this->getListId())); if (!is_array($this->_data) || !isset($this->_data[self::SYNC]) || !isset($this->_data[self::VERSION]) || $this->_data[self::VERSION] != self::FORMAT_VERSION) { $this->_data = array(); } } } /** * Cache the list data. * * @return NULL */ public function save() { $this->_cache->storeList($this->getListId(), serialize($this->_data)); } /** * Check if the cache has been initialized. * * @return boolean True if cache data is available. */ public function isInitialized() { $this->_load(); return !empty($this->_data); } /** * Returns the last sync stamp. * * @return string The last sync stamp. */ public function getStamp() { $this->_load(); if (isset($this->_data[self::SYNC])) { return $this->_data[self::SYNC]; } return 0; } /** * Returns the list of folders from the cache. * * @return array The list of folders, represented as a list of strings. */ public function getFolders() { $this->_load(); if (isset($this->_data[self::FOLDERS])) { return $this->_data[self::FOLDERS]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Missing cache data (Key: %s). Synchronize first!', self::FOLDERS) ); } } /** * Returns if the folder type annotation is stored in the cache. * * @return boolean True if the type annotation is available. */ public function hasFolderTypes() { $this->_load(); if (isset($this->_data[self::TYPES])) { return true; } return false; } /** * Returns the folder type annotation from the cache. * * @return array The list folder types with the folder names as key and the * folder type as values. */ public function getFolderTypes() { if ($this->hasFolderTypes()) { return $this->_data[self::TYPES]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Missing cache data (Key: %s). Synchronize first!', self::TYPES) ); } } /** * Returns if the namespace information is available. * * @return boolean True if the information exists in the cache. */ public function hasNamespace() { $this->_load(); return isset($this->_data[self::NAME_SPACE]); } /** * Return namespace information. * * @return mixed The namespace data. */ public function getNamespace() { if ($this->hasNamespace()) { return $this->_data[self::NAME_SPACE]; } else { throw new Horde_Kolab_Storage_Exception( 'Missing namespace data. Synchronize first!' ); } } /** * Set namespace information. * * @param mixed $data The namespace data. * * @return NULL */ public function setNamespace($data) { $this->_load(); $this->_data[self::NAME_SPACE] = $data; } /** * Has the capability support already been cached? * * @return boolean True if the value is already in the cache. */ public function issetSupport($capability) { $this->_load(); return isset($this->_data[self::SUPPORT][$capability]); } /** * Has the list support for the requested capability? * * @param string $capability The name of the requested capability. * * @return boolean True if the backend supports the requested capability. */ public function hasSupport($capability) { if ($this->issetSupport($capability)) { return $this->_data[self::SUPPORT][$capability]; } else { throw new Horde_Kolab_Storage_Exception( 'Missing support data. Synchronize first!' ); } } /** * Set if the list supports the given capability. * * @param string $capability The name of the requested capability. * @param boolean $flag True if the capability is supported. * * @return NULL */ public function setSupport($capability, $flag) { $this->_load(); $this->_data[self::SUPPORT][$capability] = $flag; } /** * Is the specified query data available in the cache? * * @param string $key The query key. * * @return boolean True in case cached data is available. */ public function hasQuery($key) { $this->_load(); return isset($this->_data[self::QUERIES][$key]); } /** * Return query information. * * @param string $key The query key. * * @return mixed The query data. */ public function getQuery($key) { if ($this->hasQuery($key)) { return $this->_data[self::QUERIES][$key]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Missing query cache data (Key: %s). Synchronize first!', $key) ); } } /** * Set query information. * * @param string $key The query key. * @param mixed $data The query data. * * @return NULL */ public function setQuery($key, $data) { $this->_load(); $this->_data[self::QUERIES][$key] = $data; } /** * Is the specified long term data available in the cache? * * @param string $key The long term key. * * @return boolean True in case cached data is available. */ public function hasLongTerm($key) { $this->_load(); return isset($this->_data[self::LONG_TERM][$key]); } /** * Return long term information. * * @param string $key The long term key. * * @return mixed The long term data. */ public function getLongTerm($key) { if ($this->hasLongTerm($key)) { return $this->_data[self::LONG_TERM][$key]; } else { throw new Horde_Kolab_Storage_Exception( sprintf('Missing long term cache data (Key: %s). Synchronize first!', $key) ); } } /** * Set long term information. * * @param string $key The long term key. * @param mixed $data The long term data. * * @return NULL */ public function setLongTerm($key, $data) { $this->_load(); $this->_data[self::LONG_TERM][$key] = $data; } /** * Store the folder list and folder type annotations in the cache. * * @return NULL */ public function store(array $folders = null, array $types = null) { $this->_load(); $this->_data[self::QUERIES] = array(); $this->_data[self::FOLDERS] = $folders; $this->_data[self::TYPES] = $types; $this->_data[self::VERSION] = self::FORMAT_VERSION; $this->_data[self::ID] = serialize($this->_parameters); $this->_data[self::SYNC] = pack('Nn', time(), mt_rand()); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Exception.php0000664000175000017500000000162312207101545023303 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The exception marker for list specific Horde_Kolab_Storage errors. * * Copyright 2009-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Exception extends Horde_Kolab_Storage_Exception { } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Manipulation.php0000664000175000017500000000416512207101545024011 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Describes Kolab folder list manipulators. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Manipulation { /** * Create a new folder. * * @param string $folder The path of the folder to create. * @param string $type An optional type for the folder. * * @return NULL */ abstract public function createFolder($folder, $type = null); /** * Delete a folder. * * WARNING: Do not use this call in case there is still data present in the * folder. You are required to empty any data set *before* removing the * folder. Otherwise there is no guarantee you can adhere to that Kolab * specification that might require the triggering of remote systems to * inform them about the removal of the folder. * * @param string $folder The path of the folder to delete. * * @return NULL */ abstract public function deleteFolder($folder); /** * Rename a folder. * * @param string $old The old path of the folder. * @param string $new The new path of the folder. * * @return NULL */ abstract public function renameFolder($old, $new); /** * Register a new manipulation listener. * * @param Horde_Kolab_Storage_List_Manipulation_Listener $listener The new listener. */ abstract public function registerListener(Horde_Kolab_Storage_List_Manipulation_Listener $listener); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Synchronization.php0000664000175000017500000000231412207101545024544 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Describes the synchronization handler. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_List_Synchronization { /** * Register a new synchronization listener. * * @param Horde_Kolab_Storage_List_Synchronization_Listener $listener The new listener. */ abstract public function registerListener(Horde_Kolab_Storage_List_Synchronization_Listener $listener); /** * Inform all listeners about the synchronization call. */ abstract public function synchronize(); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/List/Tools.php0000664000175000017500000002240612207101545022447 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Manages and provides the toolset available for dealing with the list of Kolab folders. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_List_Tools { /** Identifies the basic list query */ const QUERY_BASE = 'List'; /** Identifies the ACL query */ const QUERY_ACL = 'Acl'; /** Identifies the share query */ const QUERY_SHARE = 'Share'; /** The collection of list queries currently supported */ static private $_supported_queries = array( self::QUERY_BASE, self::QUERY_ACL, self::QUERY_SHARE ); /** * The driver for accessing the Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * The Kolab Storage data cache. * * @var Horde_Kolab_Storage_Cache */ private $_cache; /** * The list specific cache. * * @var Horde_Kolab_Storage_List_Cache */ private $_list_cache; /** * A logger. * * @var Horde_Log_Logger */ private $_logger; /** * Parameters for constructing the various tools. * * @var array */ private $_params; /** * The handler for list manipulations. * * @var Horde_Kolab_Storage_List_Manipulation */ private $_manipulation; /** * The handler for synchronizing with the backend. * * @var Horde_Kolab_Storage_List_Synchronization */ private $_synchronization; /** * The queries currently registered. * * @var array */ private $_queries; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $driver The backend driver. * @param Horde_Kolab_Storage_Cache $cache The cache. * @param Horde_Log_Logger $logger A logger. * @param array $params */ public function __construct(Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Cache $cache, $logger, $params = array()) { $this->_driver = $driver; $this->_cache = $cache; $this->_logger = $logger; $this->_params = $params; $this->_prepareManipulationHandler(); $this->_prepareSynchronizationHandler(); $this->_prepareListCache(); $this->_prepareQueries(); } /** * Setup for the manipulation handler. */ private function _prepareManipulationHandler() { $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($this->_driver); if (isset($this->_params['log']) && (in_array('debug', $this->_params['log']) || in_array('list_manipulation', $this->_params['log']))) { $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $manipulation, $this->_logger ); } $this->_manipulation = $manipulation; } /** * Setup for the synchronization handler. */ private function _prepareSynchronizationHandler() { $synchronization = new Horde_Kolab_Storage_List_Synchronization_Base($this->_driver); if (isset($this->_params['log']) && (in_array('debug', $this->_params['log']) || in_array('list_synchronization', $this->_params['log']))) { $synchronization = new Horde_Kolab_Storage_List_Synchronization_Decorator_Log( $synchronization, $this->_logger ); } $this->_synchronization = $synchronization; } /** * Setup the list cache. */ private function _prepareListCache() { $this->_list_cache = new Horde_Kolab_Storage_List_Cache( $this->_cache, $this->_driver->getParameters() ); } /** * Setup the queries. */ private function _prepareQueries() { if (isset($this->_params['queries']['list'])) { $query_list = array_keys($this->_params['queries']['list']); } else { $query_list = array(self::QUERY_BASE); } foreach ($query_list as $query) { $method = '_prepare' . $query . 'Query'; if (isset($this->_params['queries']['list'][$query])) { $this->{$method}($this->_params['queries']['list'][$query]); } else { $this->{$method}(); } } } /** * Prepare the general list query. * * @param array $params Query specific configuration parameters. */ private function _prepareListQuery($params = null) { if (!empty($params['defaults_bail'])) { $defaults = new Horde_Kolab_Storage_List_Query_List_Defaults_Bail(); } else { $defaults = new Horde_Kolab_Storage_List_Query_List_Defaults_Log( $this->_logger ); } if (empty($params['cache'])) { $this->_queries[self::QUERY_BASE] = new Horde_Kolab_Storage_List_Query_List_Base( $this->_driver, new Horde_Kolab_Storage_Folder_Types(), $defaults ); } else { $this->_queries[self::QUERY_BASE] = new Horde_Kolab_Storage_List_Query_List_Cache( new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $this->_driver, new Horde_Kolab_Storage_Folder_Types(), $defaults ), $this->_list_cache ); $this->_synchronization->registerListener($this->_queries[self::QUERY_BASE]); $this->_manipulation->registerListener($this->_queries[self::QUERY_BASE]); } } /** * Prepare the ACL query. * * @param array $params Query specific configuration parameters. */ private function _prepareAclQuery($params = null) { $this->_queries[self::QUERY_ACL] = new Horde_Kolab_Storage_List_Query_Acl_Base( $this->_driver ); if (!empty($params['cache'])) { $this->_queries[self::QUERY_ACL] = new Horde_Kolab_Storage_List_Query_Acl_Cache( $this->_queries[self::QUERY_ACL], $this->_list_cache ); $this->_synchronization->registerListener($this->_queries[self::QUERY_ACL]); $this->_manipulation->registerListener($this->_queries[self::QUERY_ACL]); } } /** * Prepare the query for shares. * * @param array $params Query specific configuration parameters. */ private function _prepareShareQuery($params = null) { $this->_queries[self::QUERY_SHARE] = new Horde_Kolab_Storage_List_Query_Share_Base( $this->_driver ); if (!empty($params['cache'])) { $this->_queries[self::QUERY_SHARE] = new Horde_Kolab_Storage_List_Query_Share_Cache( $this->_queries[self::QUERY_SHARE], $this->_list_cache ); $this->_synchronization->registerListener($this->_queries[self::QUERY_SHARE]); $this->_manipulation->registerListener($this->_queries[self::QUERY_SHARE]); } } /** * Return the ID of the underlying connection. * * @return string The connection ID. */ public function getId() { return $this->_driver->getId(); } /** * Return the namespace handler for the underlying connection. * * @return Horde_Kolab_Storage_Folder_Namespace The namespace handler. */ public function getNamespace() { return $this->_driver->getNamespace(); } /** * Return the handler for list manipulations. */ public function getListManipulation() { return $this->_manipulation; } /** * Return the handler for list synchronizations. */ public function getListSynchronization() { return $this->_synchronization; } /** * Return a query object. * * @param string $type The query type that should be returned. */ public function getQuery($type = null) { if ($type === null) { $type = self::QUERY_BASE; } if (!in_array($type, self::$_supported_queries)) { throw new Horde_Kolab_Storage_List_Exception( sprintf("Queries of type '%s' are not supported!", $type) ); } if (!isset($this->_queries[$type])) { throw new Horde_Kolab_Storage_List_Exception( sprintf("No query of type '%s' registered!", $type) ); } return $this->_queries[$type]; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Object/Writer/Format.php0000664000175000017500000000603112207101545024342 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Converts between Kolab MIME parts and data arrays. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Object_Writer_Format extends Horde_Kolab_Storage_Object_Writer { /** * The format parser factory. * * @var Horde_Kolab_Format_Factory */ private $_factory; /** * Additional parameters for the format parsers. * * @var array */ private $_params; /** * Holds a parser instance per object type. * * @var array */ private $_formats; /** * Condtructor. * * @param Horde_Kolab_Format_Factory $factory The parser factory. * @param array $params Additional parameters for the format parsers. */ public function __construct(Horde_Kolab_Format_Factory $factory, $params = array()) { $this->_factory = $factory; $this->_params = $params; } /** * Convert the object content into a data structure and update the object * accordingly. * * @param resource $content The raw content from the object. * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data. */ public function load($content, Horde_Kolab_Storage_Object $object) { try { $object->setData($this->_getParser($object->getType())->load($content)); return true; } catch (Horde_Kolab_Format_Exception $e) { $object->setContent($content); return $e; } } /** * Return the object data in a form that it can be stored in the backend. * * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data. * * @return resource The encoded object data, ready to be written into the * backend. */ public function save(Horde_Kolab_Storage_Object $object) { try { return $this->_getParser($object->getType())->save($object->getData(), array('previous' => $object->getCurrentContent())); } catch (Horde_Kolab_Format_Exception $e) { throw new Horde_Kolab_Storage_Object_Exception( sprintf('Failed writing the Kolab object: %s', $e->getMessage()) ); } } private function _getParser($type) { return $this->_factory->create('Xml', $type, $this->_params); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Object/Writer/Raw.php0000664000175000017500000000327412207101545023651 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Keeps Kolab MIME part content as unmodified string. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Object_Writer_Raw extends Horde_Kolab_Storage_Object_Writer { /** * Convert the object content into a data structure and update the object * accordingly. * * @param resource $content The raw content from the object. * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data. */ public function load($content, Horde_Kolab_Storage_Object $object) { $object->setContent($content); } /** * Return the object data in a form that it can be stored in the backend. * * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data. * * @return resource The encoded object data, ready to be written into the * backend. */ public function save(Horde_Kolab_Storage_Object $object) { return $object->getContent(); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Object/Exception.php0000664000175000017500000000164312207101545023600 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The exception marker for data specific Horde_Kolab_Storage_Object errors. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Object_Exception extends Horde_Kolab_Storage_Exception { } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Object/MimeType.php0000664000175000017500000001455612207101545023402 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Mime type handling for Kolab objects. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Object_MimeType { private static $_object_types = array( 'contact' => 'application/x-vnd.kolab.contact', 'distribution-list' => 'application/x-vnd.kolab.contact.distlist', 'event' => 'application/x-vnd.kolab.event', 'journal' => 'application/x-vnd.kolab.journal', 'note' => 'application/x-vnd.kolab.note', 'task' => 'application/x-vnd.kolab.task', 'configuration' => 'application/x-vnd.kolab.configuration', 'h-prefs' => 'application/x-vnd.kolab.h-prefs', 'h-ledger' => 'application/x-vnd.kolab.h-ledger' ); private static $_folder_types = array( 'contact' => array( 'application/x-vnd.kolab.contact', 'application/x-vnd.kolab.contact.distlist' ), 'event' => array('application/x-vnd.kolab.event'), 'journal' => array('application/x-vnd.kolab.journal'), 'note' => array('application/x-vnd.kolab.note'), 'task' => array('application/x-vnd.kolab.task'), 'h-prefs' => array('application/x-vnd.kolab.h-prefs'), 'h-ledger' => array('application/x-vnd.kolab.h-ledger') ); /** * Determine the mime type given the object type. * * @param string $type The object type. * * @return string The mime type associated to the object type. */ static public function getMimeTypeFromObjectType($type) { if (isset(self::$_object_types[$type])) { return self::$_object_types[$type]; } else { throw new Horde_Kolab_Storage_Data_Exception( sprintf('Unsupported object type %s!', $type) ); } } /** * Try to determine the MIME part that carries the object of the specified type. * * @param Horde_Mime_Part $structure A structural representation of the mime message. * @param string $type The object type. * * @return string|boolean The MIME ID of the message part carrying the object of the specified type or false if such a part was not identified within the message. */ static public function matchMimePartToObjectType(Horde_Mime_Part $structure, $type) { return array_search( self::getMimeTypeFromObjectType($type), $structure->contentTypeMap() ); } /** * Determine the mime type given the type of the folder that holds the object. * * @param string $type The folder type. * * @return array The mime types associated to the folder type. */ static public function getMimeTypesFromFolderType($type) { if (isset(self::$_folder_types[$type])) { return self::$_folder_types[$type]; } else { throw new Horde_Kolab_Storage_Data_Exception( sprintf('Unsupported folder type %s!', $type) ); } } /** * Try to determine the MIME part that carries an object matching the specified folder type. * * @param Horde_Mime_Part $structure A structural representation of the mime message. * @param string $type The folder type. * * @return string|boolean The MIME ID of the message part carrying an object matching the specified folder type or false if such a part was not identified within the message. */ static public function matchMimePartToFolderType(Horde_Mime_Part $structure, $type) { $mime_types = self::getMimeTypesFromFolderType($type); $id = false; foreach ($mime_types as $mime_type) { $id = array_search( $mime_type, $structure->contentTypeMap() ); if ($id) { return array( $id, self::getObjectTypeFromMimeType($mime_type) ); } } return false; } /** * Try to determine the MIME part that carries an object matching based on the message headers. * * @param Horde_Mime_Part $structure A structural representation of the mime message. * @param Horde_Mime_Headers $headers The message headers. * * @return string|boolean The MIME ID of the message part carrying an object matching the message headers or false if such a part was not identified within the message. */ static public function matchMimePartToHeaderType(Horde_Mime_Part $structure, Horde_Mime_Headers $headers) { $mime_type = $headers->getValue('X-Kolab-Type'); if ($mime_type === null) { return false; } return array( array_search($mime_type, $structure->contentTypeMap()), self::getObjectTypeFromMimeType($mime_type) ); } /** * Determine the object type based on a specific MIME part that carries a Kolab object. * * @param Horde_Mime_Part $structure A structural representation of the mime message. * @param string $id The MIME part carrying the Kolab object. * * @return string|boolean The object type or false if no matching object type was found. */ static public function getObjectTypeFromMimePart(Horde_Mime_Part $structure, $id) { return self::getObjectTypeFromMimeType($structure->getPart($id)->getType()); } /** * Determine the object type based on the mime type of a Kolab object. * * @param string $mime_type The MIME type of the Kolab object. * * @return string|boolean The object type or false if no matching object type was found. */ static public function getObjectTypeFromMimeType($mime_type) { return array_search($mime_type, self::$_object_types); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Object/Writer.php0000664000175000017500000000314412207101545023114 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles the conversion of Kolab MIME part contents to data arrays. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_Object_Writer { /** * Convert the object content into a data structure and update the object * accordingly. * * @param resource $content The raw content from the object. * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data. */ abstract public function load($content, Horde_Kolab_Storage_Object $object); /** * Return the object data in a form that it can be stored in the backend. * * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data. * * @return resource The encoded object data, ready to be written into the * backend. */ abstract public function save(Horde_Kolab_Storage_Object $object); }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/QuerySet/Base.php0000664000175000017500000001453612207101545023074 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Adds a set of uncached queries to the list handlers. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_QuerySet_Base implements Horde_Kolab_Storage_QuerySet { /** Query set identifiers */ const BASIC = 'basic'; const HORDE = 'horde'; /** * The factory for generating additional resources. * * @var Horde_Kolab_Storage_Factory */ private $_factory; /** * The list of query types to add to lists. * * @var array */ private $_list_queries = array(); /** * The list of query types to add to data handlers. * * @var array */ private $_data_queries = array(); /** * The query class map. Override in extending classes. * * @var array */ protected $_class_map = array(); /** * Predefined query sets. * * @var array */ private $_data_query_sets = array( self::HORDE => array( Horde_Kolab_Storage_Data::QUERY_PREFS => 'h-prefs', Horde_Kolab_Storage_Data::QUERY_HISTORY => true, ) ); /** * Constructor. * * @param Horde_Kolab_Storage_Factory $factory The factory. * @param array $params Optional parameters. *
     * - list: Array of list query settings
     *   - queryset [string]: One of the predefined query set
     *                        ("basic" or "horde")
     *   - myset    [string]: A list of query types that should be selected.
     *   - classmap [array] : An array of "type" => "class" mappings.
     * 
*/ public function __construct(Horde_Kolab_Storage_Factory $factory, array $params = array()) { $this->_factory = $factory; if (isset($params['data']['queryset'])) { if (isset($this->_data_query_sets[$params['data']['queryset']])) { $this->_data_queries = $this->_data_query_sets[$params['data']['queryset']]; } else { throw new Horde_Kolab_Storage_Exception( sprintf( 'Data query set %s not supported!', $params['data']['queryset'] ) ); } } if (isset($params['data']['myset'])) { $this->_data_queries = array_merge($this->_data_queries, $params['data']['myset']); } } /** * Add the set of data queries. * * @param Horde_Kolab_Storage_Data $data The data. * @param array $params Additional query parameters. * * @return NULL */ public function addDataQuerySet(Horde_Kolab_Storage_Data $data, $params = array()) { foreach ($this->_data_queries as $query => $type) { if ($type === true || $type == $data->getType()) { $this->_addDataQuery($data, $query, $params); } } } /** * Add a data query. * * @param Horde_Kolab_Storage_Data $data The data. * @param string $type The query type. * @param array $params Additional query parameters. * * @return NULL */ private function _addDataQuery(Horde_Kolab_Storage_Data $data, $type, $params = array()) { if (isset($this->_class_map[$type])) { $params = array_merge( $this->_getDataQueryParameters($data), $params ); $data->registerQuery( $type, $this->_createDataQuery( $this->_class_map[$type], $data, $params ) ); } else { throw new Horde_Kolab_Storage_Exception( sprintf('Query type %s not supported!', $type) ); } } /** * Fetch any additional parameters required when creating data queries. * * @param Horde_Kolab_Storage_Data $data The data. * * @return array The parameters for data queries. */ abstract protected function _getDataQueryParameters( Horde_Kolab_Storage_Data $data ); /** * Create the specified data query type. * * @param string $name The query name. * @param Horde_Kolab_Storage_Data $data The data that should be queried. * @param array $params Additional parameters provided * to the query constructor. * * @return Horde_Kolab_Storage_Query A query handler. * * @throws Horde_Kolab_Storage_Exception In case the requested query is not supported. */ private function _createDataQuery($name, Horde_Kolab_Storage_Data $data, $params = array()) { return $this->_createQuery($name, $data, $params); } /** * Create the specified query type. * * @param string $name The query name. * @param mixed $data The data that should be queried. * @param array $params Additional parameters provided * to the query constructor. * * @return Horde_Kolab_Storage_Query A query handler. * * @throws Horde_Kolab_Storage_Exception In case the requested query is not supported. */ private function _createQuery($name, $data, $params = array()) { if (class_exists($name)) { $constructor_params = array_merge( array('factory' => $this->_factory), $params ); $query = new $name($data, $constructor_params); } else { throw new Horde_Kolab_Storage_Exception(sprintf('No such query "%s"!', $name)); } return $query; } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/QuerySet/Cached.php0000664000175000017500000000435412207101545023366 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Adds a set of cached queries to the list handlers. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_QuerySet_Cached extends Horde_Kolab_Storage_QuerySet_Base { /** * The query class map. * * @var array */ protected $_class_map = array( Horde_Kolab_Storage_Data::QUERY_PREFS => 'Horde_Kolab_Storage_Data_Query_Preferences_Cache', Horde_Kolab_Storage_Data::QUERY_HISTORY => 'Horde_Kolab_Storage_Data_Query_History_Cache', ); /** * The cache. * * @var Horde_Kolab_Storage_Cache */ private $_cache; /** * Constructor. * * @param Horde_Kolab_Storage_Factory $factory The factory. * @param array $params Optional parameters. * @param Horde_Kolab_Storage_Cache $cache The cache. */ public function __construct(Horde_Kolab_Storage_Factory $factory, array $params = array(), Horde_Kolab_Storage_Cache $cache = null) { parent::__construct($factory, $params); $this->_cache = $cache; } /** * Fetch any additional parameters required when creating data queries. * * @param Horde_Kolab_Storage_Data $data The data. * * @return array The parameters for data queries. */ protected function _getDataQueryParameters(Horde_Kolab_Storage_Data $data) { return array( 'cache' => $this->_cache->getDataCache( $data->getIdParameters() ) ); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/QuerySet/Uncached.php0000664000175000017500000000300112207101545023715 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Adds a set of uncached queries to the list handlers. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_QuerySet_Uncached extends Horde_Kolab_Storage_QuerySet_Base { /** * The query class map. * * @var array */ protected $_class_map = array( Horde_Kolab_Storage_Data::QUERY_PREFS => 'Horde_Kolab_Storage_Data_Query_Preferences_Base', Horde_Kolab_Storage_Data::QUERY_HISTORY => 'Horde_Kolab_Storage_Data_Query_History_Base', ); /** * Fetch any additional parameters required when creating data queries. * * @param Horde_Kolab_Storage_Data $data The data. * * @return array The parameters for data queries. */ protected function _getDataQueryParameters(Horde_Kolab_Storage_Data $data) { return array(); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Synchronization/OncePerSession.php0000664000175000017500000000411412207101545026530 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Synchronization strategy that synchronizes once per session with the backend. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Synchronization_OncePerSession extends Horde_Kolab_Storage_Synchronization { /** * Constructor. */ public function __construct() { } /** * Synchronize the provided list in case the selected synchronization * strategy requires it. * * @param Horde_Kolab_Storage_List $list The list to synchronize. */ public function synchronizeList(Horde_Kolab_Storage_List_Tools $list) { $list_id = $list->getId(); if (empty($_SESSION['kolab_storage']['synchronization']['list'][$list_id])) { $list->getListSynchronization()->synchronize(); $_SESSION['kolab_storage']['synchronization']['list'][$list_id] = true; } } /** * Synchronize the provided data in case the selected synchronization * strategy requires it. * * @param Horde_Kolab_Storage_Data $data The data to synchronize. */ public function synchronizeData(Horde_Kolab_Storage_Data $data) { $data_id = $data->getId(); if (empty($_SESSION['kolab_storage']['synchronization']['data'][$data_id])) { $data->synchronize(); $_SESSION['kolab_storage']['synchronization']['data'][$data_id] = true; } } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Synchronization/TimeBased.php0000664000175000017500000000732712207101545025477 0ustar janjan * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Synchronization strategy that synchronizes at certain intervals. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @author Thomas Jarosch * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Synchronization_TimeBased extends Horde_Kolab_Storage_Synchronization { /** * Kolab object cache resync interval with the IMAP server (in seconds). * Default: Two minutes * * @var int */ private $_interval; /** * Random offset added to each folder sync interval to prevent mass sync * every XX minutes. Otherwise UI latency might get too high. * * @var int */ private $_random_offset; /** * Constructor. * * @param int $interval Kolab object cache resync interval with the IMAP server (in seconds). * @param int $random_offset Random offset added to each folder sync interval. */ public function __construct($interval = 120, $random_offset = 90) { $this->_interval = $interval; $this->_random_offset = $random_offset; } /** * Synchronize the provided list in case the selected synchronization * strategy requires it. * * @param Horde_Kolab_Storage_List $list The list to synchronize. */ public function synchronizeList(Horde_Kolab_Storage_List_Tools $list) { $list_id = $list->getId(); if (empty($_SESSION['kolab_storage']['synchronization']['list'][$list_id])) { $list->getListSynchronization()->synchronize(); $_SESSION['kolab_storage']['synchronization']['list'][$list_id] = true; } } /** * Synchronize the provided data in case the selected synchronization * strategy requires it. * * @param Horde_Kolab_Storage_Data $data The data to synchronize. */ public function synchronizeData(Horde_Kolab_Storage_Data $data) { $data_id = $data->getId(); if ($this->hasNotBeenSynchronizedYet($data_id) || $this->syncTimeHasElapsed($data_id)) { $data->synchronize(); $_SESSION['kolab_storage']['synchronization']['data'][$data_id] = time() + $this->_interval + rand(0, $this->_random_offset); } } /** * Check if the data store with the given data ID has been synchronized already during this session. * * @param string $data_id The ID of the data store. * * @return boolean True, if the store has not been synchronized yet. */ private function hasNotBeenSynchronizedYet($data_id) { return empty($_SESSION['kolab_storage']['synchronization']['data'][$data_id]); } /** * Check if the data store with the given data ID need to be resynchronized with the backend. * * @param string $data_id The ID of the data store. * * @return boolean True, if the store needs to be synchronized again. */ private function syncTimeHasElapsed($data_id) { return $_SESSION['kolab_storage']['synchronization']['data'][$data_id] < time(); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Base.php0000664000175000017500000001705112207101545021306 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The basis for Kolab storage access. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ abstract class Horde_Kolab_Storage_Base implements Horde_Kolab_Storage { /** * The master Kolab storage system. * * @var Horde_Kolab_Storage_Driver */ private $_master; /** * The query handler. * * @var Horde_Kolab_Storage_QuerySet */ private $_query_set; /** * The factory for generating additional resources. * * @var Horde_Kolab_Storage_Factory */ private $_factory; /** * The cache. * * @var Horde_Kolab_Storage_Cache */ protected $_cache; /** * A logger. * * @var Horde_Log_Logger */ private $_logger; /** * Additional parameters. * * @var array */ private $_params; /** * List instances. * * @var array */ private $_lists; /** * Data instances. * * @var array */ private $_data; /** * Constructor. * * @param Horde_Kolab_Storage_Driver $master The primary connection * driver. * @param Horde_Kolab_Storage_QuerySet $query_set The query handler. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param Horde_Kolab_Storage_Cache $cache The cache. * @param Horde_Log_Logger $logger A logger. * @param array $params Additional parameters. */ public function __construct(Horde_Kolab_Storage_Driver $master, Horde_Kolab_Storage_QuerySet $query_set, Horde_Kolab_Storage_Factory $factory, Horde_Kolab_Storage_Cache $cache, $logger, array $params = array()) { $this->_master = $master; $this->_query_set = $query_set; $this->_factory = $factory; $this->_cache = $cache; $this->_logger = $logger; $this->_params = $params; } /** * Get a folder list object for a "system" user. * * @param string $type The type of system user. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getSystemList($type) { if (!isset($this->_params['system'][$type])) { if (!isset($this->_params['system'][''])) { throw new Horde_Kolab_Storage_Exception( 'No system users are available!' ); } else { $params = $this->_params['system']['']; } } else { $params = $this->_params['system'][$type]; } return $this->getList( $this->_factory->createDriver(array('params' => $params)) ); } /** * Get the folder list object. * * @params Horde_Kolab_Storage_Driver $driver Optional driver as backend * for the list. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getList(Horde_Kolab_Storage_Driver $driver = null) { if ($driver === null) { $driver = $this->_master; } if (!isset($this->_lists[$driver->getId()])) { $this->_lists[$driver->getId()] = new Horde_Kolab_Storage_List_Tools( $driver, $this->_cache, $this->_logger, $this->_params ); } return $this->_lists[$driver->getId()]; } /** * Get a Folder object. * * @param string $folder The folder name. * * @return Horde_Kolab_Storage_Folder The Kolab folder object. */ public function getFolder($folder) { return new Horde_Kolab_Storage_Folder_Base( $this->getList()->getQuery( Horde_Kolab_Storage_List_Tools::QUERY_BASE ), $folder ); } /** * Return a data handler for accessing data in the specified folder. * * @param mixed $folder The name of the folder or an instance * representing the folder. * @param string $object_type The type of data we want to access in the * folder. * @param int $data_version Format version of the object data. * * @return Horde_Kolab_Storage_Data The data object. */ public function getData($folder, $object_type = null, $data_version = 1) { if ($folder instanceOf Horde_Kolab_Storage_Folder) { $folder_key = $folder->getPath(); } else { $folder_key = $folder; } $key = join( '@', array( $data_version, $object_type, $folder_key, $this->_master->getId() ) ); if (!isset($this->_data[$key])) { if (!$folder instanceOf Horde_Kolab_Storage_Folder) { $folder = $this->getFolder($folder); } $this->_data[$key] = $this->_createData( $folder, $this->_master, $this->_factory, $object_type, $data_version ); if (isset($this->_params['logger'])) { $this->_data[$key] = new Horde_Kolab_Storage_Data_Decorator_Log( $this->_data[$key], $this->_params['logger'] ); } $this->_query_set->addDataQuerySet($this->_data[$key]); } return $this->_data[$key]; } /** * Return a data handler for accessing data in the specified folder. * * @param mixed $folder The name of the folder or * an instance representing * the folder. * @param Horde_Kolab_Storage_Driver $master The primary connection * driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param string $object_type The type of data we want * to access in the folder. * @param int $data_version Format version of the * object data. * * @return Horde_Kolab_Data The data object. */ abstract protected function _createData( $folder, Horde_Kolab_Storage_Driver $master, Horde_Kolab_Storage_Factory $factory, $object_type = null, $data_version = 1 ); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Cache.php0000664000175000017500000001473212207101545021442 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Kolab_Cache class provides a cache for Kolab groupware objects. * * The Horde_Kolab_Storage_Cache singleton instance provides caching for all * storage folders. So before operating on the cache data it is necessary to * load the desired folder data. Before switching the folder the cache data * should be saved. * * This class does not offer a lot of safeties and is primarily intended to be * used within the Horde_Kolab_Storage_Data class. * * Copyright 2007-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Cache { /** * The link to the horde cache. * * @var Horde_Cache */ protected $horde_cache; /** * List cache instances. * * @var array */ private $_list_caches; /** * Data cache instances. * * @var array */ private $_data_caches; /** * Constructor. * * @param Horde_Cache $cache The global cache for temporary data storage. */ public function __construct($cache) { $this->horde_cache = $cache; } /** * Return a data cache. * * @param array $data_params Return the data cache for a data set * with these parameters. * * @return Horde_Kolab_Storage_Cache_Data The data cache. */ public function getDataCache($data_params) { $data_id = $this->_getDataId($data_params); if (!isset($this->_data_caches[$data_id])) { $this->_data_caches[$data_id] = new Horde_Kolab_Storage_Cache_Data( $this, $data_params ); $this->_data_caches[$data_id]->setDataId($data_id); } return $this->_data_caches[$data_id]; } /** * Retrieve data set. * * @param string $data_id ID of the data set. * * @return string The cached data set. */ public function loadData($data_id) { return $this->horde_cache->get($data_id, 0); } /** * Cache data set. * * @param string $data_id ID of the data set. * @param string $data The data to be cached. * * @return NULL */ public function storeData($data_id, $data) { $this->horde_cache->set($data_id, $data, 0); } /** * Retrieve an attachment. * * @param string $data_id ID of the data set. * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * * @return resource A stream opened to the attachement data. */ public function loadAttachment($data_id, $obid, $attachment_id) { return $this->horde_cache->get( $this->_getAttachmentId($data_id, $obid, $attachment_id), 0 ); } /** * Store an attachment. * * @param string $data_id ID of the data set. * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * @param resource $data A stream opened to the attachement data. * * @return NULL */ public function storeAttachment($data_id, $obid, $attachment_id, $data) { $this->horde_cache->set( $this->_getAttachmentId($data_id, $obid, $attachment_id), $data, 0 ); } /** * Delete a cached attachment. * * @param string $data_id ID of the data set. * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * * @return NULL */ public function deleteAttachment($data_id, $obid, $attachment_id) { return $this->horde_cache->expire( $this->_getAttachmentId($data_id, $obid, $attachment_id) ); } /** * Retrieve list data. * * @param string $list_id ID of the connection matching the list. * * @return string The data of the object. */ public function loadList($list_id) { return $this->horde_cache->get($list_id, 0); } /** * Cache list data. * * @param string $list_id ID of the connection matching the list. * @param string $data The data to be cached. * * @return NULL */ public function storeList($list_id, $data) { $this->horde_cache->set($list_id, $data, 0); } /** * Compose the data key. * * @param array $data_params Return the data ID for a data set with these * parameters. * * @return string The data cache ID. */ private function _getDataId($data_params) { foreach (array('host', 'port', 'prefix', 'folder', 'type', 'owner') as $key) { $this->requireParameter($data_params, 'data', $key); } ksort($data_params); return md5(serialize($data_params)); } /** * Compose the attachment key. * * @param string $data_id ID of the data set. * @param string $obid Object backend id. * @param string $attachment_id Attachment ID. * * @return string The attachment cache ID. */ private function _getAttachmentId($data_id, $obid, $attachment_id) { return md5( serialize(array('d' => $data_id, 'o' => (string)$obid, 'p' => (string)$attachment_id)) ); } /** * Determine if a necessary parameter is set. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case the parameter is missing. */ public function requireParameter($parameters, $type, $key) { if (!isset($parameters[$key])) { throw new Horde_Kolab_Storage_Exception( sprintf( 'Unable to determine the %s cache key: The "%s" parameter is missing!', $type, $key ) ); } } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Cached.php0000664000175000017500000000442212207101545021601 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The cached variant for the Kolab storage handler [the default]. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Cached extends Horde_Kolab_Storage_Base { /** * Return a data handler for accessing data in the specified * folder. * * @param mixed $folder The name of the folder or * an instance representing * the folder. * @param Horde_Kolab_Storage_Driver $master The primary connection * driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param string $object_type The type of data we want * to access in the folder. * @param int $data_version Format version of the * object data. * * @return Horde_Kolab_Data The data object. */ protected function _createData($folder, Horde_Kolab_Storage_Driver $master, Horde_Kolab_Storage_Factory $factory, $object_type = null, $data_version = 1) { return new Horde_Kolab_Storage_Data_Cached( $folder, $master, $factory, $this->_cache, $object_type, $data_version ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Data.php0000664000175000017500000001477612207101545021320 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Defines the Kolab data handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Data extends Horde_Kolab_Storage_Queriable { /** Identifies the preferences query */ const QUERY_PREFS = 'Preferences'; const QUERY_HISTORY = 'History'; /** * Return the folder path for this data handler. * * @return string The folder path. */ public function getPath(); /** * Return the ID of the current user. * * @return string The current user. */ public function getAuth(); /** * Return the ID of this data handler. * * @return string The ID. */ public function getId(); /** * Return the ID parameters for this data handler. * * @return array The ID parameters. */ public function getIdParameters(); /** * Return the data type represented by this object. * * @return string The type of data this instance handles. */ public function getType(); /** * Return the data version. * * @return string The data version. */ public function getVersion(); /** * Report the status of this folder. * * @return Horde_Kolab_Storage_Folder_Stamp The stamp that can be used for * detecting folder changes. */ public function getStamp(); /** * Create a new object. * * @param array &$object The array that holds the object data. * @param boolean $raw True if the data to be stored has been provided in * raw format. * * @return string The ID of the new object or true in case the backend does * not support this return value. * * @throws Horde_Kolab_Storage_Exception In case an error occured while * saving the data. */ public function create(&$object, $raw = false); /** * Modify an existing object. * * @param array $object The array that holds the updated object data. * @param boolean $raw True if the data to be stored has been provided in * raw format. * * @return NULL * * @throws Horde_Kolab_Storage_Exception In case an error occured while * saving the data. */ public function modify($object, $raw = false); /** * Retrieves the objects for the given UIDs. * * @param array $uids The message UIDs. * * @return array An array of objects. */ public function fetch($uids); /** * Retrieves the complete message for the given UID. * * @param string $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($uid); /** * Return the backend ID for the given object ID. * * @param string $object_uid The object ID. * * @return string The backend ID for the object. */ public function getBackendId($object_id); /** * Check if the given object ID exists. * * @param string $object_id The object ID. * * @return boolean True if the ID was found, false otherwise. */ public function objectIdExists($object_id); /** * Return the specified object. * * @param string $object_id The object id. * * @return array The object data as an array. */ public function getObject($object_id); /** * Return the specified attachment. * * @param string $attachment_id The attachment id. * * @return resource An open stream to the attachment data. */ public function getAttachment($attachment_id); /** * Retrieve all object ids in the current folder. * * @return array The object ids. */ public function getObjectIds(); /** * Retrieve all objects in the current folder. * * @return array An array of all objects. */ public function getObjects(); /** * Retrieve all objects in the current folder by backend id. * * @return array An array of all objects. */ public function getObjectsByBackendId(); /** * Retrieve an object in the current folder by backend id. * * @param string $uid Backend id of the object to be returned. * * @return array An array of all objects. */ public function getObjectByBackendId($uid); /** * Return the mapping of object IDs to backend IDs. * * @return array The object to backend mapping. */ public function getObjectToBackend(); /** * Retrieve the list of object duplicates. * * @return array The list of duplicates. */ public function getDuplicates(); /** * Retrieve the list of object errors. * * @return array The list of errors. */ public function getErrors(); /** * Move the specified message from the current folder into a new * folder. * * @param string $object_id ID of the message to be moved. * @param string $new_folder Target folder. * * @return NULL */ public function move($object_id, $new_folder); /** * Delete the specified objects from this data set. * * @param array|string $object_ids Id(s) of the object to be deleted. * * @return NULL */ public function delete($object_ids); /** * Delete all objects from this data set. * * @return NULL */ public function deleteAll(); /** * Delete the specified messages from this folder. * * @param array|string $uids Backend id(s) of the message to be deleted. * * @return NULL */ public function deleteBackendIds($uids); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Driver.php0000664000175000017500000002075112207101545021670 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The driver definition for accessing Kolab storage. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Driver { /** Generic functionality */ /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend(); /** * Returns the actual backend driver. * * If there is no driver set the driver should be constructed within this * method. * * @return mixed The backend driver. */ public function getBackend(); /** * Set the backend driver. * * @param mixed $backend The driver that should be used. * * @return NULL */ public function setBackend($backend); /** * Return the id of the user currently authenticated. * * @return string The id of the user that opened the connection. */ public function getAuth(); /** * Return the unique connection id. * * @return string The connection id. */ public function getId(); /** * Return the connection parameters. * * @return array The connection parameters. */ public function getParameters(); /** * Checks if the backend supports CATENATE. * * @return boolean True if the backend supports CATENATE. */ public function hasCatenateSupport(); /** List functionality */ /** * Retrieves a list of folders from the server. * * @return array The list of folders. */ public function listFolders(); /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder); /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder); /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new); /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport(); /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder); /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder); /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl); /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user); /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation); /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation); /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value); /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace(); /** Data functionality */ /** * Returns a stamp for the current folder status. This stamp can be used to * identify changes in the folder data. * * @param string $folder Return the stamp for this folder. * * @return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current * folder status. */ public function getStamp($folder); /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder); /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder); /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids); /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id); /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid); /** * Retrieves the message headers. * * @param string $folder The folder to fetch the message from. * @param array $uid The message UID. * * @return Horde_Mime_Headers The message headers. */ public function fetchHeaders($folder, $uid); /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg); /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids); /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder); /** * Expunges messages in the current folder. * * @param string $folder The folder to expunge. * * @return NULL */ public function expunge($folder); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Exception.php0000664000175000017500000000220012207101545022360 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * This class provides the standard error class for Kolab Storage exceptions. * * Copyright 2009-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Exception extends Horde_Exception_Wrapped { /** * Constants to define the error type. */ /** * The specified folder already exists. */ const FOLDER_EXISTS = 10; /** * The name of the folder has not been specified. */ const FOLDER_NAME_UNSET = 50; } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Factory.php0000664000175000017500000002065512207101545022047 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * A generic factory for the various Kolab_Storage classes. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Factory { /** * A set of parameters for this factory. * * @var array */ private $_params; /** * Stores the driver once created. * * @todo Cleanup. Extract a driver factory to be placed in the driver * namespace and allow to inject the driver within the storage factory. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * Constructor. * * @param array $params A set of parameters. *
     *  - driver : The type of backend driver. One of "mock", "php", "pear",
     *             "horde", "horde-socket", and "roundcube".
     *  - params : Backend specific connection parameters.
     *  - logger : An optional log handler.
     *  - timelog : An optional time keeping log handler.
     *  - format : Array
     *     - factory: Name of the format parser factory class.
     * 
*/ public function __construct($params = array()) { $this->_params = $params; } /** * Create the storage handler. * * @return Horde_Kolab_Storage The storage handler. */ public function create() { if (isset($this->_params['storage'])) { $sparams = $this->_params['storage']; } else { $sparams = array(); } if (isset($this->_params['queries'])) { $sparams['queries'] = $this->_params['queries']; } if (isset($this->_params['queryset'])) { $queryset = $this->_params['queryset']; $sparams['queryset'] = $this->_params['queryset']; } else { $queryset = array(); } $cache = $this->createCache(); if (!empty($this->_params['cache'])) { $storage = new Horde_Kolab_Storage_Cached( $this->createDriver(), new Horde_Kolab_Storage_QuerySet_Cached($this, $queryset, $cache), $this, $cache, $this->_params['logger'], $sparams ); } else { $storage = new Horde_Kolab_Storage_Uncached( $this->createDriver(), new Horde_Kolab_Storage_QuerySet_Uncached($this, $queryset), $this, $cache, $this->_params['logger'], $sparams ); } $storage = new Horde_Kolab_Storage_Decorator_Synchronization( $storage, new Horde_Kolab_Storage_Synchronization() ); return $storage; } /** * Create the storage backend driver. * * @param array $params Any parameters that should overwrite the default * parameters provided in the factory constructor. * * @return Horde_Kolab_Storage_Driver The storage handler. */ public function createDriver($params = array()) { $params = array_merge($this->_params, $params); if (!isset($params['driver'])) { throw new Horde_Kolab_Storage_Exception( Horde_Kolab_Storage_Translation::t( 'Missing "driver" parameter!' ) ); } if (isset($params['params'])) { $config = (array)$params['params']; } else { $config = array(); } if (empty($config['host'])) { $config['host'] = 'localhost'; } if (empty($config['port'])) { $config['port'] = 143; } if (isset($this->_params['log']) && (in_array('debug', $this->_params['log']) || in_array('driver_time', $this->_params['log']))) { $timer = new Horde_Support_Timer(); $timer->push(); } switch ($params['driver']) { case 'mock': if (!isset($config['data'])) { $config['data'] = array('user/test' => array()); } $driver = new Horde_Kolab_Storage_Driver_Mock($this, $config); break; case 'horde': case 'horde-php': $driver = new Horde_Kolab_Storage_Driver_Imap($this, $config); break; case 'php': $driver = new Horde_Kolab_Storage_Driver_Cclient($this, $config); break; case 'pear': $driver = new Horde_Kolab_Storage_Driver_Pear($this, $config); break; case 'roundcube': $driver = new Horde_Kolab_Storage_Driver_Rcube($this, $config); break; default: throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( 'Invalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!' ), $params['driver'] ) ); } if (isset($this->_params['log']) && (in_array('debug', $this->_params['log']) || in_array('driver', $this->_params['log']))) { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $driver, $params['logger'] ); //$parser->setLogger($params['logger']); } /* if (!empty($params['ignore_parse_errors'])) { */ /* $parser->setLogger(false); */ /* } */ if (isset($this->_params['log']) && (in_array('debug', $this->_params['log']) || in_array('driver_time', $this->_params['log']))) { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $driver, $timer, $params['logger'] ); } $this->_driver = $driver; return $driver; } /** * Create a namespace handler. * * @param string $type The namespace type. * @param string $user The current user. * @param array $params The parameters for the namespace. * * @return Horde_Kolab_Storage_Folder_Namespace The namespace handler. */ public function createNamespace($type, $user, array $params = array()) { $class = 'Horde_Kolab_Storage_Folder_Namespace_' . ucfirst($type); if (!class_exists($class)) { throw new Horde_Kolab_Storage_Exception( sprintf( Horde_Kolab_Storage_Translation::t( 'Invalid "namespace" type "%s"!' ), $type ) ); } return new $class($user, $params); } /** * Create the cache handler. * * @return Horde_Kolab_Storage_Cache The cache handler. */ public function createCache() { if (isset($this->_params['cache'])) { $params = $this->_params['cache']; } else { $params = array(); } if ($params instanceOf Horde_Cache) { return new Horde_Kolab_Storage_Cache($params); } else { $cache = new Horde_Cache( new Horde_Cache_Storage_File($params), array('lifetime' => 0) ); } return new Horde_Kolab_Storage_Cache( $cache ); } /** * Create the history handler. * * @param string $user The current user. * * @return Horde_History The history handler. */ public function createHistory($user) { if (isset($this->_params['history']) && $this->_params['history'] instanceOf Horde_History) { return $this->_params['history']; } return new Horde_History_Mock($user); } public function getDriver() { return $this->_driver; } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Folder.php0000664000175000017500000000454112207101545021647 0ustar janjan * @author Gunnar Wrobel * @author Thomas Jarosch * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The interface describing a Kolab folder. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Stuart Binge * @author Gunnar Wrobel * @author Thomas Jarosch * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Folder { /** * Return the storage path of the folder. * * @return string The storage path of the folder. */ public function getPath(); /** * Returns a readable title for this folder. * * @return string The folder title. */ public function getTitle(); /** * Return the namespace type of the folder. * * @return string The namespace type of the folder. */ public function getNamespace(); /** * Return the namespace prefix of the folder. * * @return string The namespace prefix of the folder. */ public function getPrefix(); /** * Returns the owner of the folder. * * @return string The owner of this folder. */ public function getOwner(); /** * Returns the folder path without namespace components. * * @return string The subpath of this folder. */ public function getSubpath(); /** * Returns the folder parent. * * @return string The parent of this folder. */ public function getParent(); /** * Is this a default folder? * * @return boolean Boolean that indicates the default status. */ public function isDefault(); /** * The type of this folder. * * @return string The folder type. */ public function getType(); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Object.php0000664000175000017500000004426112207101545021645 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Represents a single Kolab object. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Object implements ArrayAccess, Serializable { /** Indicates an invalid object. */ const TYPE_INVALID = 'INVALID'; /** Indicates a missing Kolab data MIME part. */ const ERROR_MISSING_KOLAB_PART = 1; /** Indicates an unreadable Kolab part. */ const ERROR_INVALID_KOLAB_PART = 2; /** Serialization elements */ const SERIALIZATION_DATA = 'D'; const SERIALIZATION_ERRORS = 'E'; const SERIALIZATION_TYPE = 'T'; const SERIALIZATION_STRUCTURE = 'S'; const SERIALIZATION_FOLDER = 'F'; const SERIALIZATION_BACKENDID = 'B'; const SERIALIZATION_MIMEPARTID = 'P'; /** * The driver for accessing the backend. * * @var Horde_Kolab_Storage_Driver */ private $_driver; /** * The folder that holds the object within the backend. * * @var string */ private $_folder; /** * The object ID within the backend. * * @var string */ private $_backend_id; /** * The ID of the MIME part carrying the object data. * * @var string */ private $_mime_part_id; /** * The object type. * * @var string */ private $_type; /** * The MIME headers of the object envelope. * * @var Horde_Mime_Headers */ private $_headers; /** * The message structure. * * @var Horde_Mime_Part */ private $_structure; /** * The content string representing the object data. * * @var resource */ private $_content; /** * The object data. * * @var array */ private $_data = array(); /** * The collection of parse errors (if any). * * @var array */ private $_errors = array(); /** * Return the driver for accessing the backend. * * @return Horde_Kolab_Storage_Driver The driver. */ private function _getDriver() { if ($this->_driver === null) { throw new Horde_Kolab_Storage_Object_Exception( 'The driver has not been set!' ); } return $this->_driver; } /** * Set the driver for accessing the backend. * * @param Horde_Kolab_Storage_Driver $driver The driver. */ public function setDriver(Horde_Kolab_Storage_Driver $driver) { $this->_driver = $driver; } private function _getFolder() { if (empty($this->_folder)) { throw new Horde_Kolab_Storage_Object_Exception( 'The folder containing the object has been left unspecified!' ); } return $this->_folder; } private function _getBackendId() { if (empty($this->_backend_id)) { throw new Horde_Kolab_Storage_Object_Exception( 'The message containing the object has been left unspecified!' ); } return $this->_backend_id; } private function _getMimePartId() { if (empty($this->_mime_part_id)) { throw new Horde_Kolab_Storage_Object_Exception( 'There is no indication which message part might contain the object data!' ); } return $this->_mime_part_id; } /** * Return the object type. * * @return string The object type. */ public function getType() { return $this->_type; } /** * Return the MIME headers of the object envelope. * * @return Horde_Mime_Headers The MIME headers. */ public function getHeaders() { if ($this->_headers === null) { $this->_headers = $this->_getDriver()->fetchHeaders( $this->_getFolder(), $this->_getBackendId() ); } return $this->_headers; } /** * Set the content representing the object data. * * @param resource $content The object content. */ public function setContent($content) { $this->_content = $content; } /** * Fetch the raw content representing the object data. * * @return resource The raw object content. */ public function getContent() { if ($this->_content === null) { $this->_content = $this->_getDriver()->fetchBodypart( $this->_getFolder(), $this->_getBackendId(), $this->_getMimePartId() ); } return $this->_content; } /** * Return the current content value representing the object data. This call * does not attempt to fetch the content from the backend. * * @return resource The raw object content. */ public function getCurrentContent() { return $this->_content; } /** * Set the object data. * * @param array $data The object data. */ public function setData(array $data) { $this->_data = $data; if (!isset($this->_data['uid'])) { $this->getUid(); } } /** * Fetch the object data. * * @return array The object data. */ public function getData() { return $this->_data; } /** * Return the UID of the object. If no UID has been set a valid UID will be * autogenerated. * * @return string The object UID. */ public function getUid() { if (!isset($this->_data['uid'])) { $this->_data['uid'] = $this->generateUid(); } return $this->_data['uid']; } /** * Generate a unique object ID. * * @return string The unique ID. */ public function generateUid() { return strval(new Horde_Support_Uuid()); } private function addParseError($error, $message = '') { $this->_errors[$error] = $message; } public function getParseErrors() { return $this->_errors; } public function hasParseErrors() { return !empty($this->_errors); } /** * Create a new object in 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 writer. * @param string $type The type of object to be stored. * * @return boolean|string The return value of the append operation. */ public function create(Horde_Kolab_Storage_Folder $folder, Horde_Kolab_Storage_Object_Writer $data, $type) { $this->_folder = $folder->getPath(); $this->_type = $type; $envelope = $this->createEnvelope(); $envelope->addPart($this->createFreshKolabPart($data->save($this))); $envelope->buildMimeIds(); $this->_mime_part_id = Horde_Kolab_Storage_Object_MimeType::matchMimePartToObjectType( $envelope, $this->getType() ); return $this->_appendMessage($envelope, $this->createEnvelopeHeaders()); } /** * Load 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, $structure = null) { $this->_folder = $folder->getPath(); $this->_backend_id = $backend_id; if (!$structure instanceOf Horde_Mime_Part) { throw new Horde_Kolab_Storage_Data_Exception( sprintf( 'The provided data is not of type Horde_Mime_Part but %s instead!', get_class($structure) ) ); } $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()); } $this->_structure = $structure; } /** * Store the modified object in 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 writer. * @param Horde_Mime_Part $structure The MIME message structure of the object. * * @return boolean|string The return value of the append operation. */ public function save(Horde_Kolab_Storage_Object_Writer $data) { list($headers, $body) = $this->_driver->fetchComplete( $this->_getFolder(), $this->_getBackendId() ); $mime_id = Horde_Kolab_Storage_Object_MimeType::matchMimePartToObjectType( $body, $this->getType() ); if ($mime_id === false) { throw new Horde_Kolab_Storage_Object_Exception( sprintf( 'Missing expected mime type (%s) in object "%s" in folder "%s"!', Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType($this->getType()), $this->_getBackendId(), $this->_getFolder() ) ); } $original = $body->getPart($mime_id); $original->setContents( $this->_driver->fetchBodypart($this->_getFolder(), $this->_getBackendId(), $mime_id) ); $this->_content = $original->getContents(array('stream' => true)); $body->alterPart($mime_id, $this->createFreshKolabPart($data->save($this))); $body->buildMimeIds(); $this->_mime_part_id = Horde_Kolab_Storage_Object_MimeType::matchMimePartToObjectType( $body, $this->getType() ); $old_uid = $this->_getBackendId(); $result = $this->_appendMessage($body, $headers); $this->_driver->deleteMessages($this->_getFolder(), array($old_uid)); $this->_driver->expunge($this->_getFolder()); return $result; } /** * Append a new message. * * @param Horde_Mime_Part $message The message. * @param Horde_Mime_Headers $headers The message headers. * * @return boolean|string The return value of the append operation. */ private function _appendMessage(Horde_Mime_Part $message, Horde_Mime_Headers $headers) { $result = $this->_getDriver()->appendMessage( $this->_getFolder(), $message->toString( array( 'canonical' => true, 'stream' => true, 'headers' => $headers ) ) ); if (is_object($result) || $result === false || $result === null) { throw new Horde_Kolab_Storage_Object_Exception( sprintf( 'Unexpected return value (%s) when creating an object in folder "%s"!', print_r($result, true), $this->_getFolder() ) ); } if ($result !== true) { $this->_backend_id = $result; } return $result; } /** * Generates a new MIME messages that will wrap a Kolab groupware object. * * @return Horde_Mime_Part The new MIME message. */ private function createEnvelope() { $envelope = new Horde_Mime_Part(); $envelope->setName('Kolab Groupware Data'); $envelope->setType('multipart/mixed'); $description = new Horde_Mime_Part(); $description->setName('Kolab Groupware Information'); $description->setType('text/plain'); $description->setDisposition('inline'); $description->setCharset('utf-8'); $description->setContents( sprintf( Horde_Kolab_Storage_Translation::t( "This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %s" ), 'http://www.kolab.org/content/kolab-clients' ), array('encoding' => 'quoted-printable') ); $envelope->addPart($description); return $envelope; } /** * Generate the headers for the MIME envelope of a Kolab groupware object. * * @param string $user The current user. * * @return Horde_Mime_Headers The headers for the MIME envelope. */ private function createEnvelopeHeaders() { $headers = new Horde_Mime_Headers(); $headers->setEOL("\r\n"); $headers->addHeader('From', $this->_getDriver()->getAuth()); $headers->addHeader('To', $this->_getDriver()->getAuth()); $headers->addHeader('Date', date('r')); $headers->addHeader('Subject', $this->getUid()); $headers->addHeader('User-Agent', 'Horde_Kolab_Storage ' . Horde_Kolab_Storage::VERSION); $headers->addHeader('MIME-Version', '1.0'); $headers->addHeader( 'X-Kolab-Type', Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType($this->getType()) ); return $headers; } /** * Embed the Kolab content into a new MIME Part. * * @param resource $content The Kolab content. * * @return Horde_Mime_Part The MIME part that encapsules the Kolab content. */ private function createFreshKolabPart($content) { $part = new Horde_Mime_Part(); $part->setCharset('utf-8'); $part->setDisposition('inline'); $part->setDispositionParameter('x-kolab-type', 'xml'); $part->setName('kolab.xml'); $part->setType( Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType($this->getType()) ); $part->setContents( $content, array('encoding' => 'quoted-printable') ); return $part; } /* ArrayAccess methods. */ public function offsetExists($offset) { return isset($this->_data[$offset]); } public function offsetGet($offset) { return isset($this->_data[$offset]) ? $this->_data[$offset] : ''; } public function offsetSet($offset, $value) { $this->_data[$offset] = $value; } public function offsetUnset($offset) { unset($this->_data[$offset]); } /* Serializable methods. */ /** * Serialization. * * @return string Serialized data. */ public function serialize() { return serialize( array( self::SERIALIZATION_DATA => $this->_data, self::SERIALIZATION_ERRORS => $this->_errors, self::SERIALIZATION_TYPE => $this->_type, self::SERIALIZATION_FOLDER => $this->_folder, self::SERIALIZATION_BACKENDID => $this->_backend_id, self::SERIALIZATION_MIMEPARTID => $this->_mime_part_id, ) ); } /** * Unserialization. * * @param string $data Serialized data. * * @throws Exception */ public function unserialize($data) { $data = @unserialize($data); if (!is_array($data)) { throw new Horde_Kolab_Storage_Object_Exception('Cache data invalid'); } if (isset($data[self::SERIALIZATION_DATA])) { $this->_data = $data[self::SERIALIZATION_DATA]; } if (isset($data[self::SERIALIZATION_ERRORS])) { $this->_errors = $data[self::SERIALIZATION_ERRORS]; } if (isset($data[self::SERIALIZATION_TYPE])) { $this->_type = $data[self::SERIALIZATION_TYPE]; } if (isset($data[self::SERIALIZATION_FOLDER])) { $this->_folder = $data[self::SERIALIZATION_FOLDER]; } if (isset($data[self::SERIALIZATION_BACKENDID])) { $this->_backend_id = $data[self::SERIALIZATION_BACKENDID]; } if (isset($data[self::SERIALIZATION_MIMEPARTID])) { $this->_mime_part_id = $data[self::SERIALIZATION_MIMEPARTID]; } } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Queriable.php0000664000175000017500000000270512207101545022345 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Marks a queriable class. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Queriable { /** * Register a query to be updated if the underlying data changes. * * @param string $name The query name. * @param Horde_Kolab_Storage_Query $query The query to register. * * @return NULL */ public function registerQuery($name, Horde_Kolab_Storage_Query $query); /** * Return a registered query. * * @param string $name The query name. * * @return Horde_Kolab_Storage_Query The requested query. * * @throws Horde_Kolab_Storage_Exception In case the requested query does * not exist. */ public function getQuery($name = null); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Query.php0000664000175000017500000000175512207101545021545 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Represents a query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_Query { /** * Synchronize the query data with the information from the backend. * * @param array $params Additional parameters. * * @return NULL */ public function synchronize($params = array()); } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/QuerySet.php0000664000175000017500000000144012207101545022210 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Represents a set of queries. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage_QuerySet { } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Synchronization.php0000664000175000017500000000377412207101545023644 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Handles synchronization with the backend. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Synchronization { /** * Synchronization strategy. * * @var Horde_Kolab_Storage_Synchronization */ private $_strategy; /** * Constructor. * * @param Horde_Kolab_Storage_Synchronization $strategy Optional synchronization strategy. */ public function __construct(Horde_Kolab_Storage_Synchronization $strategy = null) { if ($strategy === null) { $this->_strategy = new Horde_Kolab_Storage_Synchronization_OncePerSession(); } else { $this->_strategy = $strategy; } } /** * Synchronize the provided list in case the selected synchronization * strategy requires it. * * @param Horde_Kolab_Storage_List $list The list to synchronize. */ public function synchronizeList(Horde_Kolab_Storage_List_Tools $list) { $this->_strategy->synchronizeList($list); } /** * Synchronize the provided data in case the selected synchronization * strategy requires it. * * @param Horde_Kolab_Storage_Data $data The data to synchronize. */ public function synchronizeData(Horde_Kolab_Storage_Data $data) { $this->_strategy->synchronizeData($data); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Translation.php0000664000175000017500000000333012207101545022725 0ustar janjan * @package Kolab_Storage */ class Horde_Kolab_Storage_Translation extends Horde_Translation { /** * Returns the translation of a message. * * @var string $message The string to translate. * * @return string The string translation, or the original string if no * translation exists. */ static public function t($message) { self::$_domain = 'Horde_Kolab_Storage'; self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? __DIR__ . '/../../../../locale' : '@data_dir@/Horde_Kolab_Storage/locale'; return parent::t($message); } /** * Returns the plural translation of a message. * * @param string $singular The singular version to translate. * @param string $plural The plural version to translate. * @param integer $number The number that determines singular vs. plural. * * @return string The string translation, or the original string if no * translation exists. */ static public function ngettext($singular, $plural, $number) { self::$_domain = 'Horde_Kolab_Storage'; self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? __DIR__ . '/../../../../locale' : '@data_dir@/Horde_Kolab_Storage/locale'; return parent::ngettext($singular, $plural, $number); } } Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage/Uncached.php0000664000175000017500000000546412207101545022153 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The basic handler for accessing data from Kolab storage. * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Uncached extends Horde_Kolab_Storage_Base { /** * Create the folder list object. * * @param Horde_Kolab_Storage_Driver $master The primary connection driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ protected function _createList(Horde_Kolab_Storage_Driver $master, Horde_Kolab_Storage_Factory $factory) { return new Horde_Kolab_Storage_List_Base($master, $factory); } /** * Return a data handler for accessing data in the specified * folder. * * @param mixed $folder The name of the folder or * an instance representing * the folder. * @param Horde_Kolab_Storage_Driver $master The primary connection * driver. * @param Horde_Kolab_Storage_Factory $factory The factory. * @param string $object_type The type of data we want * to access in the folder. * @param int $data_version Format version of the * object data. * * @return Horde_Kolab_Data The data object. */ protected function _createData($folder, Horde_Kolab_Storage_Driver $master, Horde_Kolab_Storage_Factory $factory, $object_type = null, $data_version = 1) { return new Horde_Kolab_Storage_Data_Base( $folder, $master, $factory, $object_type, $data_version ); } }Horde_Kolab_Storage-2.0.5/lib/Horde/Kolab/Storage.php0000664000175000017500000000554012207101545020434 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * The Horde_Kolab_Storage class provides the means to access the * Kolab server storage for groupware objects. * * To get access to the folder handling you would do the following: * * * require_once 'Horde/Kolab/Storage.php'; * $folder = Horde_Kolab_Storage::getFolder('INBOX/Calendar'); * * * or (in case you are dealing with share identifications): * * * require_once 'Horde/Kolab/Storage.php'; * $folder = Horde_Kolab_Storage::getShare(Auth::getAuth(), 'event'); * * * To access data in a share (or folder) you need to retrieve the * corresponding data object: * * * require_once 'Horde/Kolab/Storage.php'; * $folder = Horde_Kolab_Storage::getShareData(Auth::getAuth(), 'event'); * * * Copyright 2004-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ interface Horde_Kolab_Storage { /** The package version */ const VERSION = '2.0.5'; /** * Get the folder list object. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getList(); /** * Get a folder list object for a "system" user. * * @param string $type The type of system user. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getSystemList($type); /** * Get a folder representation. * * @param string $folder The folder name. * * @return Horde_Kolab_Storage_Folder The Kolab folder object. */ public function getFolder($folder); /** * Return a data handler for accessing data in the specified * folder. * * @param string $folder The name of the folder. * @param string $object_type The type of data we want to * access in the folder. * @param int $data_version Format version of the object data. * * @return Horde_Kolab_Storage_Data The data object. */ public function getData($folder, $object_type = null, $data_version = 1); } Horde_Kolab_Storage-2.0.5/locale/ar/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023272 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/ar/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000413312207101545023300 0ustar janjan# Arabic translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "إن ملفات PO للغة %s غير موجودة" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/bg/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023260 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/bg/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000416712207101545023275 0ustar janjan# Bulgarian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Horde PO файл за локализация %s не съществува:" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/bs/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023274 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/bs/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000404312207101545023302 0ustar janjan# Bosnian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/ca/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000172712207101545023262 0ustar janjan4L`a<JPPThis is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Això és un objecte de Kolab Groupware. Per visualitzar aquest objecte, us cal un client de correu electrònic que admeti el format de Kolab Groupware. Per tenir accés a una llista d'aquests clients de correu electrònic, visiteu %sNo s'ha pogut canviar el nom de %s per %s: la carpeta de destinació ja existeixHorde_Kolab_Storage-2.0.5/locale/ca/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000474412207101545023271 0ustar janjan# Catalan translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "La carpeta %s no existeix" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Això és un objecte de Kolab Groupware. Per visualitzar aquest objecte, us " "cal un client de correu electrònic que admeti el format de Kolab Groupware. " "Per tenir accés a una llista d'aquests clients de correu electrònic, visiteu " "%s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" "No s'ha pogut canviar el nom de %s per %s: la carpeta de destinació ja " "existeix" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" "No es pot activar l'actualització d'informació de temps disponible de %s " Horde_Kolab_Storage-2.0.5/locale/cs/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000174112207101545023300 0ustar janjan4L`a<P;This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; Toto je objekt Kolab Groupwaru. K zhlédnutí tohoto objektu je zapotřebí mít poštovního klienta, který rozumí formátu Kolab Groupwaru. Pro seznam takových klientů prosím navštivte %sNelze přejmenovat %s na %s: cílová složka již existujeHorde_Kolab_Storage-2.0.5/locale/cs/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000471312207101545023307 0ustar janjan# Czech translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Složka %s neexistuje" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Toto je objekt Kolab Groupwaru. K zhlédnutí tohoto objektu je zapotřebí mít " "poštovního klienta, který rozumí formátu Kolab Groupwaru. Pro seznam " "takových klientů prosím navštivte %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Nelze přejmenovat %s na %s: cílová složka již existuje" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Nelze spustit volno/zaneprázdněno aktualizaci pro %s" Horde_Kolab_Storage-2.0.5/locale/da/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000164512207101545023262 0ustar janjan4L`a<uP6nThis is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Dette er et Kolab Groupware-objekt. For at se dette objekt har du brug for en e-mail-klient, som forstår Kolab Groupware-formatet. Besøg %s for en liste af klienter.Kan ikke omdøbe %s til %s: målmappen findes alleredeHorde_Kolab_Storage-2.0.5/locale/da/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000452612207101545023270 0ustar janjan# Danish translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Mappe %s eksisterer ikke" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Dette er et Kolab Groupware-objekt. For at se dette objekt har du brug for " "en e-mail-klient, som forstår Kolab Groupware-formatet. Besøg %s for en " "liste af klienter." #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Kan ikke omdøbe %s til %s: målmappen findes allerede" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/de/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000001345412207101545023271 0ustar janjan)d; *-$(R({9(C#5g (%3'7[=2*p/$2 W1x+.4! V  <j &  $O #t $ 9 ;3>2r&H1PGD#)1+*]+JOAOA}!Q$s 5-!6O+#:BTO8 %) ! &  ' $"(#Connecting to server %s failed.Creating folder %s failed.Deleting folder %s failed.Error: %sFailed appending new message to folder %s.Failed deleting ACL on folder %s for user %s.Failed deleting message %s in folder %s.Failed deleting messages from folder %s.Failed expunging folder %s.Failed fetching body part %s for message %s in folder %s.Failed fetching message %s in folder %s.Failed fetching structure information for messages %s in folder %s.Failed moving message %s from folder %s to folder %s.Failed opening folder %s.Failed reading ACL on folder %s.Failed reading user rights on folder %s.Failed retrieving UIDs for folder %s.Failed retrieving status information for folder %s.Failed retrieving structure of message %s in folder %s.Failed retrieving the message with ID %s. Original error: %s.Failed setting ACL on folder %s for user %s to %s.Failed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Listing folders for %s failed.Missing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.Renaming folder %s to %s failed.Retrieving annotation %s[%s] on folder %s failed.Retrieving the status for folder %s failed.Selecting folder %s failed.Setting annotation %s[%s] on folder %s failed.Setting annotation %s[%s] on folder %s to %s failed.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-08-20 17:52+0200 PO-Revision-Date: 2012-10-02 18:10+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Fehler beim Verbinden zum Server %s.Fehler beim Anlegen des Ordners %s.Fehler beim Löschen des Ordners %s.Fehler: %sFehler beim Speichern einer neuen Nachricht im Ordner %s.Fehler beim Löschen der ACL im Ordner %s für Benutzer %s.Fehler beim Löschen der Nachricht %s im Ordner %s.Fehler beim Löschen von Nachrichten im Ordner %s.Fehler beim Aufräumen des Ordners %s.Fehler beim Laden des Nachrichtenteils %s von Nachricht %s im Ordner %s.Fehler beim Laden der Nachricht %s vom Ordner %s.Fehler beim Laden der Nachrichtenstruktur für die Nachrichten %s vom Ordner %s.Fehler beim Verschieben der Nachricht %s vom Ordner %s in Ordner %s.Fehler beim Öffnen des Ordners %s.Fehler beim Lesen der ACL des Ordners %s.Fehler beim Lesen der Benutzerechte am Ordner %s.Fehler beim Laden der UIDs des Ordners %s.Fehler beim Lesen des Status von Ordner %s.Fehler beim Laden der Nachrichtenstruktur für Nachricht %s vom Ordner %s.Lesen der Nachricht mit der ID %s fehlgeschlagen. Fehlermeldung des Servers: %sFehler beim Setzen der ACL im Ordner %s für Benutzer %s nach %s.Fehler beim Anlegen des Ordners %s. Fehlermeldung des Servers: %sUngülter "driver"-Parameter "%s". Bitte benutzen Sie einen aus "mock", "php", "pear", "horde", "horde-php", und "roundcube"!Ungültiger "namespace"-Typ "%s"!Fehler beim Laden der Ordner von %s."driver"-Parameter fehlt!"host"-Parameter fehlt!Altes Object %s existiert nicht.Das alte Objekt %s kann keiner UID zugeordnet werden.Fehler beim Umbenennen von Ordner %s nach %s.Fehler beim Lesen der Annotation %s[%s] von Ordner %s.Fehler beim Lesen des Status von Ordner %s.Fehler beim Öffnen des Ordners %s.Fehler beim Schreiben der Annotation %s[%s] von Ordner %s.Fehler beim Schreiben der Annotation %s[%s] von Ordner %s nach %s.Die Nachricht mit der ID %s existiert nicht. Das liegt vermutlich daran, dass dieses Kolab-Objekt von jemand anderem verändert wurde, während Sie es bearbeitet haben. Orginalfehlermeldung: %sDie Nachricht mit der ID %s existiert nicht. Das liegt vermutlich daran, dass dieses Kolab-Object von jemand anderem verändert wurde, während Sie es bearbeitet haben. Ihre Änderungen sind verloren.Dies ist ein Kolab-Groupware-Objekt. Um dieses Objekt anzuzeigen, benötigen Sie ein E-Mail-Programm, das das Kolab-Groupware-Format unterstützt. Eine Liste solcher Programme finden Sie unter %s%s konnte nicht nach %s umbenannt werden: Das Zielverzeichnis existiert bereitsDie URL %s konnte nicht angesprochen werden. Antwort: %sHorde_Kolab_Storage-2.0.5/locale/de/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002554312207101545023276 0ustar janjan# German translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Jan Schneider , 2010-2012. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-08-20 17:52+0200\n" "PO-Revision-Date: 2012-10-02 18:10+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed." msgstr "Fehler beim Verbinden zum Server %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed." msgstr "Fehler beim Anlegen des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, php-format msgid "Deleting folder %s failed." msgstr "Fehler beim Löschen des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "Fehler: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, php-format msgid "Failed appending new message to folder %s." msgstr "Fehler beim Speichern einer neuen Nachricht im Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "Fehler beim Löschen der ACL im Ordner %s für Benutzer %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, php-format msgid "Failed deleting message %s in folder %s." msgstr "Fehler beim Löschen der Nachricht %s im Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, php-format msgid "Failed deleting messages from folder %s." msgstr "Fehler beim Löschen von Nachrichten im Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, php-format msgid "Failed expunging folder %s." msgstr "Fehler beim Aufräumen des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "" "Fehler beim Laden des Nachrichtenteils %s von Nachricht %s im Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Imap.php:425 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, php-format msgid "Failed fetching message %s in folder %s." msgstr "Fehler beim Laden der Nachricht %s vom Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "" "Fehler beim Laden der Nachrichtenstruktur für die Nachrichten %s vom Ordner " "%s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "Fehler beim Verschieben der Nachricht %s vom Ordner %s in Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, php-format msgid "Failed opening folder %s." msgstr "Fehler beim Öffnen des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, php-format msgid "Failed reading ACL on folder %s." msgstr "Fehler beim Lesen der ACL des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, php-format msgid "Failed reading user rights on folder %s." msgstr "Fehler beim Lesen der Benutzerechte am Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "Fehler beim Laden der UIDs des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, php-format msgid "Failed retrieving status information for folder %s." msgstr "Fehler beim Lesen des Status von Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "" "Fehler beim Laden der Nachrichtenstruktur für Nachricht %s vom Ordner %s." #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" "Lesen der Nachricht mit der ID %s fehlgeschlagen. Fehlermeldung des Servers: " "%s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "Fehler beim Setzen der ACL im Ordner %s für Benutzer %s nach %s." #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Fehler beim Anlegen des Ordners %s. Fehlermeldung des Servers: %s" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Ungülter \"driver\"-Parameter \"%s\". Bitte benutzen Sie einen aus \"mock\", " "\"php\", \"pear\", \"horde\", \"horde-php\", und \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Ungültiger \"namespace\"-Typ \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, php-format msgid "Listing folders for %s failed." msgstr "Fehler beim Laden der Ordner von %s." #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "\"driver\"-Parameter fehlt!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "\"host\"-Parameter fehlt!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Altes Object %s existiert nicht." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "Das alte Objekt %s kann keiner UID zugeordnet werden." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, php-format msgid "Renaming folder %s to %s failed." msgstr "Fehler beim Umbenennen von Ordner %s nach %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "Fehler beim Lesen der Annotation %s[%s] von Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, php-format msgid "Retrieving the status for folder %s failed." msgstr "Fehler beim Lesen des Status von Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, php-format msgid "Selecting folder %s failed." msgstr "Fehler beim Öffnen des Ordners %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "Fehler beim Schreiben der Annotation %s[%s] von Ordner %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "Fehler beim Schreiben der Annotation %s[%s] von Ordner %s nach %s." #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "Die Nachricht mit der ID %s existiert nicht. Das liegt vermutlich daran, " "dass dieses Kolab-Objekt von jemand anderem verändert wurde, während Sie es " "bearbeitet haben. Orginalfehlermeldung: %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "Die Nachricht mit der ID %s existiert nicht. Das liegt vermutlich daran, " "dass dieses Kolab-Object von jemand anderem verändert wurde, während Sie es " "bearbeitet haben. Ihre Änderungen sind verloren." #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Dies ist ein Kolab-Groupware-Objekt. Um dieses Objekt anzuzeigen, benötigen " "Sie ein E-Mail-Programm, das das Kolab-Groupware-Format unterstützt. Eine " "Liste solcher Programme finden Sie unter %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" "%s konnte nicht nach %s umbenannt werden: Das Zielverzeichnis existiert " "bereits" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Die URL %s konnte nicht angesprochen werden. Antwort: %s" Horde_Kolab_Storage-2.0.5/locale/el/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000216412207101545023273 0ustar janjan4L`a<uPGeThis is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Αυτό είναι Kolab Groupware object. Για να δείτε το αντικείμενο αυτό χρειάζεσθε ένα πρόγραμμα email που καταλαβαίνει αυτή τη μορφή. Για λίστα τέτοιων προγραμμάτων μπορείτε να επισκευθείτε το %sΑδύνατη η μετονομασία του %s σε %s: ο φάκελλος υπάρχει ήδηHorde_Kolab_Storage-2.0.5/locale/el/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000506612207101545023304 0ustar janjan# Greek translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Ο φάκελος %s δεν υπάρχει" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Αυτό είναι Kolab Groupware object. Για να δείτε το αντικείμενο αυτό " "χρειάζεσθε ένα πρόγραμμα email που καταλαβαίνει αυτή τη μορφή. Για λίστα " "τέτοιων προγραμμάτων μπορείτε να επισκευθείτε το %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Αδύνατη η μετονομασία του %s σε %s: ο φάκελλος υπάρχει ήδη" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/en/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000365712207101545023305 0ustar janjan l =*/7Z$<1&nu= *I7t$<K&  Failed retrieving the message with ID %s. Original error: %s.Failed triggering folder %s. Error was: %sKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Failed retrieving the message with ID %s. Original error: %s.Failed triggering folder %s. Error was: %sKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sHorde_Kolab_Storage-2.0.5/locale/en/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000537712207101545023313 0ustar janjan# English translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Failed retrieving the message with ID %s. Original error: %s." #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Failed triggering folder %s. Error was: %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Kolab cache: Object uid %s does not exist in the cache!" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "Old object %s does not exist." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "Old object %s does not map to a uid." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Unable to rename %s to %s: destination folder already exists" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Unable to trigger URL %s. Response: %s" Horde_Kolab_Storage-2.0.5/locale/es/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000001333012207101545023301 0ustar janjan)d; *-$(R({9(C#5g (%3'7[=2*p/$2 W1x+.4! V  <j &  '  2 ;$1`,H0'WX>& 84+m<A<>U0p:6(q#)9F<#>C d=p) %) ! &  ' $"(#Connecting to server %s failed.Creating folder %s failed.Deleting folder %s failed.Error: %sFailed appending new message to folder %s.Failed deleting ACL on folder %s for user %s.Failed deleting message %s in folder %s.Failed deleting messages from folder %s.Failed expunging folder %s.Failed fetching body part %s for message %s in folder %s.Failed fetching message %s in folder %s.Failed fetching structure information for messages %s in folder %s.Failed moving message %s from folder %s to folder %s.Failed opening folder %s.Failed reading ACL on folder %s.Failed reading user rights on folder %s.Failed retrieving UIDs for folder %s.Failed retrieving status information for folder %s.Failed retrieving structure of message %s in folder %s.Failed retrieving the message with ID %s. Original error: %s.Failed setting ACL on folder %s for user %s to %s.Failed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Listing folders for %s failed.Missing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.Renaming folder %s to %s failed.Retrieving annotation %s[%s] on folder %s failed.Retrieving the status for folder %s failed.Selecting folder %s failed.Setting annotation %s[%s] on folder %s failed.Setting annotation %s[%s] on folder %s to %s failed.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-11-06 16:40+0100 PO-Revision-Date: 2013-06-11 20:26+0200 Last-Translator: Manuel P. Ayala , Juan C. Blanco Language-Team: i18n@lists.horde.org Language: es MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Ha fallado la conexión al servidor %s.Fallo al crear la carpeta %s.Fallo al eliminar la carpeta %s.Error: %sFallo al añadir un nuevo mensaje a la carpeta %s.Fallo al eliminar la ACL para la carpeta %s del usuario %s.Fallo al eliminar el mensaje %s de la carpeta %s.Fallo al eliminar mensajes de la carpeta %s.Fallo al purgar la carpeta %s.Fallo al obtener la parte %s del cuerpo del mensaje %s de la carpeta %s.Fallo al obtener el mensaje %s de la carpeta %s.Fallo al recuperar la información de estructura para los mensajes %s de la carpeta %s.Fallo al mover el mensaje %s de la carpeta %s a la carpeta %s.Fallo al abrir la carpeta %s.Fallo al leer la ACL de la carpeta %s.Fallo al leer los permisos del usuario de la carpeta %s.Fallo al obtener los UIDs de la carpeta %s.Fallo al obtener la información de estado de la carpeta %s.Fallo al recuperar la estructura del mensaje %s de la carpeta %s.Error al recuperar el mensaje con ID %s. Error original: %s.Fallo al cambiar la ACL de la carpeta %s del usuario %s al %s.Fallo al obtener la carpeta %s. El error fue: %sParámetro "%s" de "controlador" inválido. ¡Utilice "mock", "php", "pear", "horde", "horde-php" o "roundcube"!¡Tipo inválido "%s" de espacio de nombres ("namespace")!Ha fallado el listado de carpetas de %s.¡Falta el parámetro "driver"!¡Falta el parámetro "host"!El objeto %s antiguo no existe.El objeto %s antiguo carece de uid.Fallo al renombrar la carpeta %s como %s.Fallo al recuperar la anotación %s[%s] de la carpeta %s.Fallo al obtener la información de estado de la carpeta %s.Fallo al seleccionar la carpeta %s.Ha fallado el cambio de la anotación %s[%s] de la carpeta %s.Ha fallado el cambio de la anotación %s[%s] de la carpeta %s a %s.El mensaje con ID %s no existe. Esto probablemente quiere decir que el objeto Kolab ha sido modificado por alguien desde que recuperó el objeto del soporte. Error original: %sEl mensaje con ID %s no existe. Esto probablemente quiere decir que el objeto Kolab ha sido modificado por alguien mientras usted lo editaba. Sus modificaciones se han perdido.Ésto es un objeto de Kolab Groupware. Para verlo necesita un cliente de correo que entienda el formato Kolab Groupware. Para ver una lista de dichos clientes visite %sIncapaz de renombrar %s como %s: la carpeta destino ya existeImposible lanzar la URL %s. Respuesta: %sHorde_Kolab_Storage-2.0.5/locale/es/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002531312207101545023310 0ustar janjan# Spanish translations for Horde_Kolab_Storage package. # Copyright (C) 2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage package. # Automatically generated, 2013. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage \n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-11-06 16:40+0100\n" "PO-Revision-Date: 2013-06-11 20:26+0200\n" "Last-Translator: Manuel P. Ayala , Juan C. Blanco " "\n" "Language-Team: i18n@lists.horde.org\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed." msgstr "Ha fallado la conexión al servidor %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed." msgstr "Fallo al crear la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, php-format msgid "Deleting folder %s failed." msgstr "Fallo al eliminar la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "Error: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, php-format msgid "Failed appending new message to folder %s." msgstr "Fallo al añadir un nuevo mensaje a la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "Fallo al eliminar la ACL para la carpeta %s del usuario %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, php-format msgid "Failed deleting message %s in folder %s." msgstr "Fallo al eliminar el mensaje %s de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, php-format msgid "Failed deleting messages from folder %s." msgstr "Fallo al eliminar mensajes de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, php-format msgid "Failed expunging folder %s." msgstr "Fallo al purgar la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "" "Fallo al obtener la parte %s del cuerpo del mensaje %s de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, php-format msgid "Failed fetching message %s in folder %s." msgstr "Fallo al obtener el mensaje %s de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "" "Fallo al recuperar la información de estructura para los mensajes %s de la " "carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "Fallo al mover el mensaje %s de la carpeta %s a la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, php-format msgid "Failed opening folder %s." msgstr "Fallo al abrir la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, php-format msgid "Failed reading ACL on folder %s." msgstr "Fallo al leer la ACL de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, php-format msgid "Failed reading user rights on folder %s." msgstr "Fallo al leer los permisos del usuario de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "Fallo al obtener los UIDs de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, php-format msgid "Failed retrieving status information for folder %s." msgstr "Fallo al obtener la información de estado de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "Fallo al recuperar la estructura del mensaje %s de la carpeta %s." #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Error al recuperar el mensaje con ID %s. Error original: %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "Fallo al cambiar la ACL de la carpeta %s del usuario %s al %s." #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Fallo al obtener la carpeta %s. El error fue: %s" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Parámetro \"%s\" de \"controlador\" inválido. ¡Utilice \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\" o \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "¡Tipo inválido \"%s\" de espacio de nombres (\"namespace\")!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, php-format msgid "Listing folders for %s failed." msgstr "Ha fallado el listado de carpetas de %s." #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "¡Falta el parámetro \"driver\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "¡Falta el parámetro \"host\"!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "El objeto %s antiguo no existe." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "El objeto %s antiguo carece de uid." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, php-format msgid "Renaming folder %s to %s failed." msgstr "Fallo al renombrar la carpeta %s como %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "Fallo al recuperar la anotación %s[%s] de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, php-format msgid "Retrieving the status for folder %s failed." msgstr "Fallo al obtener la información de estado de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, php-format msgid "Selecting folder %s failed." msgstr "Fallo al seleccionar la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "Ha fallado el cambio de la anotación %s[%s] de la carpeta %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "Ha fallado el cambio de la anotación %s[%s] de la carpeta %s a %s." #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "El mensaje con ID %s no existe. Esto probablemente quiere decir que el " "objeto Kolab ha sido modificado por alguien desde que recuperó el objeto del " "soporte. Error original: %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "El mensaje con ID %s no existe. Esto probablemente quiere decir que el " "objeto Kolab ha sido modificado por alguien mientras usted lo editaba. Sus " "modificaciones se han perdido." #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Ésto es un objeto de Kolab Groupware. Para verlo necesita un cliente de " "correo que entienda el formato Kolab Groupware. Para ver una lista de " "dichos clientes visite %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Incapaz de renombrar %s como %s: la carpeta destino ya existe" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Imposible lanzar la URL %s. Respuesta: %s" Horde_Kolab_Storage-2.0.5/locale/et/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000001545412207101545023313 0ustar janjan0C())$S&x$&64"7W22%E4aO8?%_*2/4DH?A= <M * p & (E n   $ * . =A 5 % 8 > @S L <& ,(+&(;+d)=10*([>1M;C;$,5 ,C/pB=:!0\>&l`+%1',Y<-#9@OB:#!  ' &+  *"0,%-/ (#.)$Connecting to server %s failed. Error: %sCreating folder %s failed. Error: %sCreating folder %s%s failed. Error: %sDeleting folder %s failed. Error: %sDeleting folder %s%s failed. Error: %sFailed appending new message to folder %s%s. Error: %sFailed appending new message to folder %s. Error: %sFailed deleting ACL on folder %s for user %s. Error: %sFailed deleting message %s in folder %s. Error: %sFailed deleting messages from folder %s. Error: %sFailed expunging folder %s. Error: %sFailed fetching body part %s for message %s in folder %s%s. Error: %sFailed fetching message %s in folder %s%s. Error: %sFailed fetching structure information for messages %s in folder %s%s. Error: %sFailed message %s from folder %s to folder %s. Error: %sFailed moving message %s from folder %s to folder %s. Error: %sFailed opening folder %s%s. Error: %sFailed reading ACL on folder %s. Error: %sFailed reading user rights on folder %s. Error: %sFailed retrieving UIDs for folder %s. Error: %sFailed retrieving message %s in folder %s. Error: %sFailed retrieving mime part %s of message %s in folder %s. Error: %sFailed retrieving status information for folder %s%s. Error: %sFailed retrieving structure of message %s in folder %s. Error: %sFailed retrieving the message with ID %s. Original error: %s.Failed setting ACL on folder %s for user %s to %s. Error: %sFailed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Listing folders for %s failed. Error: %sMissing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.Renaming folder %s to %s failed. Error: %sRenaming folder %s%s to %s%s failed. Error: %sRetrieving annotation %s[%s] on folder %s%s failed. Error: %sRetrieving the status for folder %s failed. Error: %sSelecting folder %s failed. Error: %sSetting annotation %s[%s] on folder %s failed. Error: %sSetting annotation %s[%s] on folder %s to %s failed. Error: %sSetting annotation %s[%s] on folder %s%s to %s failed. Error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-09-20 13:49+0200 PO-Revision-Date: 2011-11-09 10:49+0200 Last-Translator: Alar Sing Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Ühendus serveriga %s ebaõnnestus. Viga: %sKausta %s loomine ebaõnnestus. Viga: %sKausta %s%s loomine ebaõnnestus. Viga: %sKausta %s kustutamine nurjus. Viga: %sKausta %s%s kustutamine nurjus. Viga: %sKirja lisamine kausta %s%s nurjus. Viga: %sKirja lisamine kausta %s nurjus. Viga: %sKasutaja %s õiguste kustutamine kaustalt %s nurjus. Viga: %sKirja %s kustutamine kaustast %s nurjus. Viga: %sKirjade kustutamine kaustast %s nurjus. Viga: %sKausta %s tühjendamine nurjus. Viga: %sKirja %s keha osad %s hankimine kaustast %s%s nurjus. Viga: %sKirja %s hankimine kaustast %s%s nurjus. Viga: %sNurjus struktuuri informatsiooni tõmbamine kirjale %s kaustas %s%s. Viga: %sKirja %s liigutamine kaustast %s kausta %s nurjus. Viga: %sKirja %s liigutamine kasutast %s kausta %s nurjus. Viga: %sKausta %s%s avamine nurjus. Viga: %sKausta %s õiguste lugemine nurjus. Viga: %sKausta %s kasutaja õiguste lugemine nurjus. Viga: %sKausta %s UID'ide hankimine nurjus. Viga: %sKirja %s hankimine kaustast %s nurjus. Viga: %sKirja %s multimeili osad %s hankimine kaustast %s nurjus. Viga: %sKausta %s%s staatus informatsiooni hankimine nurjus. Viga: %sKirja %s struktuuri hankimine kaustast %s nurjus. Viga: %sKirja ID'ga %s hankimine nurjus. Algne viga: %s.Kaustale %s kasutajale %s õiguste %s andmine nurjus. Viga: %sKausta %s päästmine nurjus. Viga: %sVigane "driver" parameeter "%s". Palun kasuta: "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Vigane "nimeruumi" tüüp "%s"!Kaustade näitamine %s'ile nurjus. Viga: %sPuudub "driver" parameeter!Puudub "host" parameeter!Vana objekti %s ei eksisteeri.Vana objekti %s ei ole seotud uid'ga.Kausta %s ümbernimetamine %s'ks nurjus. Viga: %sKausta %s%s nimetamine %s%s nurjus. Viga: %sAnnotatsiooni %s[%s] hankimine kaustas %s%s nurjus. Viga: %sKausta %s staatuse hankimine nurjus. Viga: %sKausta %s valimine nurjus. Viga: %sAnnotatsiooni %s[%s] seadmine kaustas %s nurjus. Viga: %sAnnotatsiooni %s[%s] muutmine kaustas %s %s'iks nurjus. Viga: %sAnnotatsiooni %s[%s] muutmine kaustas %s%s %s'iks nurjus. Viga: %sKiri ID'ga %s ei eksisteeri. Tõenäoliselt tähendab see, et Kolab objekti on muudetud kellegi teise poolt peale seda viimast objekti hankimist alusrakendusest. Algne viga: %sKiri ID'ga %s ei eksisteeri. Tõenäoliselt tähendab see, et Kolab objekti on muudetud kellegi teise poolt samal ajal kui sina. Sinu muutuse on kadunud.See on Kolab Groupware objekt. Selle objekti vaatamiseks vajad e-posti klienti mis mõistab Kolab Groupware formaati. Selliste e-posti klientide nimekirja leiad aadressilt %s%s ei saa ümber nimetada %s-ks: sihtkaust on juba olemas.Ei saa päästa URL: %s. Vastus: %sHorde_Kolab_Storage-2.0.5/locale/et/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002411312207101545023306 0ustar janjan# Estonian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-09-20 13:49+0200\n" "PO-Revision-Date: 2011-11-09 10:49+0200\n" "Last-Translator: Alar Sing \n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed. Error: %s" msgstr "Ühendus serveriga %s ebaõnnestus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed. Error: %s" msgstr "Kausta %s loomine ebaõnnestus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:218 #, php-format msgid "Creating folder %s%s failed. Error: %s" msgstr "Kausta %s%s loomine ebaõnnestus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:136 #, php-format msgid "Deleting folder %s failed. Error: %s" msgstr "Kausta %s kustutamine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:245 #, php-format msgid "Deleting folder %s%s failed. Error: %s" msgstr "Kausta %s%s kustutamine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:691 #, php-format msgid "Failed appending new message to folder %s%s. Error: %s" msgstr "Kirja lisamine kausta %s%s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:602 #, php-format msgid "Failed appending new message to folder %s. Error: %s" msgstr "Kirja lisamine kausta %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:277 #, php-format msgid "Failed deleting ACL on folder %s for user %s. Error: %s" msgstr "Kasutaja %s õiguste kustutamine kaustalt %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:724 #, php-format msgid "Failed deleting message %s in folder %s. Error: %s" msgstr "Kirja %s kustutamine kaustast %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:629 #, php-format msgid "Failed deleting messages from folder %s. Error: %s" msgstr "Kirjade kustutamine kaustast %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:785 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:682 #, php-format msgid "Failed expunging folder %s. Error: %s" msgstr "Kausta %s tühjendamine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:657 #, php-format msgid "Failed fetching body part %s for message %s in folder %s%s. Error: %s" msgstr "Kirja %s keha osad %s hankimine kaustast %s%s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:590 #, php-format msgid "Failed fetching message %s in folder %s%s. Error: %s" msgstr "Kirja %s hankimine kaustast %s%s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:625 #, php-format msgid "" "Failed fetching structure information for messages %s in folder %s%s. Error: " "%s" msgstr "" "Nurjus struktuuri informatsiooni tõmbamine kirjale %s kaustas %s%s. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:758 #, php-format msgid "Failed message %s from folder %s to folder %s. Error: %s" msgstr "Kirja %s liigutamine kaustast %s kausta %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:658 #, php-format msgid "Failed moving message %s from folder %s to folder %s. Error: %s" msgstr "Kirja %s liigutamine kasutast %s kausta %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:502 #, php-format msgid "Failed opening folder %s%s. Error: %s" msgstr "Kausta %s%s avamine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:318 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:197 #, php-format msgid "Failed reading ACL on folder %s. Error: %s" msgstr "Kausta %s õiguste lugemine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:225 #, php-format msgid "Failed reading user rights on folder %s. Error: %s" msgstr "Kausta %s kasutaja õiguste lugemine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:467 #, php-format msgid "Failed retrieving UIDs for folder %s. Error: %s" msgstr "Kausta %s UID'ide hankimine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:498 #, php-format msgid "Failed retrieving message %s in folder %s. Error: %s" msgstr "Kirja %s hankimine kaustast %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:571 #, php-format msgid "Failed retrieving mime part %s of message %s in folder %s. Error: %s" msgstr "Kirja %s multimeili osad %s hankimine kaustast %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:532 #, php-format msgid "Failed retrieving status information for folder %s%s. Error: %s" msgstr "Kausta %s%s staatus informatsiooni hankimine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:537 #, php-format msgid "Failed retrieving structure of message %s in folder %s. Error: %s" msgstr "Kirja %s struktuuri hankimine kaustast %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:843 #: lib/Horde/Kolab/Storage/Folder/Base.php:849 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Kirja ID'ga %s hankimine nurjus. Algne viga: %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:372 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:251 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s. Error: %s" msgstr "Kaustale %s kasutajale %s õiguste %s andmine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Kausta %s päästmine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Factory.php:182 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Vigane \"driver\" parameeter \"%s\". Palun kasuta: \"mock\", \"php\", \"pear" "\", \"horde\", \"horde-php\", and \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:244 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Vigane \"nimeruumi\" tüüp \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:182 #, php-format msgid "Listing folders for %s failed. Error: %s" msgstr "Kaustade näitamine %s'ile nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Factory.php:139 msgid "Missing \"driver\" parameter!" msgstr "Puudub \"driver\" parameeter!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:146 msgid "Missing \"host\" parameter!" msgstr "Puudub \"host\" parameeter!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Vana objekti %s ei eksisteeri." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "Vana objekti %s ei ole seotud uid'ga." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:163 #, php-format msgid "Renaming folder %s to %s failed. Error: %s" msgstr "Kausta %s ümbernimetamine %s'ks nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:274 #, php-format msgid "Renaming folder %s%s to %s%s failed. Error: %s" msgstr "Kausta %s%s nimetamine %s%s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:441 #, php-format msgid "Retrieving annotation %s[%s] on folder %s%s failed. Error: %s" msgstr "Annotatsiooni %s[%s] hankimine kaustas %s%s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:436 #, php-format msgid "Retrieving the status for folder %s failed. Error: %s" msgstr "Kausta %s staatuse hankimine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:410 #, php-format msgid "Selecting folder %s failed. Error: %s" msgstr "Kausta %s valimine nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:329 #, php-format msgid "Setting annotation %s[%s] on folder %s failed. Error: %s" msgstr "Annotatsiooni %s[%s] seadmine kaustas %s nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:360 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed. Error: %s" msgstr "Annotatsiooni %s[%s] muutmine kaustas %s %s'iks nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:473 #, php-format msgid "Setting annotation %s[%s] on folder %s%s to %s failed. Error: %s" msgstr "Annotatsiooni %s[%s] muutmine kaustas %s%s %s'iks nurjus. Viga: %s" #: lib/Horde/Kolab/Storage/Data/Base.php:260 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "Kiri ID'ga %s ei eksisteeri. Tõenäoliselt tähendab see, et Kolab objekti on " "muudetud kellegi teise poolt peale seda viimast objekti hankimist " "alusrakendusest. Algne viga: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:682 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "Kiri ID'ga %s ei eksisteeri. Tõenäoliselt tähendab see, et Kolab objekti on " "muudetud kellegi teise poolt samal ajal kui sina. Sinu muutuse on kadunud." #: lib/Horde/Kolab/Storage/Data/Format/Mime.php:217 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "See on Kolab Groupware objekt. Selle objekti vaatamiseks vajad e-posti " "klienti mis mõistab Kolab Groupware formaati. Selliste e-posti klientide " "nimekirja leiad aadressilt %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:365 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "%s ei saa ümber nimetada %s-ks: sihtkaust on juba olemas." #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Ei saa päästa URL: %s. Vastus: %s" Horde_Kolab_Storage-2.0.5/locale/eu/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000000144612207101545023310 0ustar janjanDl )!" Connecting to server %s failed.Creating folder %s failed.Deleting folder %s failed.Error: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-11-06 16:40+0100 PO-Revision-Date: 2013-01-16 13:47+0100 Last-Translator: Ibon Igartua Language-Team: Euskal Herriko Unibertsitatea Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Poedit-Language: Basque %s zerbitzarirako konexioak huts egin du.Huts egin du %s karpeta sortzean.Huts egin du %s karpeta ezabatzeanErrorea: %sHorde_Kolab_Storage-2.0.5/locale/eu/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002213512207101545023311 0ustar janjan# Basque translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-11-06 16:40+0100\n" "PO-Revision-Date: 2013-01-16 13:47+0100\n" "Last-Translator: Ibon Igartua \n" "Language-Team: Euskal Herriko Unibertsitatea \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-Language: Basque\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed." msgstr "%s zerbitzarirako konexioak huts egin du." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed." msgstr "Huts egin du %s karpeta sortzean." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, php-format msgid "Deleting folder %s failed." msgstr "Huts egin du %s karpeta ezabatzean" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "Errorea: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, php-format msgid "Failed appending new message to folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, fuzzy, php-format msgid "Failed deleting message %s in folder %s." msgstr "Errorea gertatu da \"%s\" karpetatik mezuak ezabatzean." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, fuzzy, php-format msgid "Failed deleting messages from folder %s." msgstr "Errorea gertatu da \"%s\" karpetatik mezuak ezabatzean." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, php-format msgid "Failed expunging folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, fuzzy, php-format msgid "Failed fetching message %s in folder %s." msgstr "Mezu bat betiko borratzen bidalitako mezuen karpetatik (%s)." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, fuzzy, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "Mezu bat betiko borratzen bidalitako mezuen karpetatik (%s)." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, php-format msgid "Failed opening folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, php-format msgid "Failed reading ACL on folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, php-format msgid "Failed reading user rights on folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, fuzzy, php-format msgid "Failed retrieving status information for folder %s." msgstr "Errorea gertatu da %s(r)en libre/lanpetuta informazioa eskuratzean: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "" #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Huts egin du gehitzean %s --> %s: %s" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, fuzzy, php-format msgid "Listing folders for %s failed." msgstr "Erabiltzaileak zerrendatzea desgaituta dago." #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Ez dago %s postontzirik." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, fuzzy, php-format msgid "Renaming folder %s to %s failed." msgstr "Ez da onartzen euskarri-moduluei izena aldatzea." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, fuzzy, php-format msgid "Retrieving the status for folder %s failed." msgstr "" "Huts egin du zirriborroa gordetzean. Ez da zirriborro-karpetarik zehaztu." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, php-format msgid "Selecting folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Ezin da ezabatu %s fitxategia: %s" Horde_Kolab_Storage-2.0.5/locale/fa/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000110612207101545023254 0ustar janjan,<P<QJlUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit نمی‌توان %s را به %s تغییر نام داد: پوشه مقصد از قبل موجود استHorde_Kolab_Storage-2.0.5/locale/fa/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000426612207101545023273 0ustar janjan# Persian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "پوشه %s موجود نیست " #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "نمی‌توان %s را به %s تغییر نام داد: پوشه مقصد از قبل موجود است" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/fi/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000001340212207101545023270 0ustar janjan)d; *-$(R({9(C#5g (%3'7[=2*p/$2 W1x+.4! V  <j &  #a   4 ?,D*q4>*;;8w -<,<,i:DH6_x%'5]x##1-*> i3>Ov; %) ! &  ' $"(#Connecting to server %s failed.Creating folder %s failed.Deleting folder %s failed.Error: %sFailed appending new message to folder %s.Failed deleting ACL on folder %s for user %s.Failed deleting message %s in folder %s.Failed deleting messages from folder %s.Failed expunging folder %s.Failed fetching body part %s for message %s in folder %s.Failed fetching message %s in folder %s.Failed fetching structure information for messages %s in folder %s.Failed moving message %s from folder %s to folder %s.Failed opening folder %s.Failed reading ACL on folder %s.Failed reading user rights on folder %s.Failed retrieving UIDs for folder %s.Failed retrieving status information for folder %s.Failed retrieving structure of message %s in folder %s.Failed retrieving the message with ID %s. Original error: %s.Failed setting ACL on folder %s for user %s to %s.Failed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Listing folders for %s failed.Missing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.Renaming folder %s to %s failed.Retrieving annotation %s[%s] on folder %s failed.Retrieving the status for folder %s failed.Selecting folder %s failed.Setting annotation %s[%s] on folder %s failed.Setting annotation %s[%s] on folder %s to %s failed.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-11-06 16:40+0100 PO-Revision-Date: 2012-10-29 08:12:27+0200 Last-Translator: Leena Heino Language-Team: Finnish Language: fi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Yhteys palvelimeen %s epäonnistui.Kansion %s luonti epäonnistui.Kansion %s poisto epäonnistui.Virhe: %sUuden viestin lisääminen kansioon %s epäonnistui.Oikeuksien poisto kansiosta %s käyttäjältä %s epäonnistui.Viestin %s poisto kansiosta %s epäonnistui.Viestien poisto kansiosta %s epäonnistui.Kansion %s poistettujen tyhjentäminen epäonnistui.Viestin osion %s haku viestistä %s kansiossa %s epäonnistui.Viestin %s haku kansiosta %s epäonnistui.Viestien %s rakennetietojen haku kansiosta %s epäonnistui.Viestin %s siirto kansiosta %s kansioon %s epäonnistui.Kansion %s aukaisu epäonnistui.Kansion %s oikeuksien lukeminen epäonnistui.Käyttäjän oikeuksien lukeminen kansiosta %s epäonnistui.UID tietojen haku kansiosta %s epäonnistui.Tilatietojen haku kansiosta %s epäonnistui.Viestin %s rakennetietojen haku kansiosta %s epäonnistui.Viestin haku epäonnistui ID tunnisteella %s. Virheilmoitus oli: %s.Oikeuksien asetus kansioon %s käyttäjälle %s muotoon %s epäonnistui.Kansion %s heräte epäonnistui. Virheilmoitus oli: %sEpäkelpo "ajuri" parametri "%s". Käytä jotakin näistä "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Epäkelpo "nimiavaruus" tyyppi "%s"!Kansioiden listaus %s:lle epäonnistui.Puuttuu "ajuri" parametri!Puuttuu "palvelin" parametri!Vanhaa objektia %s ei ole olemassa.Vanha objekti %s ei muunnu uid:ksi.Kansion %s nimeäminen kansioksi %s epäonnistui.Lisätiedon %s[%s] kansiosta %s epäonnistui.Tilatiedon haku kansiosta %s epäonnistui.Kansion %s valinta epäonnistui.Lisätiedon %s[%s] asetus kansioon %s epäonnistui.Lisätiedon %s[%s] asetus kansioon %s muotoon %s epäonnistui.Viestiä ID:llä %s ei ole olemassa. Tämä todennäköisesti tarkoittaa, että jokin muu taho on muokannut Kolab-objekia sen jälkeen kun se haettiin taustajärjestelmästä. Virheilmoitus oli: %sViestiä ID:llä %s ei ole olemassa. Tämä todennäköisesti tarkoittaa, että Kolab-objekia on muokannut joku muu taho samaan aikaan oli editoimassa sitä. Tämän takia tekemäsi muutokset ovat kadonneet.Tämä on Kolab Groupware objekti. Katsoaksesi tämän objektin sisältöä sinulla pitää olla Kolab Groupwaren formaattia ymmärtävä sähköpostiohjelma. Lista yhteensopivista sähköpostiohjelmista löytyy osoitteesta %sUudelleennimeäminen %s %s:ksi epäonnistui koska kohdehakemisto on jo olemassaEi voida lähettää herätettä URLiin %s. Vastaus oli: %sHorde_Kolab_Storage-2.0.5/locale/fi/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002536312207101545023304 0ustar janjan# Finnish translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Leena Heino , 2010-2012. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-11-06 16:40+0100\n" "PO-Revision-Date: 2012-10-29 08:12:27+0200\n" "Last-Translator: Leena Heino \n" "Language-Team: Finnish \n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed." msgstr "Yhteys palvelimeen %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed." msgstr "Kansion %s luonti epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, php-format msgid "Deleting folder %s failed." msgstr "Kansion %s poisto epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "Virhe: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, php-format msgid "Failed appending new message to folder %s." msgstr "Uuden viestin lisääminen kansioon %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "Oikeuksien poisto kansiosta %s käyttäjältä %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, php-format msgid "Failed deleting message %s in folder %s." msgstr "Viestin %s poisto kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, php-format msgid "Failed deleting messages from folder %s." msgstr "Viestien poisto kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, php-format msgid "Failed expunging folder %s." msgstr "Kansion %s poistettujen tyhjentäminen epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "Viestin osion %s haku viestistä %s kansiossa %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, php-format msgid "Failed fetching message %s in folder %s." msgstr "Viestin %s haku kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "Viestien %s rakennetietojen haku kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "Viestin %s siirto kansiosta %s kansioon %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, php-format msgid "Failed opening folder %s." msgstr "Kansion %s aukaisu epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, php-format msgid "Failed reading ACL on folder %s." msgstr "Kansion %s oikeuksien lukeminen epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, php-format msgid "Failed reading user rights on folder %s." msgstr "Käyttäjän oikeuksien lukeminen kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "UID tietojen haku kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, php-format msgid "Failed retrieving status information for folder %s." msgstr "Tilatietojen haku kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "Viestin %s rakennetietojen haku kansiosta %s epäonnistui." #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Viestin haku epäonnistui ID tunnisteella %s. Virheilmoitus oli: %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "Oikeuksien asetus kansioon %s käyttäjälle %s muotoon %s epäonnistui." #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Kansion %s heräte epäonnistui. Virheilmoitus oli: %s" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Epäkelpo \"ajuri\" parametri \"%s\". Käytä jotakin näistä \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Epäkelpo \"nimiavaruus\" tyyppi \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, php-format msgid "Listing folders for %s failed." msgstr "Kansioiden listaus %s:lle epäonnistui." #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "Puuttuu \"ajuri\" parametri!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "Puuttuu \"palvelin\" parametri!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Vanhaa objektia %s ei ole olemassa." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "Vanha objekti %s ei muunnu uid:ksi." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, php-format msgid "Renaming folder %s to %s failed." msgstr "Kansion %s nimeäminen kansioksi %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "Lisätiedon %s[%s] kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, php-format msgid "Retrieving the status for folder %s failed." msgstr "Tilatiedon haku kansiosta %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, php-format msgid "Selecting folder %s failed." msgstr "Kansion %s valinta epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "Lisätiedon %s[%s] asetus kansioon %s epäonnistui." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "Lisätiedon %s[%s] asetus kansioon %s muotoon %s epäonnistui." #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "Viestiä ID:llä %s ei ole olemassa. Tämä todennäköisesti tarkoittaa, että " "jokin muu taho on muokannut Kolab-objekia sen jälkeen kun se haettiin " "taustajärjestelmästä. Virheilmoitus oli: %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "Viestiä ID:llä %s ei ole olemassa. Tämä todennäköisesti tarkoittaa, että " "Kolab-objekia on muokannut joku muu taho samaan aikaan oli editoimassa sitä. " "Tämän takia tekemäsi muutokset ovat kadonneet." #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Tämä on Kolab Groupware objekti. Katsoaksesi tämän objektin sisältöä sinulla " "pitää olla Kolab Groupwaren formaattia ymmärtävä sähköpostiohjelma. Lista " "yhteensopivista sähköpostiohjelmista löytyy osoitteesta %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" "Uudelleennimeäminen %s %s:ksi epäonnistui koska kohdehakemisto on jo olemassa" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Ei voida lähettää herätettä URLiin %s. Vastaus oli: %s" Horde_Kolab_Storage-2.0.5/locale/fr/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000242412207101545023301 0ustar janjanL |7$$<t=-AKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Cache Kolab : l'objet d'uid %s n'existe pas dans le cache !L'ancien objet %s n'existe pas.L'ancien objet %s ne correspond à aucun uid.Ceci est un objet Kolab Groupware. Pour voir cet objet, vous devrez avoir un client de courriel qui comprend le format Kolab Groupware. Pour une liste de ces clients de courriel, visitez %sImpossible de renommer %s en %s : le dossier cible existe déjàHorde_Kolab_Storage-2.0.5/locale/fr/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000515412207101545023311 0ustar janjan# French translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Erreur de récupération du message IMAP %s. L'erreur était %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Erreur de récupération du message IMAP %s. L'erreur était %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Cache Kolab : l'objet d'uid %s n'existe pas dans le cache !" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "L'ancien objet %s n'existe pas." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "L'ancien objet %s ne correspond à aucun uid." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Ceci est un objet Kolab Groupware. Pour voir cet objet, vous devrez avoir un " "client de courriel qui comprend le format Kolab Groupware. Pour une liste de " "ces clients de courriel, visitez %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Impossible de renommer %s en %s : le dossier cible existe déjà" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/gl/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023272 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/gl/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000412412207101545023300 0ustar janjan# Galician translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Fallou ó recuperar as preferencias para " #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/he/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000065712207101545023274 0ustar janjan$,8u9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Horde_Kolab_Storage-2.0.5/locale/he/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000412112207101545023267 0ustar janjan# Hebrew translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/hr/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000001617512207101545023315 0ustar janjan0C())$S&x$&64"7W22%E4aO8?%_*2/4DH?A= <M * p & (E n   $ * . =A 5 % 8 > @S L <& 8+$-P*~,;9BL74-P*<{T@ @N-1A.13`B=D?Z?*t*z0",4O891&)?PDFLA+Q!  ' &+  *"0,%-/ (#.)$Connecting to server %s failed. Error: %sCreating folder %s failed. Error: %sCreating folder %s%s failed. Error: %sDeleting folder %s failed. Error: %sDeleting folder %s%s failed. Error: %sFailed appending new message to folder %s%s. Error: %sFailed appending new message to folder %s. Error: %sFailed deleting ACL on folder %s for user %s. Error: %sFailed deleting message %s in folder %s. Error: %sFailed deleting messages from folder %s. Error: %sFailed expunging folder %s. Error: %sFailed fetching body part %s for message %s in folder %s%s. Error: %sFailed fetching message %s in folder %s%s. Error: %sFailed fetching structure information for messages %s in folder %s%s. Error: %sFailed message %s from folder %s to folder %s. Error: %sFailed moving message %s from folder %s to folder %s. Error: %sFailed opening folder %s%s. Error: %sFailed reading ACL on folder %s. Error: %sFailed reading user rights on folder %s. Error: %sFailed retrieving UIDs for folder %s. Error: %sFailed retrieving message %s in folder %s. Error: %sFailed retrieving mime part %s of message %s in folder %s. Error: %sFailed retrieving status information for folder %s%s. Error: %sFailed retrieving structure of message %s in folder %s. Error: %sFailed retrieving the message with ID %s. Original error: %s.Failed setting ACL on folder %s for user %s to %s. Error: %sFailed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Listing folders for %s failed. Error: %sMissing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.Renaming folder %s to %s failed. Error: %sRenaming folder %s%s to %s%s failed. Error: %sRetrieving annotation %s[%s] on folder %s%s failed. Error: %sRetrieving the status for folder %s failed. Error: %sSelecting folder %s failed. Error: %sSetting annotation %s[%s] on folder %s failed. Error: %sSetting annotation %s[%s] on folder %s to %s failed. Error: %sSetting annotation %s[%s] on folder %s%s to %s failed. Error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-09-20 13:49+0200 PO-Revision-Date: 2011-11-08 16:49+0200 Last-Translator: Valentin Vidic Language-Team: i18n@lists.horde.org Language: hr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Nije uspjelo povezivanje na poslužitelj %s. Greška: %sNije uspjelo dodavanje mape %s. Greška: %sNije uspjelo dodavanje mape %s%s. Greška: %sNije uspjelo brisanje mape %s. Greška: %sNije uspjelo brisanje mape %s%s. Greška: %sNije uspjelo dodavanje nove poruke u mapu %s%s. Greška: %sNije uspjelo dodavanje nove poruke u mapu %s. Greška: %sNije uspjelo brisanje ACLa na mapi %s za korisnika %s. Greška: %sNije uspjelo brisanje poruke %s iz mape %s. Greška: %sNije uspjelo brisanje poruka iz mape %s. Greška: %sNije uspjelo čišćenje mape %s. Greška: %sNije uspjelo dohvaćanje dijela sadržaja %s poruke %s iz mape %s%s. Greška: %sNije uspjelo dohvaćanje poruke %s iz mape %s%s. Greška: %sNije uspjelo dohvaćanje informacija o strukturi poruke %s iz mape %s%s. Greška: %sNije uspjelo micanje poruke %s iz mape %s u mapu %s. Greška: %sNije uspjelo micanje poruke %s iz mape %s u mapu %s. Greška: %sNije uspjelo otvaranje mape %s%s. Greška: %sNije uspjelo čitanje ACLa s mape %s. Greška: %sNije uspjelo čitanje korisničkih ovlasti s mape %s. Greška: %sNije uspio dohvat UIDa za mapu %s. Greška: %sNije uspio dohvat poruke %s iz mape %s. Greška: %sNije uspio dohvat mime dijela %s poruke %s iz mape %s. Greška: %sNije uspio dohvat informacija o status mape %s%s. Greška: %sNije uspjelo dohvaćanje strukture poruke %s iz mape %s. Greška: %sNije uspjelo dohvaćanje poruke s ID-om %s. Izvorna greška: %sNije uspjelo ACLa na mapi %s za korisnika %s na %s. Greška: %sNije uspjelo okidanje mape %s. Greška: %sNeispravan "driver" parametar "%s". Molimo koristite samo "mock", "php", "pear", "horde", "horde-php" i "roundcube"!Neispravan tip "imeničkog prostora" "%s"!Nije uspio dohvat popisa mapa za %s. Greška: %sNedostaje parametar "driver"!Nedostaje parametar "host"!Stari objekt %s ne postoji.Stari objekt %s ne odgovara uid-u.Nije uspjelo preimenovanje mape %s u %s. Greška: %sNije uspjelo preimenovanje mape %s%s u %s%s. Greška: %sNije uspio dohvat oznake %s[%s] sa mape %s%s. Greška: %sNije uspio dohvat statusa za mapu %s. Greška: %sNije uspio odabir mape %s. Greška: %sNije uspjelo postavljanje oznake %s[%s] na mapi %s. Greška: %sNije uspjelo postavljanje oznake %s[%s] na mapi %s u %s. Greška: %sNije uspjelo postavljanje oznake %s[%s] na mapi %s%s u %s. Greška: %sPoruka s identifikatorom %s ne postoji. Ovo vjerojatno znači da je netko drugi promijenio Kolab objekt dok ste ga uređivali. Izvorna greška: %sPoruka s identifikatorom %s ne postoji. Ovo vjerojatno znači da je netko drugi promijenio Kolab objekt dok ste ga uređivali. Vaše promjene su izgubljene.Ovo je objekt Kolab Groupware-a. Kako biste pregledali ovaj objekt, bit će vam potreban e-mail klijent koji razumije Kolab Groupware format. Za listu takvih e-mail klijenata molimo posjetiti %sNije uspjelo preimenovanje %s u %s: odredišna mapa već postoji.Nije uspjelo okidanje URL-a %s. Odgovor: %sHorde_Kolab_Storage-2.0.5/locale/hr/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002466712207101545023325 0ustar janjan# Croatian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Valentin Vidic , 2011. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-09-20 13:49+0200\n" "PO-Revision-Date: 2011-11-08 16:49+0200\n" "Last-Translator: Valentin Vidic \n" "Language-Team: i18n@lists.horde.org\n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed. Error: %s" msgstr "Nije uspjelo povezivanje na poslužitelj %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed. Error: %s" msgstr "Nije uspjelo dodavanje mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:218 #, php-format msgid "Creating folder %s%s failed. Error: %s" msgstr "Nije uspjelo dodavanje mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:136 #, php-format msgid "Deleting folder %s failed. Error: %s" msgstr "Nije uspjelo brisanje mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:245 #, php-format msgid "Deleting folder %s%s failed. Error: %s" msgstr "Nije uspjelo brisanje mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:691 #, php-format msgid "Failed appending new message to folder %s%s. Error: %s" msgstr "Nije uspjelo dodavanje nove poruke u mapu %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:602 #, php-format msgid "Failed appending new message to folder %s. Error: %s" msgstr "Nije uspjelo dodavanje nove poruke u mapu %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:277 #, php-format msgid "Failed deleting ACL on folder %s for user %s. Error: %s" msgstr "Nije uspjelo brisanje ACLa na mapi %s za korisnika %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:724 #, php-format msgid "Failed deleting message %s in folder %s. Error: %s" msgstr "Nije uspjelo brisanje poruke %s iz mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:629 #, php-format msgid "Failed deleting messages from folder %s. Error: %s" msgstr "Nije uspjelo brisanje poruka iz mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:785 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:682 #, php-format msgid "Failed expunging folder %s. Error: %s" msgstr "Nije uspjelo čišćenje mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:657 #, php-format msgid "Failed fetching body part %s for message %s in folder %s%s. Error: %s" msgstr "" "Nije uspjelo dohvaćanje dijela sadržaja %s poruke %s iz mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:590 #, php-format msgid "Failed fetching message %s in folder %s%s. Error: %s" msgstr "Nije uspjelo dohvaćanje poruke %s iz mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:625 #, php-format msgid "" "Failed fetching structure information for messages %s in folder %s%s. Error: " "%s" msgstr "" "Nije uspjelo dohvaćanje informacija o strukturi poruke %s iz mape %s%s. " "Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:758 #, php-format msgid "Failed message %s from folder %s to folder %s. Error: %s" msgstr "Nije uspjelo micanje poruke %s iz mape %s u mapu %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:658 #, php-format msgid "Failed moving message %s from folder %s to folder %s. Error: %s" msgstr "Nije uspjelo micanje poruke %s iz mape %s u mapu %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:502 #, php-format msgid "Failed opening folder %s%s. Error: %s" msgstr "Nije uspjelo otvaranje mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:318 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:197 #, php-format msgid "Failed reading ACL on folder %s. Error: %s" msgstr "Nije uspjelo čitanje ACLa s mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:225 #, php-format msgid "Failed reading user rights on folder %s. Error: %s" msgstr "Nije uspjelo čitanje korisničkih ovlasti s mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:467 #, php-format msgid "Failed retrieving UIDs for folder %s. Error: %s" msgstr "Nije uspio dohvat UIDa za mapu %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:498 #, php-format msgid "Failed retrieving message %s in folder %s. Error: %s" msgstr "Nije uspio dohvat poruke %s iz mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:571 #, php-format msgid "Failed retrieving mime part %s of message %s in folder %s. Error: %s" msgstr "Nije uspio dohvat mime dijela %s poruke %s iz mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:532 #, php-format msgid "Failed retrieving status information for folder %s%s. Error: %s" msgstr "Nije uspio dohvat informacija o status mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:537 #, php-format msgid "Failed retrieving structure of message %s in folder %s. Error: %s" msgstr "Nije uspjelo dohvaćanje strukture poruke %s iz mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:843 #: lib/Horde/Kolab/Storage/Folder/Base.php:849 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Nije uspjelo dohvaćanje poruke s ID-om %s. Izvorna greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:372 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:251 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s. Error: %s" msgstr "Nije uspjelo ACLa na mapi %s za korisnika %s na %s. Greška: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Nije uspjelo okidanje mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Factory.php:182 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Neispravan \"driver\" parametar \"%s\". Molimo koristite samo \"mock\", \"php" "\", \"pear\", \"horde\", \"horde-php\" i \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:244 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Neispravan tip \"imeničkog prostora\" \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:182 #, php-format msgid "Listing folders for %s failed. Error: %s" msgstr "Nije uspio dohvat popisa mapa za %s. Greška: %s" #: lib/Horde/Kolab/Storage/Factory.php:139 msgid "Missing \"driver\" parameter!" msgstr "Nedostaje parametar \"driver\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:146 msgid "Missing \"host\" parameter!" msgstr "Nedostaje parametar \"host\"!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Stari objekt %s ne postoji." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "Stari objekt %s ne odgovara uid-u." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:163 #, php-format msgid "Renaming folder %s to %s failed. Error: %s" msgstr "Nije uspjelo preimenovanje mape %s u %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:274 #, php-format msgid "Renaming folder %s%s to %s%s failed. Error: %s" msgstr "Nije uspjelo preimenovanje mape %s%s u %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:441 #, php-format msgid "Retrieving annotation %s[%s] on folder %s%s failed. Error: %s" msgstr "Nije uspio dohvat oznake %s[%s] sa mape %s%s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:436 #, php-format msgid "Retrieving the status for folder %s failed. Error: %s" msgstr "Nije uspio dohvat statusa za mapu %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:410 #, php-format msgid "Selecting folder %s failed. Error: %s" msgstr "Nije uspio odabir mape %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:329 #, php-format msgid "Setting annotation %s[%s] on folder %s failed. Error: %s" msgstr "Nije uspjelo postavljanje oznake %s[%s] na mapi %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:360 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed. Error: %s" msgstr "Nije uspjelo postavljanje oznake %s[%s] na mapi %s u %s. Greška: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:473 #, php-format msgid "Setting annotation %s[%s] on folder %s%s to %s failed. Error: %s" msgstr "Nije uspjelo postavljanje oznake %s[%s] na mapi %s%s u %s. Greška: %s" #: lib/Horde/Kolab/Storage/Data/Base.php:260 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "Poruka s identifikatorom %s ne postoji. Ovo vjerojatno znači da je netko " "drugi promijenio Kolab objekt dok ste ga uređivali. Izvorna greška: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:682 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "Poruka s identifikatorom %s ne postoji. Ovo vjerojatno znači da je netko " "drugi promijenio Kolab objekt dok ste ga uređivali. Vaše promjene su " "izgubljene." #: lib/Horde/Kolab/Storage/Data/Format/Mime.php:217 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Ovo je objekt Kolab Groupware-a. Kako biste pregledali ovaj objekt, bit će " "vam potreban e-mail klijent koji razumije Kolab Groupware format. Za listu " "takvih e-mail klijenata molimo posjetiti %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:365 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Nije uspjelo preimenovanje %s u %s: odredišna mapa već postoji." #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Nije uspjelo okidanje URL-a %s. Odgovor: %s" Horde_Kolab_Storage-2.0.5/locale/hu/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000246712207101545023315 0ustar janjanL |7$$<u;!9!@Kolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Kolab cache: a(z) %s objektumazonosító nincs a cache-ben!A régi %s objektum nem létezik.A régi %s objektum nem felel meg egy azonosítónak sem.Ez egy Kolab Groupware objektum. Az ilyen objektum megjelenítéséhez olyan email kliensprogram szükséges, amely képes a Kolab Groupware formátum kezelésére. Ilyen email kliensek listája látható itt: %s%s nem nevezhető át %s névre: már létezik ilyen nevű mappaHorde_Kolab_Storage-2.0.5/locale/hu/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000532412207101545023315 0ustar janjan# Hungarian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" "Nem sikerült a(z) %s azonosítójú levél IMAP-on keresztül való olvasása. A " "hiba: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" "Nem sikerült a(z) %s azonosítójú levél IMAP-on keresztül való olvasása. A " "hiba: %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Kolab cache: a(z) %s objektumazonosító nincs a cache-ben!" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "A régi %s objektum nem létezik." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "A régi %s objektum nem felel meg egy azonosítónak sem." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Ez egy Kolab Groupware objektum. Az ilyen objektum megjelenítéséhez olyan " "email kliensprogram szükséges, amely képes a Kolab Groupware formátum " "kezelésére. Ilyen email kliensek listája látható itt: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "%s nem nevezhető át %s névre: már létezik ilyen nevű mappa" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/id/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023264 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/id/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000404612207101545023275 0ustar janjan# Indonesian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/is/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023303 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/is/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000404512207101545023313 0ustar janjan# Icelandic translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/it/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000241512207101545023306 0ustar janjanL |7$$<u9!& CKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Cache Kolab: l'oggetto con uid %s non esiste nella cache!Il vecchio oggetto %s non esiste:Il vecchio oggetto %s non mappa un uidQuesto è un oggetto Kolab Groupware. Per vedere questo oggetto è necessario utilizzare un client che supporti il formato Kolab Groupware. per un elenco dei client compatibili visitare %sImpossibile rinominare %s in %s: cartella di destinazione esistenteHorde_Kolab_Storage-2.0.5/locale/it/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000515612207101545023320 0ustar janjan# Italian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Fallito lo scaricamento IMAP del messaggio %s. L'errore è stato %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Fallito lo scaricamento IMAP del messaggio %s. L'errore è stato %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Cache Kolab: l'oggetto con uid %s non esiste nella cache!" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "Il vecchio oggetto %s non esiste:" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "Il vecchio oggetto %s non mappa un uid" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Questo è un oggetto Kolab Groupware. Per vedere questo oggetto è necessario " "utilizzare un client che supporti il formato Kolab Groupware. per un elenco " "dei client compatibili visitare %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Impossibile rinominare %s in %s: cartella di destinazione esistente" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/ja/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000001542112207101545023267 0ustar janjan)d; *-$(R({9(C#5g (%3'7[=2*p/$2 W1x+.4! V  <j &  1u 4 4 X _yYU34l]+lo:f?L9.XhfG(_pG76-+G1sHPT?C4Q X_)\U4 %) ! &  ' $"(#Connecting to server %s failed.Creating folder %s failed.Deleting folder %s failed.Error: %sFailed appending new message to folder %s.Failed deleting ACL on folder %s for user %s.Failed deleting message %s in folder %s.Failed deleting messages from folder %s.Failed expunging folder %s.Failed fetching body part %s for message %s in folder %s.Failed fetching message %s in folder %s.Failed fetching structure information for messages %s in folder %s.Failed moving message %s from folder %s to folder %s.Failed opening folder %s.Failed reading ACL on folder %s.Failed reading user rights on folder %s.Failed retrieving UIDs for folder %s.Failed retrieving status information for folder %s.Failed retrieving structure of message %s in folder %s.Failed retrieving the message with ID %s. Original error: %s.Failed setting ACL on folder %s for user %s to %s.Failed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Listing folders for %s failed.Missing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.Renaming folder %s to %s failed.Retrieving annotation %s[%s] on folder %s failed.Retrieving the status for folder %s failed.Selecting folder %s failed.Setting annotation %s[%s] on folder %s failed.Setting annotation %s[%s] on folder %s to %s failed.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-11-06 16:40+0100 PO-Revision-Date: 2012-11-08 09:54+0900 Last-Translator: Hiromi Kimura Language-Team: i18n@lists.horde.org Language: ja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; X-Generator: Poedit 1.5.4 サーバ %s への接続に失敗しました。フォルダー %s の作成に失敗しました。フォルダー %s の削除に失敗しました。エラー:%sフォルダー %s に新規メッセージを追加することに失敗しました。ユーザ %2$s の ACL をフォルダー %1$s から削除することに失敗しました。メッセージ %s をフォルダー %s から削除することに失敗しました。メッセージをフォルダー %s から削除することに失敗しました。フォルダー %s の削除に失敗しました。フォルダー %3$s 内のメッセージ %2$s の本文 %1$s を読み出すことに失敗しました。フォルダー %2$s 内のメッセージ %1$s を読み出すことに失敗しました。フォルダー %2$s 内のメッセージ %1$s の構造情報を読み出すことに失敗しました。メッセージ %s をフォルダー %s からフォルダー %s に移動することに失敗しました。フォルダー %s を開くことに失敗しました。フォルダー %s の ACL 読み出しに失敗しました。フォルダー %s のユーザ権限の読み出しに失敗しました。フォルダー %s の UID 取得に失敗しました。フォルダー %s のステータス情報を取得することに失敗しました。フォルダー %2$s 内のメッセージ %1$s の構造を取得することに失敗しました。ID %s のメッセージの取得に失敗しました。エラー:%sフォルダー %s でユーザ %s の ACL を %s に設定することに失敗しました。フォルダー %s のトリガーに失敗しました。エラー: %s不正な "driver" パラメータ "%s"。 以下のどれかを指定して下さい: "mock", "php", "pear", "horde", "horde-php", "roundcube""%s"は無効なネームスペースの種類です!%s のフォルダ一覧取得に失敗しました。"driver" パラメータがありません!"host" パラメータがありません!古いオブジェクト %s がありません。古いオブジェクト %s は UID にマップされていません。フォルダー %s の名前を %s に変更することに失敗しました。注釈 %s[%s] をフォルダー %s から取得することに失敗しました。フォルダー %s のステータス取得に失敗しました。フォルダー %s の選択に失敗しました。注釈 %s[%s] をフォルダー %s に設定することに失敗しました。注釈 %s[%s] をフォルダー %s に %s と設定することに失敗しました。ID %s のメッセージは存在しません。おそらく、あなたがバックエンドからオブジェクトを取得した後で、誰かが Kolab オブジェクトを変更したのでしょう。元のエラー:%sID %s のメッセージは存在しません。おそらく、あなたが編集中の Kolab オブジェクトを誰かが変更したのでしょう。編集内容は失われました。これは Kokab グループウエアのオブジェクトです。このオブジェクトを表示するには、Kokab グループウエアの書式を理解しているメールクライアントが必要です。そのようなメールクライアントの一覧がここにあります:%s%s を %s に変更できません:目的のフォルダーは既に存在しますURL %s をトリガーできません。応答: %sHorde_Kolab_Storage-2.0.5/locale/ja/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002736012207101545023277 0ustar janjan# Japanese translation for Horde. # Copyright 2004-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde package. # Hiromi Kimura # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-11-06 16:40+0100\n" "PO-Revision-Date: 2012-11-08 09:54+0900\n" "Last-Translator: Hiromi Kimura \n" "Language-Team: i18n@lists.horde.org\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 1.5.4\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed." msgstr "サーバ %s への接続に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed." msgstr "フォルダー %s の作成に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, php-format msgid "Deleting folder %s failed." msgstr "フォルダー %s の削除に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "エラー:%s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, php-format msgid "Failed appending new message to folder %s." msgstr "フォルダー %s に新規メッセージを追加することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "ユーザ %2$s の ACL をフォルダー %1$s から削除することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, php-format msgid "Failed deleting message %s in folder %s." msgstr "メッセージ %s をフォルダー %s から削除することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, php-format msgid "Failed deleting messages from folder %s." msgstr "メッセージをフォルダー %s から削除することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, php-format msgid "Failed expunging folder %s." msgstr "フォルダー %s の削除に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "" "フォルダー %3$s 内のメッセージ %2$s の本文 %1$s を読み出すことに失敗しまし" "た。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, php-format msgid "Failed fetching message %s in folder %s." msgstr "フォルダー %2$s 内のメッセージ %1$s を読み出すことに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "" "フォルダー %2$s 内のメッセージ %1$s の構造情報を読み出すことに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "" "メッセージ %s をフォルダー %s からフォルダー %s に移動することに失敗しまし" "た。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, php-format msgid "Failed opening folder %s." msgstr "フォルダー %s を開くことに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, php-format msgid "Failed reading ACL on folder %s." msgstr "フォルダー %s の ACL 読み出しに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, php-format msgid "Failed reading user rights on folder %s." msgstr "フォルダー %s のユーザ権限の読み出しに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "フォルダー %s の UID 取得に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, php-format msgid "Failed retrieving status information for folder %s." msgstr "フォルダー %s のステータス情報を取得することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "" "フォルダー %2$s 内のメッセージ %1$s の構造を取得することに失敗しました。" #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "ID %s のメッセージの取得に失敗しました。エラー:%s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "フォルダー %s でユーザ %s の ACL を %s に設定することに失敗しました。" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "フォルダー %s のトリガーに失敗しました。エラー: %s" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "不正な \"driver\" パラメータ \"%s\"。 以下のどれかを指定して下さい: \"mock" "\", \"php\", \"pear\", \"horde\", \"horde-php\", \"roundcube\"" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "\"%s\"は無効なネームスペースの種類です!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, php-format msgid "Listing folders for %s failed." msgstr "%s のフォルダ一覧取得に失敗しました。" #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "\"driver\" パラメータがありません!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "\"host\" パラメータがありません!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "古いオブジェクト %s がありません。" #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "古いオブジェクト %s は UID にマップされていません。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, php-format msgid "Renaming folder %s to %s failed." msgstr "フォルダー %s の名前を %s に変更することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "注釈 %s[%s] をフォルダー %s から取得することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, php-format msgid "Retrieving the status for folder %s failed." msgstr "フォルダー %s のステータス取得に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, php-format msgid "Selecting folder %s failed." msgstr "フォルダー %s の選択に失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "注釈 %s[%s] をフォルダー %s に設定することに失敗しました。" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "注釈 %s[%s] をフォルダー %s に %s と設定することに失敗しました。" #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "ID %s のメッセージは存在しません。おそらく、あなたがバックエンドからオブジェ" "クトを取得した後で、誰かが Kolab オブジェクトを変更したのでしょう。元のエ" "ラー:%s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "ID %s のメッセージは存在しません。おそらく、あなたが編集中の Kolab オブジェク" "トを誰かが変更したのでしょう。編集内容は失われました。" #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "これは Kokab グループウエアのオブジェクトです。このオブジェクトを表示するに" "は、Kokab グループウエアの書式を理解しているメールクライアントが必要です。そ" "のようなメールクライアントの一覧がここにあります:%s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "%s を %s に変更できません:目的のフォルダーは既に存在します" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "URL %s をトリガーできません。応答: %s" Horde_Kolab_Storage-2.0.5/locale/km/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023277 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/km/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000404112207101545023303 0ustar janjan# Khmer translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/ko/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000065012207101545023302 0ustar janjan$,8n9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; Horde_Kolab_Storage-2.0.5/locale/ko/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000411212207101545023304 0ustar janjan# Korean translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/lt/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000247412207101545023316 0ustar janjanL |7$$<) ';;Kolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2); Kolab kešas: keše nėra objekto uid %s!Senasis objektas %s neegzistuojaSenasis objektas %s nesurištas su uid.Tai Kolab Groupware objektas. Norėdami peržiūrėti objektą privalote turėti el. pašto klientą, kuris suprantą šį formatą. Tokių el. pašto klientų sąrašą galite rasti apsilankę %sNepavyko pervadinti %s į %s: toks katalogas jau egzistuojaHorde_Kolab_Storage-2.0.5/locale/lt/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002467412207101545023331 0ustar janjan# Lithuanian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Vilius Šumskas , 2011. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-05-28 01:09+0300\n" "PO-Revision-Date: 2011-06-28 00:41+0300\n" "Last-Translator: Vilius Šumskas \n" "Language-Team: Lithuanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" "%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed. Error: %s" msgstr "Prisijungti prieš serverio %s nepavyko. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed. Error: %s" msgstr "Nepavyko sukurti %s katalogo. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:218 #, php-format msgid "Creating folder %s%s failed. Error: %s" msgstr "Nepavyko sukurti %s%s katalogo. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:136 #, php-format msgid "Deleting folder %s failed. Error: %s" msgstr "Nepavyko ištrinti %s katalogo. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:245 #, php-format msgid "Deleting folder %s%s failed. Error: %s" msgstr "Nepavyko ištrinti %s%s katalogo. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:691 #, php-format msgid "Failed appending new message to folder %s%s. Error: %s" msgstr "Į katalogą %s%s nepavyko pridėti naujų laiškų. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:602 #, php-format msgid "Failed appending new message to folder %s. Error: %s" msgstr "Į katalogą %s nepavyko pridėti naujų laiškų. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:277 #, php-format msgid "Failed deleting ACL on folder %s for user %s. Error: %s" msgstr "Nuo katalogo %s nepavyko nuimti vartotojo %s teisių. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:724 #, php-format msgid "Failed deleting message %s in folder %s. Error: %s" msgstr "Nepavyko ištrinti laiško %s iš katalogo %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:629 #, php-format msgid "Failed deleting messages from folder %s. Error: %s" msgstr "Iš katalogo %s nepavyko ištrinti laiškų. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:785 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:682 #, php-format msgid "Failed expunging folder %s. Error: %s" msgstr "Nepavyko išvalyti katalogo %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:657 #, php-format msgid "Failed fetching body part %s for message %s in folder %s%s. Error: %s" msgstr "Nepavyko gauti laiško dalies %s iš laiško %s kataloge %s%s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:590 #, php-format msgid "Failed fetching message %s in folder %s%s. Error: %s" msgstr "Nepavyko gauti laiško %s kataloge %s%s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:625 #, php-format msgid "" "Failed fetching structure information for messages %s in folder %s%s. Error: " "%s" msgstr "" "Nepavyko gauti laiško %s struktūros informacijos kataloge %s%s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:758 #, php-format msgid "Failed message %s from folder %s to folder %s. Error: %s" msgstr "Nepavyko perkelti laiško %s iš katalogo %s į katalogą %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:658 #, php-format msgid "Failed moving message %s from folder %s to folder %s. Error: %s" msgstr "Nepavyko perkelti laiško %s iš katalogo %s į katalogą %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:502 #, php-format msgid "Failed opening folder %s%s. Error: %s" msgstr "Nepavyko atidaryti katalogo %s%s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:318 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:197 #, php-format msgid "Failed reading ACL on folder %s. Error: %s" msgstr "Nepavyko perskaityti katalogo %s teisių. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:225 #, php-format msgid "Failed reading user rights on folder %s. Error: %s" msgstr "Nepavyko perskaityti katalogo %s vartotojo teisių. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:467 #, php-format msgid "Failed retrieving UIDs for folder %s. Error: %s" msgstr "Nepavyko gauti katalogo %s UID. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:498 #, php-format msgid "Failed retrieving message %s in folder %s. Error: %s" msgstr "Nepavyko gauti laiško %s kataloge %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:571 #, php-format msgid "Failed retrieving mime part %s of message %s in folder %s. Error: %s" msgstr "Nepavyko gauti mime dalies %s iš laiško %s kataloge %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:532 #, php-format msgid "Failed retrieving status information for folder %s%s. Error: %s" msgstr "Nepavyko gauti katalogo %s būsenos informacijos. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:537 #, php-format msgid "Failed retrieving structure of message %s in folder %s. Error: %s" msgstr "" "Nepavyko gauti laiško %s struktūros informacijos kataloge %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:831 #: lib/Horde/Kolab/Storage/Folder/Base.php:837 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Nepavyko gauti laiško, kurio ID %s. Klaida: %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:372 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:251 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s. Error: %s" msgstr "Nepavyko pakeisti katalogo %s teisių vartotojui %s į %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Nepavyko pasiekti katalogo %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Factory.php:184 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Neleistinas \"driver\" parametras \"%s\". Naudokite \"mock\", \"php\", \"pear" "\", \"horde\", \"horde-php\" arba \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:246 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Neleistinas \"namespace\" tipas \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:182 #, php-format msgid "Listing folders for %s failed. Error: %s" msgstr "Nepavyko parodyti %s katalogų. Klaida: %s" #: lib/Horde/Kolab/Storage/Factory.php:141 msgid "Missing \"driver\" parameter!" msgstr "Nėra \"driver\" parametro!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:146 msgid "Missing \"host\" parameter!" msgstr "Nėra \"host\" parametro!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Senasis objektas %s neegzistuoja" #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "Senasis objektas %s nesurištas su uid." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:163 #, php-format msgid "Renaming folder %s to %s failed. Error: %s" msgstr "Nepavyko pervadinti katalogo iš %s į %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:274 #, php-format msgid "Renaming folder %s%s to %s%s failed. Error: %s" msgstr "Nepavyko pervadinti katalogo iš %s%s į %s%s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:441 #, php-format msgid "Retrieving annotation %s[%s] on folder %s%s failed. Error: %s" msgstr "Nepavyko gauti anotacijos %s[%s] katalogui %s%s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:436 #, php-format msgid "Retrieving the status for folder %s failed. Error: %s" msgstr "Nepavyko gauti katalogo %s būsenos. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:410 #, php-format msgid "Selecting folder %s failed. Error: %s" msgstr "Nepavyko pasirinkti katalogo %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:329 #, php-format msgid "Setting annotation %s[%s] on folder %s failed. Error: %s" msgstr "Nepavyko pakeisti anotacijos %s[%s] katalogui %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:360 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed. Error: %s" msgstr "Nepavyko pakeisti anotacijos %s[%s] katalogui %s į %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:473 #, php-format msgid "Setting annotation %s[%s] on folder %s%s to %s failed. Error: %s" msgstr "Nepavyko pakeisti anotacijos %s[%s] katalogui %s%s į %s. Klaida: %s" #: lib/Horde/Kolab/Storage/Data/Base.php:220 #: lib/Horde/Kolab/Storage/Data/Cached.php:120 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "Laiškas, kurio ID %s, neegzistuoja. Tai dažniausiai reiškia, kad kas nors " "kitas pakeitė šį Kolab objektą po to, kai jūs paėmėte jį iš posistemės. " "Klaida: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:670 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "Laiškas, kurio ID %s, neegzistuoja. Tai dažniausiai reiškia, kad kas nors " "kitas pakeitė šį Kolab objektą kol jūs jį redagavote. Jūsų pakeitimai buvo " "prarasti." #: lib/Horde/Kolab/Storage/Data/Format/Mime.php:216 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Tai Kolab Groupware objektas. Norėdami peržiūrėti objektą privalote turėti " "el. pašto klientą, kuris suprantą šį formatą. Tokių el. pašto klientų sąrašą " "galite rasti apsilankę %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:353 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Nepavyko pervadinti %s į %s: toks katalogas jau egzistuoja" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Nepavyko sužadinti URL adreso %s. Atsakymas: %s" Horde_Kolab_Storage-2.0.5/locale/lv/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000000447512207101545023325 0ustar janjan<)$&$'&L2s2%4%4Zy*.<'d0`(*(*593o)6  %Fd264      Connecting to server %s failed. Error: %sCreating folder %s failed. Error: %sCreating folder %s%s failed. Error: %sDeleting folder %s failed. Error: %sDeleting folder %s%s failed. Error: %sFailed deleting message %s in folder %s. Error: %sFailed deleting messages from folder %s. Error: %sFailed expunging folder %s. Error: %sFailed fetching message %s in folder %s%s. Error: %sFailed opening folder %s%s. Error: %sInvalid "namespace" type "%s"!Missing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Renaming folder %s to %s failed. Error: %sRenaming folder %s%s to %s%s failed. Error: %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-04-04 10:15+0200 PO-Revision-Date: 2011-10-16 15:21+0300 Last-Translator: Jānis Eisaks Language-Team: i18n@lists.horde.org Language: lv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2); X-Poedit-Language: Latvian X-Poedit-Country: LATVIA X-Poedit-SourceCharset: utf-8 Neizdevās pieslēgties serverim %s. Kļūda: %sNeizdevās izveidot mapi %s. Kļūda: %sNeizdevās izveidot mapi %s%s. Kļūda: %sNeizdevās izdzēst mapi %s. Kļūda: %sNeizdevās izdzēst mapi %s%s. Kļūda: %sNeizdevās izdzēst vēstuli %s mapē %s. Kļūda: %sNeizdevās izdzēst vēstules mapē %s. Kļūda: %sNeizdevās iztīrīt mapi %s. Kļūda: %sNeizdevās saņemt vēstuli %s mapē %s%s. Kļūda: %sNeizdevās atvērt mapi %s%s: %sNepareizs "namespace" tips "%s"!Iztrūkst "driver" parametrs!Iztrūkst "host" parametrs!Vecais objekts %s neeksistē.Neizdevās pārdēvēt mapi %s par %s. Kļūda: %sNeizdevās pārdēvēt mapi %s%s par %s%s. Kļūda: %sNevar pārsaukt %s par %s: mērķa mape jau eksistēHorde_Kolab_Storage-2.0.5/locale/lv/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000001225712207101545023325 0ustar janjan# Latvian translations for Horde_Kolab_Storage package. # Copyright 2011-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage package. # Automatically generated, 2011. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-04-04 10:15+0200\n" "PO-Revision-Date: 2011-10-16 15:21+0300\n" "Last-Translator: Jānis Eisaks \n" "Language-Team: i18n@lists.horde.org\n" "Language: lv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " "2);\n" "X-Poedit-Language: Latvian\n" "X-Poedit-Country: LATVIA\n" "X-Poedit-SourceCharset: utf-8\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed. Error: %s" msgstr "Neizdevās pieslēgties serverim %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed. Error: %s" msgstr "Neizdevās izveidot mapi %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:218 #, php-format msgid "Creating folder %s%s failed. Error: %s" msgstr "Neizdevās izveidot mapi %s%s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:136 #, php-format msgid "Deleting folder %s failed. Error: %s" msgstr "Neizdevās izdzēst mapi %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:245 #, php-format msgid "Deleting folder %s%s failed. Error: %s" msgstr "Neizdevās izdzēst mapi %s%s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:724 #, php-format msgid "Failed deleting message %s in folder %s. Error: %s" msgstr "Neizdevās izdzēst vēstuli %s mapē %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:629 #, php-format msgid "Failed deleting messages from folder %s. Error: %s" msgstr "Neizdevās izdzēst vēstules mapē %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:785 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:682 #, php-format msgid "Failed expunging folder %s. Error: %s" msgstr "Neizdevās iztīrīt mapi %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:590 #, php-format msgid "Failed fetching message %s in folder %s%s. Error: %s" msgstr "Neizdevās saņemt vēstuli %s mapē %s%s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:502 #, php-format msgid "Failed opening folder %s%s. Error: %s" msgstr "Neizdevās atvērt mapi %s%s: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:498 #, fuzzy, php-format msgid "Failed retrieving message %s in folder %s. Error: %s" msgstr "Kļūda saņemot vēstuli ar ID %s. Sākotnējā kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:532 #, fuzzy, php-format msgid "Failed retrieving status information for folder %s%s. Error: %s" msgstr "Kļūda saņemot %s Brīvs/Aizņemts informāciju: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:831 #: lib/Horde/Kolab/Storage/Folder/Base.php:837 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Kļūda saņemot vēstuli ar ID %s. Sākotnējā kļūda: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Neizdevās saglabāt objektu. Kļūda: %s" #: lib/Horde/Kolab/Storage/Factory.php:243 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Nepareizs \"namespace\" tips \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:182 #, fuzzy, php-format msgid "Listing folders for %s failed. Error: %s" msgstr "" "#-#-#-#-# horde.po (Horde 2.1) #-#-#-#-#\n" "Kļūme pārlūkojot sesijas: %s\n" "#-#-#-#-# admin.po (admin) #-#-#-#-#\n" "Kļūme veidojot sesiju sarakstu: %s" #: lib/Horde/Kolab/Storage/Factory.php:141 msgid "Missing \"driver\" parameter!" msgstr "Iztrūkst \"driver\" parametrs!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:146 msgid "Missing \"host\" parameter!" msgstr "Iztrūkst \"host\" parametrs!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Vecais objekts %s neeksistē." #: lib/Horde/Kolab/Storage/Driver/Rcube.php:163 #, php-format msgid "Renaming folder %s to %s failed. Error: %s" msgstr "Neizdevās pārdēvēt mapi %s par %s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:274 #, php-format msgid "Renaming folder %s%s to %s%s failed. Error: %s" msgstr "Neizdevās pārdēvēt mapi %s%s par %s%s. Kļūda: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:436 #, fuzzy, php-format msgid "Retrieving the status for folder %s failed. Error: %s" msgstr "Akativēt skriptu \"%s\" neizdevās: (%d) %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:410 #, fuzzy, php-format msgid "Selecting folder %s failed. Error: %s" msgstr "Meklēšanas kļūme. Kļūda: %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:353 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Nevar pārsaukt %s par %s: mērķa mape jau eksistē" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Nevar nodzēst \"%s\": %s" Horde_Kolab_Storage-2.0.5/locale/mk/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000060412207101545023277 0ustar janjan$,8J9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Kolab_Storage-2.0.5/locale/mk/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000404612207101545023310 0ustar janjan# Macedonian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/nb/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000065712207101545023277 0ustar janjan$,8u9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Horde_Kolab_Storage-2.0.5/locale/nb/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000417312207101545023301 0ustar janjan# Norwegian Bokmal translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Mappen %s eksisterer ikke" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/nl/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000065712207101545023311 0ustar janjan$,8u9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Horde_Kolab_Storage-2.0.5/locale/nl/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000122512207101545023306 0ustar janjan# Dutch translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" Horde_Kolab_Storage-2.0.5/locale/nn/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000065712207101545023313 0ustar janjan$,8u9Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Horde_Kolab_Storage-2.0.5/locale/nn/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000413412207101545023312 0ustar janjan# Norwegian Nynorsk translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/pl/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000120012207101545023274 0ustar janjan,<P<QA>Unable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Błąd przy zmianie nazwy %s na %s: folder docelowy już istniejeHorde_Kolab_Storage-2.0.5/locale/pl/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000435412207101545023316 0ustar janjan# Polish translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Folder %s nie istnieje" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Błąd przy zmianie nazwy %s na %s: folder docelowy już istnieje" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/pt/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000176012207101545023317 0ustar janjan4L`a<uPEThis is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Este é um objecto Kolab Groupware. Para ver este objecto precisa de um cliente de correio electrónico que conheça o formato Kolab Groupware. Para uma lista de clientes de correio electrónico nessas circunstâncias visite %sNão foi possível renomear %s como %s: a pasta de destino já existeHorde_Kolab_Storage-2.0.5/locale/pt/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000476312207101545023332 0ustar janjan# Portuguese translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "A pasta %s não existe." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Este é um objecto Kolab Groupware. Para ver este objecto precisa de um " "cliente de correio electrónico que conheça o formato Kolab Groupware. Para " "uma lista de clientes de correio electrónico nessas circunstâncias visite %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Não foi possível renomear %s como %s: a pasta de destino já existe" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Impossível activar actualização da informação livre/ocupado para %s" Horde_Kolab_Storage-2.0.5/locale/pt_BR/LC_MESSAGES/Horde_Kolab_Storage.mo0000664000175000017500000000545012207101545023704 0ustar janjan h i=s*pMl$G<&6]7'6z^# =,]9 > *     Error: %sFailed retrieving the message with ID %s. Original error: %s.Failed triggering folder %s. Error was: %sInvalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!Invalid "namespace" type "%s"!Missing "driver" parameter!Missing "host" parameter!Old object %s does not exist.Old object %s does not map to a uid.The message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else since you retrieved the object from the backend. Original error: %sThe message with ID %s does not exist. This probably means that the Kolab object has been modified by somebody else while you were editing it. Your edits have been lost.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsUnable to trigger URL %s. Response: %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-11-06 16:40+0100 PO-Revision-Date: 2013-03-16 11:06-0300 Last-Translator: Luis Felipe Marzagao Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Erro: %sFalha ao obter a mensagem com ID %s. Erro original: %s.Falha ao acionar pasta %s. Erro foi: %sParâmetro de "driver" inválido "%s". Por favor use um desses "mock", "php", "pear", "horde", "horde-php", e "roundcube"!Tipo de "namespace" inválido "%s"!Parâmetro de "driver" faltando!Parâmetro de "host" faltando!Objeto %s anterior não existe.Objeto %s anterior não aponta para uma uid.A mensagem com o ID %s não existe. Isso provavelmente significa que o objeto Kolan foi modificado por alguém desde que você obteve o objeto da estrutura. Erro original: %sA mensagem com o ID %s não existe. Isso provavelmente signifca que o objeto Kolab foi modificado por alguém enquanto você o editava. Suas edições foram perdidas.Este é um objeto Kolab Groupware. Para visualizar este objeto você precisará de um cliente de correio que entenda o formato Kolab Groupware. Para uma lista de clientes de correio com estas funções por favor visite %sImpossível renomear %s para %s: a pasta de destino já existeImpossível acionar a URL %s. Resposta: %sHorde_Kolab_Storage-2.0.5/locale/pt_BR/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000002563712207101545023720 0ustar janjan# Portuguese translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-11-06 16:40+0100\n" "PO-Revision-Date: 2013-03-16 11:06-0300\n" "Last-Translator: Luis Felipe Marzagao \n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, fuzzy, php-format msgid "Connecting to server %s failed." msgstr "Conexão com o servidor %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, fuzzy, php-format msgid "Creating folder %s failed." msgstr "Ciração da pasta %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, fuzzy, php-format msgid "Deleting folder %s failed." msgstr "Remoção da pasta %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, fuzzy, php-format msgid "Failed appending new message to folder %s." msgstr "Falha ao adicionar nova mensagem à pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, fuzzy, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "Falha ao apagar ACL na pasta %s para usuário %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, fuzzy, php-format msgid "Failed deleting message %s in folder %s." msgstr "Falha ao apagar mensagem %s na pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, fuzzy, php-format msgid "Failed deleting messages from folder %s." msgstr "Falha ao apagar mensagens da pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, fuzzy, php-format msgid "Failed expunging folder %s." msgstr "Falha ao expurgar pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, fuzzy, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "" "Falha ao obter parte de corpo %s da mensagem %s na pasta %s%s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, fuzzy, php-format msgid "Failed fetching message %s in folder %s." msgstr "Falha ao obter mensagem %s na pasta %s%s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, fuzzy, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "" "Falha ao obter informação de estrutura para mensagens %s na pasta %s%s. " "Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, fuzzy, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "Falha ao mover mensagem %s da pasta %s para pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, fuzzy, php-format msgid "Failed opening folder %s." msgstr "Falha ao abrir pasta %s%s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, fuzzy, php-format msgid "Failed reading ACL on folder %s." msgstr "Falha ao ler ACL na pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, fuzzy, php-format msgid "Failed reading user rights on folder %s." msgstr "Falha ao ler direitos do usuário na pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, fuzzy, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "Falha ao obter UIDs para pasta %s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, fuzzy, php-format msgid "Failed retrieving status information for folder %s." msgstr "Falha ao obter informação de status para a pasta %s%s. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, fuzzy, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "Falha ao obter estrutura da mensagem %s na pasta %s. Erro: %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Falha ao obter a mensagem com ID %s. Erro original: %s." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, fuzzy, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "Falha ao definir ACL na pasta %s para o usuário %s para %s. Erro: %s" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Falha ao acionar pasta %s. Erro foi: %s" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" "Parâmetro de \"driver\" inválido \"%s\". Por favor use um desses \"mock\", " "\"php\", \"pear\", \"horde\", \"horde-php\", e \"roundcube\"!" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "Tipo de \"namespace\" inválido \"%s\"!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, fuzzy, php-format msgid "Listing folders for %s failed." msgstr "Listagem de pastas para %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "Parâmetro de \"driver\" faltando!" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "Parâmetro de \"host\" faltando!" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "Objeto %s anterior não existe." #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "Objeto %s anterior não aponta para uma uid." #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, fuzzy, php-format msgid "Renaming folder %s to %s failed." msgstr "Renomeando pasta %s para %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, fuzzy, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "Obtendo anotação %s[%s] na pasta %s%s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, fuzzy, php-format msgid "Retrieving the status for folder %s failed." msgstr "Obtenção do status para a pasta %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, fuzzy, php-format msgid "Selecting folder %s failed." msgstr "Seleção da pasta %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, fuzzy, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "Definindo anotação %s[%s] na pasta %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, fuzzy, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "Definindo anotação %s[%s] na pasta %s para %s falhou. Erro: %s" #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" "A mensagem com o ID %s não existe. Isso provavelmente significa que o objeto " "Kolan foi modificado por alguém desde que você obteve o objeto da estrutura. " "Erro original: %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" "A mensagem com o ID %s não existe. Isso provavelmente signifca que o objeto " "Kolab foi modificado por alguém enquanto você o editava. Suas edições foram " "perdidas." #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Este é um objeto Kolab Groupware. Para visualizar este objeto você precisará " "de um cliente de correio que entenda o formato Kolab Groupware. Para uma " "lista de clientes de correio com estas funções por favor visite %s" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Impossível renomear %s para %s: a pasta de destino já existe" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Impossível acionar a URL %s. Resposta: %s" Horde_Kolab_Storage-2.0.5/locale/ro/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000073512207101545023315 0ustar janjan$,89Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2; Horde_Kolab_Storage-2.0.5/locale/ro/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000420412207101545023315 0ustar janjan# Romanian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/ru/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000123512207101545023317 0ustar janjan,<P=QMOFailed retrieving the message with ID %s. Original error: %s.Project-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Ошибка получения сообщения с ID %s. Ошибка %s.Horde_Kolab_Storage-2.0.5/locale/ru/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000467012207101545023332 0ustar janjan# Russian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Ошибка получения сообщения с ID %s. Ошибка %s." #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Ошибка сохранения обьекта. Ошибка %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Адресат уведомления %s не найден." #: lib/Horde/Kolab/Storage/Data.php:322 #, fuzzy, php-format msgid "Old object %s does not map to a uid." msgstr "Адресат уведомления %s не найден." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/sk/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000244312207101545023310 0ustar janjanL |7$$<? EKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; Kolab cache: objekt uid %s neexistuje vo vyrovnávacej pamäti!Starý objekt %s neexistujeStarý objekt %s nepasuje k uidToto je objekt Kolab Groupware. Pre zobrazenie tohto objektu potrebujete e-mailového klienta, ktorý rozumie formátu Kolab Groupware. Pre zoznam takýchto klientov navštívte prosím %sNepodarilo sa premenovať %s na %s: cieľový priečinok už existujeHorde_Kolab_Storage-2.0.5/locale/sk/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000513112207101545023312 0ustar janjan# Slovak translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "Zlyhalo sťahovanie IMAP správy %s. Chyba: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Zlyhalo sťahovanie IMAP správy %s. Chyba: %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Kolab cache: objekt uid %s neexistuje vo vyrovnávacej pamäti!" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "Starý objekt %s neexistuje" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "Starý objekt %s nepasuje k uid" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Toto je objekt Kolab Groupware. Pre zobrazenie tohto objektu potrebujete e-" "mailového klienta, ktorý rozumie formátu Kolab Groupware. Pre zoznam " "takýchto klientov navštívte prosím %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Nepodarilo sa premenovať %s na %s: cieľový priečinok už existuje" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/sl/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000155012207101545023307 0ustar janjan,<PQThis is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3); To je podatek skupinska upravljanje Kolab. Za pregled tega podatka potrebujetepregledlovalnik, ki podpira način zapisa Kolab Groupware. Za seznam odjemalcevki to podpirajo obiščite %sHorde_Kolab_Storage-2.0.5/locale/sl/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000475212207101545023323 0ustar janjan# Slovenian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "%s mapa ne obstaja " #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "To je podatek skupinska upravljanje Kolab. Za pregled tega podatka " "potrebujetepregledlovalnik, ki podpira način zapisa Kolab Groupware. Za " "seznam odjemalcevki to podpirajo obiščite %s" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, fuzzy, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Horde/Share/kolab: Ne morem preimenovati %s v %s: mapa že ostaja" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "Ne morem sprožiti prosto/zasedeno posodobite za %s" Horde_Kolab_Storage-2.0.5/locale/sv/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000110412207101545023314 0ustar janjan,<P<Qu?Unable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Kan inte byta namn på %s till %s: destinationsmapp finns redanHorde_Kolab_Storage-2.0.5/locale/sv/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000425712207101545023335 0ustar janjan# Swedish translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "Mapp %s existerar inte." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Kan inte byta namn på %s till %s: destinationsmapp finns redan" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/tr/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000237312207101545023322 0ustar janjanL |7$$<n.(AKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; Kolab cache: uid nesnesi %s, ön bellekte yok!Eski nesne %s yok.Eski nesne %s, bir uid ile eşleşmiyor.Bu bir Kolab Groupware nesnesidir. Bu nesneyi görebilmek için Kolab Groupware biçimini anlayabilen bir elektronik posta istemcisine gerek var.Bu elektronik istemci listesi için %s adresine uğrayın.%s->%s olarak yeniden adlandırılamıyor: hedef dizin zaten var.Horde_Kolab_Storage-2.0.5/locale/tr/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000511412207101545023323 0ustar janjan# Turkish translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "IMAP mesajı %s alınırken hata oluştur. Hata şöyle: %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "IMAP mesajı %s alınırken hata oluştur. Hata şöyle: %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Kolab cache: uid nesnesi %s, ön bellekte yok!" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "Eski nesne %s yok." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "Eski nesne %s, bir uid ile eşleşmiyor." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "Bu bir Kolab Groupware nesnesidir. Bu nesneyi görebilmek için Kolab " "Groupware biçimini anlayabilen bir elektronik posta istemcisine gerek var.Bu " "elektronik istemci listesi için %s adresine uğrayın." #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "%s->%s olarak yeniden adlandırılamıyor: hedef dizin zaten var." #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/uk/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000142112207101545023305 0ustar janjan4L`a<,|gOld object %s does not exist.Unable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Старий об'єкт %s не існує.Не можу перйменувати %s на %s: папка призначення вже існує.Horde_Kolab_Storage-2.0.5/locale/uk/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000471112207101545023317 0ustar janjan# Ukrainian translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "Помилка LDAP: Невдалий пошук з фільтром %s. Помилка: %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "Старий об'єкт %s не існує." #: lib/Horde/Kolab/Storage/Data.php:322 #, fuzzy, php-format msgid "Old object %s does not map to a uid." msgstr "Старий об'єкт %s не існує." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Не можу перйменувати %s на %s: папка призначення вже існує." #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/zh_CN/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000140512207101545023671 0ustar janjan,<PQJNThis is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 此为 Kolab Groupware 对象。若要查看此对象,您需要可以处理 Kolab Groupware 格式的电子邮件客户端。如需此类电子邮件客户端列表,请访问 %s Horde_Kolab_Storage-2.0.5/locale/zh_CN/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000460112207101545023677 0ustar janjan# Chinese translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "" #: lib/Horde/Kolab/Storage/Data.php:315 #, fuzzy, php-format msgid "Old object %s does not exist." msgstr "目录 %s 不存在" #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "此为 Kolab Groupware 对象。若要查看此对象,您需要可以处理 Kolab Groupware 格" "式的电子邮件客户端。如需此类电子邮件客户端列表,请访问 %s " #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, fuzzy, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "Horde/Share/kolab:无法将 %s 重命名为 %s:目的文件夹已存在" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, fuzzy, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "无法将 %s 更新状态切换为空闲/繁忙" Horde_Kolab_Storage-2.0.5/locale/zh_TW/LC_MESSAGES/Horde_Kolab_Storage.mo0000644000175000017500000000224712207101545023730 0ustar janjanL |7$$<J2^*6pKolab cache: Object uid %s does not exist in the cache!Old object %s does not exist.Old object %s does not map to a uid.This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit %sUnable to rename %s to %s: destination folder already existsProject-Id-Version: Horde_Kolab_Storage Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kolab 快取: 在快取中找不到物件 uid %s !舊的物件 %s 並不存在.舊的物件 %s 沒有一個對映的 uid.這是 Kolab 群組的一個物件. 欲檢視此物件需要能支援Kolab 群組格式的電子郵件軟體.請參考 %s 以了解這些郵件軟體無法更名 %s 為 %s: 因為目標信件匣已存在Horde_Kolab_Storage-2.0.5/locale/zh_TW/LC_MESSAGES/Horde_Kolab_Storage.po0000664000175000017500000000470712207101545023740 0ustar janjan# Chinese translations for Horde_Kolab_Storage module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Folder/Base.php:993 #: lib/Horde/Kolab/Storage/Folder/Base.php:999 #, fuzzy, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "IMAP 郵件 %s 讀取失敗. 錯誤 %s" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:228 #, fuzzy, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "IMAP 郵件 %s 讀取失敗. 錯誤 %s" #: lib/Horde/Kolab/Storage/Data.php:630 #, php-format msgid "Kolab cache: Object uid %s does not exist in the cache!" msgstr "Kolab 快取: 在快取中找不到物件 uid %s !" #: lib/Horde/Kolab/Storage/Data.php:315 #, php-format msgid "Old object %s does not exist." msgstr "舊的物件 %s 並不存在." #: lib/Horde/Kolab/Storage/Data.php:322 #, php-format msgid "Old object %s does not map to a uid." msgstr "舊的物件 %s 沒有一個對映的 uid." #: lib/Horde/Kolab/Storage/Folder/Base.php:832 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Folder/Base.php:1054 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" "這是 Kolab 群組的一個物件. 欲檢視此物件需要能支援Kolab 群組格式的電子郵件軟" "體.請參考 %s 以了解這些郵件軟體" #: lib/Horde/Kolab/Storage/Folder/Base.php:391 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "無法更名 %s 為 %s: 因為目標信件匣已存在" #: lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" Horde_Kolab_Storage-2.0.5/locale/Horde_Kolab_Storage.pot0000664000175000017500000002043212207101545021275 0ustar janjan# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Kolab_Storage package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Horde_Kolab_Storage \n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-08-20 17:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:103 #, php-format msgid "Connecting to server %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:222 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:113 #, php-format msgid "Creating folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:250 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:138 #, php-format msgid "Deleting folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:106 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:187 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:225 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:253 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:283 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:327 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:357 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:385 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:456 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:489 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:519 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:551 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:610 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:646 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:680 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:715 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:749 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:786 #: lib/Horde/Kolab/Storage/Driver/Cclient.php:815 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:116 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:141 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:170 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:206 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:236 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:264 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:292 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:346 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:379 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:431 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:459 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:492 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:525 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:566 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:603 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:636 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:665 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:696 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:722 #, php-format msgid "Error: %s" msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:712 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:633 #, php-format msgid "Failed appending new message to folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:289 #, php-format msgid "Failed deleting ACL on folder %s for user %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:746 #, php-format msgid "Failed deleting message %s in folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:662 #, php-format msgid "Failed deleting messages from folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:812 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:719 #, php-format msgid "Failed expunging folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:677 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:600 #, php-format msgid "Failed fetching body part %s for message %s in folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:607 #: lib/Horde/Kolab/Storage/Driver/Imap.php:425 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:522 #, php-format msgid "Failed fetching message %s in folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:643 #, php-format msgid "Failed fetching structure information for messages %s in folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:783 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:693 #, php-format msgid "Failed moving message %s from folder %s to folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:516 #, php-format msgid "Failed opening folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:324 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:203 #, php-format msgid "Failed reading ACL on folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:354 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:233 #, php-format msgid "Failed reading user rights on folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:489 #, php-format msgid "Failed retrieving UIDs for folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:548 #, php-format msgid "Failed retrieving status information for folder %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:563 #, php-format msgid "Failed retrieving structure of message %s in folder %s." msgstr "" #: doc/Horde/Kolab/Storage/OLD/Folder.php:844 #: doc/Horde/Kolab/Storage/OLD/Folder.php:850 #, php-format msgid "Failed retrieving the message with ID %s. Original error: %s." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:382 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:261 #, php-format msgid "Failed setting ACL on folder %s for user %s to %s." msgstr "" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:228 #, php-format msgid "Failed triggering folder %s. Error was: %s" msgstr "" #: lib/Horde/Kolab/Storage/Factory.php:172 #, php-format msgid "" "Invalid \"driver\" parameter \"%s\". Please use one of \"mock\", \"php\", " "\"pear\", \"horde\", \"horde-php\", and \"roundcube\"!" msgstr "" #: lib/Horde/Kolab/Storage/Factory.php:217 #, php-format msgid "Invalid \"namespace\" type \"%s\"!" msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:184 #, php-format msgid "Listing folders for %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Factory.php:127 msgid "Missing \"driver\" parameter!" msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:148 msgid "Missing \"host\" parameter!" msgstr "" #: lib/Horde/Kolab/Storage/Data/Old.php:241 #, php-format msgid "Old object %s does not exist." msgstr "" #: lib/Horde/Kolab/Storage/Data/Old.php:248 #, php-format msgid "Old object %s does not map to a uid." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:280 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:167 #, php-format msgid "Renaming folder %s to %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:453 #, php-format msgid "Retrieving annotation %s[%s] on folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:456 #, php-format msgid "Retrieving the status for folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:428 #, php-format msgid "Selecting folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Rcube.php:343 #, php-format msgid "Setting annotation %s[%s] on folder %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Driver/Cclient.php:486 #: lib/Horde/Kolab/Storage/Driver/Rcube.php:376 #, php-format msgid "Setting annotation %s[%s] on folder %s to %s failed." msgstr "" #: lib/Horde/Kolab/Storage/Data/Base.php:255 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else since you retrieved the object " "from the backend. Original error: %s" msgstr "" #: doc/Horde/Kolab/Storage/OLD/Folder.php:683 #, php-format msgid "" "The message with ID %s does not exist. This probably means that the Kolab " "object has been modified by somebody else while you were editing it. Your " "edits have been lost." msgstr "" #: lib/Horde/Kolab/Storage/Object.php:487 #, php-format msgid "" "This is a Kolab Groupware object. To view this object you will need an email " "client that understands the Kolab Groupware format. For a list of such email " "clients please visit %s" msgstr "" #: doc/Horde/Kolab/Storage/OLD/Folder.php:366 #, php-format msgid "Unable to rename %s to %s: destination folder already exists" msgstr "" #: doc/Horde/Kolab/Storage/OLD/Trigger.php:261 #, php-format msgid "Unable to trigger URL %s. Response: %s" msgstr "" ././@LongLink000 145 0003736 LHorde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/Data/Object/Message/ModifiedTest.phpHorde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/Data/Object/Message/ModifiedTest.ph0000664000175000017500000001006312207101545031306 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the modification of existing Kolab mime messages. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_ComponentTest_Data_Object_Message_ModifiedTest extends PHPUnit_Framework_TestCase { public function testStore() { if (version_compare(PHP_VERSION, '5.5.0', '>=') && version_compare(PHP_VERSION, '5.5.3', '<=')) { $this->markTestSkipped('PHP version with broken quoted-printable-encode'); } $driver = new Horde_Kolab_Storage_Stub_Driver('user'); $driver->setMessage('INBOX', 1, file_get_contents(__DIR__ . '/../../../../fixtures/note.eml')); $factory = new Horde_Kolab_Format_Factory(); $writer = new Horde_Kolab_Storage_Object_Writer_Format( $factory ); $object = new Horde_Kolab_Storage_Object(); $object->setDriver($driver); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $folder->expects($this->once()) ->method('getType') ->will($this->returnValue('note')); $structure = $driver->fetchComplete('INBOX', 1); $object->load(1, $folder, $writer, $structure[1]); $object->setData( array('summary' => 'NEW', 'description' => 'test', 'uid' => 'ABC1234') ); $object->save($writer); $result = $driver->messages['INBOX'][2]; $result = preg_replace('/Date: .*/', 'Date: ', $result); $result = preg_replace('/boundary=".*"/', 'boundary=""', $result); $result = preg_replace('/--=_.*/', '--=_', $result); $result = preg_replace('/[^<]*/', '', $result); $result = preg_replace('/[^<]*/', '', $result); $result = preg_replace('/\r\n/', "\n", $result); $this->assertEquals( 'From: user To: user Date: Subject: ABC1234 User-Agent: Horde::Kolab::Storage v@version@ MIME-Version: 1.0 X-Kolab-Type: application/x-vnd.kolab.note Content-Type: multipart/mixed; boundary=""; name="Kolab Groupware Data" Content-Disposition: attachment; filename="Kolab Groupware Data" This message is in MIME format. --=_ Content-Type: text/plain; charset=utf-8; name="Kolab Groupware Information" Content-Disposition: inline; filename="Kolab Groupware Information" This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit http://www.kolab.org/content/kolab-clients --=_ Content-Type: application/x-vnd.kolab.note; name=kolab.xml Content-Disposition: inline; x-kolab-type=xml; filename=kolab.xml Content-Transfer-Encoding: quoted-printable ABC1234 public Horde_Kolab_Format_Xml-@version@ (api version: 2) NEW other client #000000 #ffff00 --=_ ', $result ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/Data/Object/Message/NewTest.php0000664000175000017500000000736512207101545030512 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the creation of new Kolab mime messages. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_ComponentTest_Data_Object_Message_NewTest extends PHPUnit_Framework_TestCase { public function testStore() { if (version_compare(PHP_VERSION, '5.5.0', '>=') && version_compare(PHP_VERSION, '5.5.3', '<=')) { $this->markTestSkipped('PHP version with broken quoted-printable-encode'); } setlocale(LC_MESSAGES, 'C'); $factory = new Horde_Kolab_Format_Factory(); $writer = new Horde_Kolab_Storage_Object_Writer_Format( $factory ); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $driver = new Horde_Kolab_Storage_Stub_Driver('user'); $object = new Horde_Kolab_Storage_Object(); $object->setDriver($driver); $object->setData( array('summary' => 'TEST', 'description' => 'test', 'uid' => 'ABC1234') ); $object->create($folder, $writer, 'note'); $result = $driver->messages['INBOX'][0]; $result = preg_replace('/Date: .*/', 'Date: ', $result); $result = preg_replace('/boundary=".*"/', 'boundary=""', $result); $result = preg_replace('/--=_.*/', '--=_', $result); $result = preg_replace('/[^<]*/', '', $result); $result = preg_replace('/[^<]*/', '', $result); $result = preg_replace('/\r\n/', "\n", $result); $this->assertEquals( 'From: user To: user Date: Subject: ABC1234 User-Agent: Horde_Kolab_Storage @version@ MIME-Version: 1.0 X-Kolab-Type: application/x-vnd.kolab.note Content-Type: multipart/mixed; name="Kolab Groupware Data"; boundary="" Content-Disposition: attachment; filename="Kolab Groupware Data" This message is in MIME format. --=_ Content-Type: text/plain; name="Kolab Groupware Information"; charset=utf-8 Content-Disposition: inline; filename="Kolab Groupware Information" This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit http://www.kolab.org/content/kolab-clients --=_ Content-Type: application/x-vnd.kolab.note; name=kolab.xml Content-Disposition: inline; x-kolab-type=xml; filename=kolab.xml Content-Transfer-Encoding: quoted-printable ABC1234 public Horde_Kolab_Format_Xml-@version@ (api version: 2) TEST #000000 #ffff00 --=_ ', $result ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/List/Query/Acl/BaseTest.php0000664000175000017500000000412212207101545027673 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of ACL. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_ComponentTest_List_Query_Acl_BaseTest extends Horde_Kolab_Storage_TestCase { public function testAclWithNewFolder() { $acl = $this->_getMockAcl(); $this->driver->create('INBOX/Test'); $this->assertEquals('lrswipkxtecda', $acl->getMyAcl('INBOX/Test')); } public function testSetGetAcl() { $acl = $this->_getMockAcl(); $this->driver->create('INBOX/Test'); $acl->setAcl('INBOX/Test', 'other', 'lrid'); $this->assertEquals( array('test@example.com' => 'lrswipkxtecda', 'other' => 'lrid'), $acl->getAcl('INBOX/Test') ); } public function testSetDeleteAcl() { $acl = $this->_getMockAcl(); $this->driver->create('INBOX/Test'); $acl->setAcl('INBOX/Test', 'other', 'lrid'); $acl->setAcl('INBOX/Test', 'two', 'lrid'); $acl->deleteAcl('INBOX/Test', 'two'); $this->assertEquals( array( 'other' => 'lrid', 'test@example.com' => 'lrswipkxtecda' ), $acl->getAcl('INBOX/Test') ); } private function _getMockAcl() { $factory = new Horde_Kolab_Storage_Factory(); $this->driver = $this->getNamespaceMock($factory); return new Horde_Kolab_Storage_List_Query_Acl_Base($this->driver); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/List/Query/List/BaseTest.php0000664000175000017500000002415212207101545030114 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the basic list query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_ComponentTest_List_Query_List_BaseTest extends Horde_Kolab_Storage_TestCase { public function testByTypeReturnsArray() { $this->assertInternalType('array', $this->getNullQuery()->listByType('test')); } public function testListCalendarsListsCalendars() { $this->assertEquals( array('INBOX/Calendar'), $this->getAnnotatedQuery()->listByType('event') ); } public function testListTasklistsListsTasklists() { $this->assertEquals( array('INBOX/Tasks'), $this->getAnnotatedQuery()->listByType('task') ); } public function testTypeReturnsArray() { $this->assertInternalType('array', $this->getNullQuery()->listTypes()); } public function testTypeReturnsAnnotations() { $this->assertEquals( array( 'INBOX/Calendar' => 'event', 'INBOX/Contacts' => 'contact', 'INBOX/Notes' => 'note', 'INBOX/Tasks' => 'task', ), $this->getAnnotatedQuery()->listTypes() ); } public function testListOwnersReturn() { $this->assertInternalType( 'array', $this->getAnnotatedQuery()->listOwners() ); } public function testListOwnerList() { $this->assertEquals( array( 'INBOX' => 'test@example.com', 'INBOX/Calendar' => 'test@example.com', 'INBOX/Contacts' => 'test@example.com', 'INBOX/Notes' => 'test@example.com', 'INBOX/Tasks' => 'test@example.com', 'INBOX/a' => 'test@example.com', ), $this->getAnnotatedQuery()->listOwners() ); } public function testListOwnerNamespace() { $this->assertEquals( array( 'INBOX' => 'test@example.com', 'INBOX/Calendar' => 'test@example.com', 'INBOX/Contacts' => 'test@example.com', 'INBOX/Notes' => 'test@example.com', 'INBOX/Tasks' => 'test@example.com', 'INBOX/a' => 'test@example.com', 'shared.Calendars/All' => null, 'shared.Calendars/Others' => null, 'user/example/Calendar' => 'example@example.com', 'user/example/Notes' => 'example@example.com', 'user/someone/Calendars/Events' => 'someone@example.com', 'user/someone/Calendars/Party' => 'someone@example.com', ), $this->getNamespaceQuery()->listOwners() ); } public function testDefaultReturn() { $this->assertInternalType( 'string', $this->getNamespaceQuery()->getDefault('event') ); } public function testDefaultCalendar() { $this->assertEquals( 'INBOX/Calendar', $this->getAnnotatedQuery()->getDefault('event') ); } public function testDefaultNotes() { $this->assertEquals( 'INBOX/Notes', $this->getAnnotatedQuery()->getDefault('note') ); } public function testMissingDefault() { $this->assertFalse( $this->getNullQuery()->getDefault('note') ); } public function testIgnoreForeignDefault() { $this->assertFalse( $this->getForeignDefaultQuery()->getDefault('event') ); } public function testIdentifyDefault() { $this->assertEquals( 'INBOX/Events', $this->getEventQuery()->getDefault('event') ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testBailOnDoubleDefault() { $this->getDoubleEventQuery()->getDefault('event'); } public function testForeignDefaultReturn() { $this->assertInternalType( 'string', $this->getEventQuery()->getForeignDefault( 'someone@example.com', 'event' ) ); } public function testForeignDefaultCalendar() { $this->assertEquals( 'user/someone/Calendar', $this->getEventQuery()->getForeignDefault( 'someone@example.com', 'event' ) ); } public function testForeignDefaultNotes() { $this->assertEquals( 'user/someone/Notes', $this->getEventQuery()->getForeignDefault( 'someone@example.com', 'note' ) ); } public function testMissingForeignDefault() { $this->assertFalse( $this->getNullQuery()->getForeignDefault( 'someone@example.com', 'contact' ) ); } public function testIdentifyForeignDefault() { $this->assertEquals( 'user/someone/Calendar', $this->getEventQuery()->getForeignDefault( 'someone@example.com', 'event' ) ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testBailOnDoubleForeignDefault() { $this->getDoubleEventQuery()->getForeignDefault( 'someone@example.com', 'event' ); } public function testListPersonalDefaults() { $this->assertEquals( array( 'contact' => 'INBOX/Contacts', 'event' => 'INBOX/Calendar', 'note' => 'INBOX/Notes', 'task' => 'INBOX/Tasks' ), $this->getAnnotatedQuery()->listPersonalDefaults() ); } public function testListDefaults() { $this->assertEquals( array( 'example@example.com' => array( 'event' => 'user/example/Calendar' ), 'someone@example.com' => array( 'event' => 'user/someone/Calendars/Events' ) ), $this->getForeignDefaultQuery()->listDefaults() ); } public function testDataByTypeReturnsArray() { $this->assertInternalType('array', $this->getNullQuery()->dataByType('test')); } public function testListCalendarsListsCalendarData() { $this->assertEquals( array('INBOX/Calendar'), array_keys($this->getAnnotatedQuery()->dataByType('event')) ); } public function testListTasklistsListsTasklistData() { $this->assertEquals( array('INBOX/Tasks'), array_keys($this->getAnnotatedQuery()->dataByType('task')) ); } public function testListDataHasOwner() { $data = $this->getAnnotatedQuery()->dataByType('event'); $this->assertEquals( 'test@example.com', $data['INBOX/Calendar']['owner'] ); } public function testListDataHasTitle() { $data = $this->getAnnotatedQuery()->dataByType('event'); $this->assertEquals( 'Calendar', $data['INBOX/Calendar']['name'] ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testMissingFolderData() { $this->assertInternalType('array', $this->getNullQuery()->folderData('INBOX/Calendar')); } public function testFolderDataReturnsArray() { $this->assertInternalType('array', $this->getAnnotatedQuery()->folderData('INBOX/Calendar')); } public function testFolderDataHasOwner() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('test@example.com', $data['owner']); } public function testFolderDataHasTitle() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('Calendar', $data['name']); } public function testFolderDataHasType() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('event', $data['type']); } public function testFolderDataHasDefault() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertTrue($data['default']); } public function testMailFolderDataType() { $data = $this->getAnnotatedQuery()->folderData('INBOX'); $this->assertEquals('mail', $data['type']); } public function testMailFolderDataNoDefault() { $data = $this->getAnnotatedQuery()->folderData('INBOX'); $this->assertFalse($data['default']); } public function testFolderDataHasNamespace() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('personal', $data['namespace']); } public function testFolderDataHasNamespacePrefix() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('INBOX', $data['prefix']); } public function testFolderDataHasSubpath() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('Calendar', $data['subpath']); } public function testFolderDataHasDelimiter() { $data = $this->getAnnotatedQuery()->folderData('INBOX/Calendar'); $this->assertEquals('/', $data['delimiter']); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/List/Query/List/CacheTest.php0000664000175000017500000003535312207101545030252 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the cached list query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_ComponentTest_List_Query_List_CacheTest extends Horde_Kolab_Storage_TestCase { public function testTypeReturnsArray() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getNullMock($factory), $factory); $this->assertInternalType('array', $query->listTypes()); } public function testTypeReturnsAnnotations() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals( array( 'INBOX' => 'mail', 'INBOX/Calendar' => 'event', 'INBOX/Contacts' => 'contact', 'INBOX/Notes' => 'note', 'INBOX/Tasks' => 'task', 'INBOX/a' => 'mail', ), $query->listTypes() ); } public function testByTypeReturnsArray() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getNullMock($factory), $factory); $this->assertInternalType('array', $query->listByType('test')); } public function testListCalendarsListsCalendars() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals(array('INBOX/Calendar'), $query->listByType('event')); } public function testListTasklistsListsTasklists() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals(array('INBOX/Tasks'), $query->listByType('task')); } public function testListOwnersReturn() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertInternalType( 'array', $query->listOwners() ); } public function testListOwnerList() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals( array( 'INBOX' => 'test@example.com', 'INBOX/Calendar' => 'test@example.com', 'INBOX/Contacts' => 'test@example.com', 'INBOX/Notes' => 'test@example.com', 'INBOX/Tasks' => 'test@example.com', 'INBOX/a' => 'test@example.com', ), $query->listOwners() ); } public function testListOwnerNamespace() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getNamespaceMock($factory), $factory); $this->assertEquals( array( 'INBOX' => 'test@example.com', 'INBOX/Calendar' => 'test@example.com', 'INBOX/Contacts' => 'test@example.com', 'INBOX/Notes' => 'test@example.com', 'INBOX/Tasks' => 'test@example.com', 'INBOX/a' => 'test@example.com', 'shared.Calendars/All' => null, 'shared.Calendars/Others' => null, 'user/example/Calendar' => 'example@example.com', 'user/example/Notes' => 'example@example.com', 'user/someone/Calendars/Events' => 'someone@example.com', 'user/someone/Calendars/Party' => 'someone@example.com', ), $query->listOwners() ); } public function testDefaultReturn() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertInternalType( 'string', $query->getDefault('event') ); } public function testDefaultCalendar() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals( 'INBOX/Calendar', $query->getDefault('event') ); } public function testDefaultNotes() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals( 'INBOX/Notes', $query->getDefault('note') ); } public function testMissingDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getNullMock($factory), $factory); $this->assertFalse( $query->getDefault('note') ); } public function testIgnoreForeignDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getForeignDefaultMock($factory), $factory); $this->assertFalse( $query->getDefault('event') ); } public function testIdentifyDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getEventMock($factory), $factory); $this->assertEquals( 'INBOX/Events', $query->getDefault('event') ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testBailOnDoubleDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getDoubleEventMock($factory), $factory); $query->getDefault('event'); } public function testForeignDefaultReturn() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getEventMock($factory), $factory); $this->assertInternalType( 'string', $query->getForeignDefault('someone@example.com', 'event') ); } public function testForeignDefaultCalendar() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getEventMock($factory), $factory); $this->assertEquals( 'user/someone/Calendar', $query->getForeignDefault('someone@example.com', 'event') ); } public function testForeignDefaultNotes() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getEventMock($factory), $factory); $this->assertEquals( 'user/someone/Notes', $query->getForeignDefault('someone@example.com', 'note') ); } public function testMissingForeignDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getNullMock($factory), $factory); $this->assertFalse( $query->getForeignDefault('someone@example.com', 'contact') ); } public function testIdentifyForeignDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getEventMock($factory), $factory); $this->assertEquals( 'user/someone/Calendar', $query->getForeignDefault('someone@example.com', 'event') ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testBailOnDoubleForeignDefault() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getDoubleEventMock($factory), $factory); $query->getForeignDefault('someone@example.com', 'event'); } public function testListPersonalDefaults() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals( array( 'contact' => 'INBOX/Contacts', 'event' => 'INBOX/Calendar', 'note' => 'INBOX/Notes', 'task' => 'INBOX/Tasks' ), $query->listPersonalDefaults() ); } public function testListDefaults() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getForeignDefaultMock($factory), $factory); $this->assertEquals( array( 'example@example.com' => array( 'event' => 'user/example/Calendar' ), 'someone@example.com' => array( 'event' => 'user/someone/Calendars/Events' ) ), $query->listDefaults() ); } public function testDataByTypeReturnsArray() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getNullMock($factory), $factory); $this->assertInternalType('array', $query->dataByType('test')); } public function testListCalendarsListsCalendarData() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals(array('INBOX/Calendar'), array_keys($query->dataByType('event'))); } public function testListTasklistsListsTasklistData() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $this->assertEquals(array('INBOX/Tasks'), array_keys($query->dataByType('task'))); } public function testListDataHasOwner() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $data = $query->dataByType('event'); $this->assertEquals( 'test@example.com', $data['INBOX/Calendar']['owner'] ); } public function testListDataHasTitle() { $factory = new Horde_Kolab_Storage_Factory(); $query = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory); $data = $query->dataByType('event'); $this->assertEquals( 'Calendar', $data['INBOX/Calendar']['name'] ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testMissingFolderData() { $this->assertInternalType('array', $this->getNullQuery()->folderData('INBOX/Calendar')); } public function testFolderDataReturnsArray() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertInternalType('array', $data); } public function testFolderDataHasOwner() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('test@example.com', $data['owner']); } public function testFolderDataHasTitle() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('Calendar', $data['name']); } public function testFolderDataHasType() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('event', $data['type']); } public function testFolderDataHasDefault() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertTrue($data['default']); } public function testMailFolderDataType() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX'); $this->assertEquals('mail', $data['type']); } public function testMailFolderDataNoDefault() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX'); $this->assertFalse($data['default']); } public function testFolderDataHasNamespace() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('personal', $data['namespace']); } public function testFolderDataHasNamespacePrefix() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('INBOX', $data['prefix']); } public function testFolderDataHasNamespacePrefixUser() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getNamespaceMock($factory), $factory)->folderData('user/example/Calendar'); $this->assertEquals('user', $data['prefix']); } public function testFolderDataHasSubpath() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('Calendar', $data['subpath']); } public function testFolderDataHasDelimiter() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getCachedQueryForList($this->getAnnotatedMock($factory), $factory)->folderData('INBOX/Calendar'); $this->assertEquals('/', $data['delimiter']); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/ComponentTest/List/CacheTest.php0000664000175000017500000001503412207101545026224 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the list cache. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_ComponentTest_List_CacheTest extends Horde_Kolab_Storage_TestCase { public function testListId() { $this->assertEquals( '933029c877625645eaa074e95727db52', $this->_getTestCache()->getListId() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingListId() { $cache = new Horde_Kolab_Storage_List_Cache($this->getMockCache()); $cache->getListId(); } public function testNotInitialized() { $this->assertFalse($this->_getTestCache()->isInitialized()); } public function testInvalidVersion() { $cache = $this->getMockCache(); $cache->storeList( 'test', serialize(array('S' => time(), 'V' => '0')) ); $this->assertFalse($this->_getTestCache($cache)->isInitialized()); } public function testMissingSync() { $cache = $this->getMockCache(); $cache->storeList( 'test', serialize( array('V' => Horde_Kolab_Storage_List_Cache::VERSION) ) ); $this->assertFalse($this->_getTestCache($cache)->isInitialized()); } public function testNamespace() { $cache = $this->_getTestCache(); $cache->setNamespace('DUMMY'); $this->assertEquals('DUMMY', $cache->getNamespace()); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingNamespace() { $cache = $this->_getTestCache(); $cache->getNamespace(); } public function testUnsetSupport() { $cache = $this->_getTestCache(); $this->assertFalse($cache->issetSupport('ACL')); } public function testLongterm() { $cache = $this->_getTestCache(); $cache->setLongTerm('DUMMY', 'dummy'); $this->assertEquals('dummy', $cache->getLongTerm('DUMMY')); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingLongterm() { $cache = $this->_getTestCache(); $cache->getLongTerm('DUMMY'); } public function testSetSupport() { $cache = $this->_getTestCache(); $cache->setSupport('ACL', true); $this->assertTrue($cache->issetSupport('ACL')); } public function testSupport() { $cache = $this->_getTestCache(); $cache->setSupport('ACL', true); $this->assertTrue($cache->hasSupport('ACL')); } public function testNoSupport() { $cache = $this->_getTestCache(); $cache->setSupport('ACL', false); $this->assertFalse($cache->hasSupport('ACL')); } public function testID() { $cache = $this->getMockCache(); $list_cache = new Horde_Kolab_Storage_List_Cache( $cache, array('host' => 'test', 'port' => '0', 'user' => 'test') ); //$list_cache->setListId('test'); $list_cache->store(array(), array()); $list_cache->save(); $data = unserialize($cache->loadList($list_cache->getListId())); $this->assertEquals( 'a:3:{s:4:"host";s:4:"test";s:4:"port";s:1:"0";s:4:"user";s:4:"test";}', $data['I'] ); } public function testMissingStamp() { $cache = $this->_getTestCache(); $this->assertEquals(0, $cache->getStamp()); } public function testStamp() { $list_cache = $this->_getTestCache(); $list_cache->store(array(), array()); $list_cache->save(); $this->assertEquals( 6, strlen($list_cache->getStamp()) ); } public function testNewHost() { $this->assertNotSame( $this->_getTestCache( null, array('host' => 'a', 'port' => 1, 'user' => 'x') )->getListId(), $this->_getTestCache( null, array('host' => 'b', 'port' => 1, 'user' => 'x') )->getListId() ); } public function testNewPort() { $this->assertNotSame( $this->_getTestCache( null, array('host' => 'a', 'port' => 1, 'user' => 'x') )->getListId(), $this->_getTestCache( null, array('host' => 'a', 'port' => 2, 'user' => 'x') )->getListId() ); } public function testNewUser() { $this->assertNotSame( $this->_getTestCache( null, array('host' => 'a', 'port' => 1, 'user' => 'x') )->getListId(), $this->_getTestCache( null, array('host' => 'a', 'port' => 1, 'user' => 'y') )->getListId() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingHost() { $this->_getTestCache(null, array('port' => 1, 'user' => 'x')); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingPort() { $this->_getTestCache(null, array('host' => 'a', 'user' => 'x')); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingUser() { $this->_getTestCache(null, array('host' => 'a', 'port' => 1)); } private function _getTestCache($cache = null, $params = null) { if ($cache === null) { $cache = $this->getMockCache(); } if ($params === null) { $params = array('host' => 'a', 'port' => 1, 'user' => 'b'); } $list_cache = new Horde_Kolab_Storage_List_Cache( $cache, $params ); return $list_cache; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/broken_note.eml0000644000175000017500000000253112207101545025004 0ustar janjanFrom: a@example.com To: a@example.com Date: Mon, 07 Mar 2011 08:58:04 +0100 X-Kolab-Type: application/x-vnd.kolab.note Subject: 57da39631fb128d4cb0141ff5dbdfbdf User-Agent: Horde::Kolab::Storage v0.2 MIME-Version: 1.0 Content-Type: text/plain Content-Disposition: attachment; size=1072 --=_4m0ibqrletyc Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Die ist ein Kolab-Groupware-Objekt. Um dieses Objekt anzuzeigen, ben=C3=B6ti= gen Sie ein E-Mail-Programm, das das Kolab-Groupware-Format unterst=C3=BCtzt. Ei= ne Liste solcher Programme finden Sie unter http://www.kolab.org/kolab2-clients.html --=_4m0ibqrletyc Content-Type: application/x-vnd.kolab.note; name="kolab.xml" Content-Disposition: attachment; filename="kolab.xml" Content-Transfer-Encoding: quoted-printable 57da39631fb128d4cb0141ff5dbdfbdf a 2011-03-07T07:58:04Z 2011-03-07T07:58:04Z public Horde::Kolab a #000000 #ffff00 --=_4m0ibqrletyc-- Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/event.1.xml.qp0000644000175000017500000000143512207101545024423 0ustar janjan=0A=0A KOrganizer 3.3 (proko2 branch after 2.1.5), Kolab resource=0A libkcal-543769073.132=0A 2006-03-16T15:= 00:53Z=0A 2007-01-25T11:36:40Z=0A public=0A 1=0A 2006-03-15T18:30:00Z= =0A Summary=0A =0A Orga Nizer<= /display-name>=0A orga.nizer@example.com=0A <= /organizer>=0A ...=C3=BCbbe...=0A 0=0A busy=0A 2007-03-15T20:00:00Z=0A=0A Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/event.2.xml.qp0000644000175000017500000000143512207101545024424 0ustar janjan=0A=0A KOrganizer 3.3 (proko2 branch after 2.1.5), Kolab resource=0A libkcal-543769073.131=0A 2006-03-16T15:= 00:53Z=0A 2007-01-25T11:36:40Z=0A public=0A 1=0A 2006-03-15T18:30:00Z= =0A Summary=0A =0A Orga Nizer<= /display-name>=0A orga.nizer@example.com=0A <= /organizer>=0A ...=C3=BCbbe...=0A 0=0A busy=0A 2007-03-15T20:00:00Z=0A=0A Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/event.3.xml.qp0000644000175000017500000000143512207101545024425 0ustar janjan=0A=0A KOrganizer 3.3 (proko2 branch after 2.1.5), Kolab resource=0A libkcal-543769073.130=0A 2006-03-16T15:= 00:53Z=0A 2007-01-25T11:36:40Z=0A public=0A 1=0A 2006-03-15T18:30:00Z= =0A Summary=0A =0A Orga Nizer<= /display-name>=0A orga.nizer@example.com=0A <= /organizer>=0A ...=C3=BCbbe...=0A 0=0A busy=0A 2007-03-15T20:00:00Z=0A=0A Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/event.struct0000644000175000017500000000463112207101545024372 0ustar janjanTzoxNToiSG9yZGVfTWltZV9QYXJ0IjoxOTp7czo4OiIAKgBfdHlwZSI7czo5OiJtdWx0aXBhcnQiO3M6MTE6IgAqAF9zdWJ0eXBlIjtzOjU6Im1peGVkIjtzOjEyOiIAKgBfY29udGVudHMiO047czoyMDoiACoAX3RyYW5zZmVyRW5jb2RpbmciO3M6NjoiYmluYXJ5IjtzOjE1OiIAKgBfZGVzY3JpcHRpb24iO3M6MDoiIjtzOjE1OiIAKgBfZGlzcG9zaXRpb24iO3M6MDoiIjtzOjE0OiIAKgBfZGlzcFBhcmFtcyI7YTowOnt9czoyMToiACoAX2NvbnRlbnRUeXBlUGFyYW1zIjthOjE6e3M6ODoiYm91bmRhcnkiO3M6MTQ6Ij1fMWFrbW10M2lpNnY0Ijt9czo5OiIAKgBfcGFydHMiO2E6Mjp7aTowO086MTU6IkhvcmRlX01pbWVfUGFydCI6MTk6e3M6ODoiACoAX3R5cGUiO3M6NDoidGV4dCI7czoxMToiACoAX3N1YnR5cGUiO3M6NToicGxhaW4iO3M6MTI6IgAqAF9jb250ZW50cyI7TjtzOjIwOiIAKgBfdHJhbnNmZXJFbmNvZGluZyI7czoxNjoicXVvdGVkLXByaW50YWJsZSI7czoxNToiACoAX2Rlc2NyaXB0aW9uIjtzOjA6IiI7czoxNToiACoAX2Rpc3Bvc2l0aW9uIjtzOjY6ImlubGluZSI7czoxNDoiACoAX2Rpc3BQYXJhbXMiO2E6MTp7czo0OiJzaXplIjtzOjM6IjI0OSI7fXM6MjE6IgAqAF9jb250ZW50VHlwZVBhcmFtcyI7YToxOntzOjc6ImNoYXJzZXQiO3M6NToiVVRGLTgiO31zOjk6IgAqAF9wYXJ0cyI7YTowOnt9czoxMDoiACoAX21pbWVpZCI7czoxOiIxIjtzOjc6IgAqAF9lb2wiO3M6MToiCiI7czo4OiIAKgBfdGVtcCI7YTowOnt9czoxMjoiACoAX21ldGFkYXRhIjthOjA6e31zOjEyOiIAKgBfYm91bmRhcnkiO047czo5OiIAKgBfYnl0ZXMiO2k6MjQ5O3M6MTM6IgAqAF9jb250ZW50aWQiO047czoxMToiACoAX3JlaW5kZXgiO2I6MDtzOjEyOiIAKgBfYmFzZXBhcnQiO2I6MDtzOjE0OiIAKgBfaGRyQ2hhcnNldCI7Tjt9aToxO086MTU6IkhvcmRlX01pbWVfUGFydCI6MTk6e3M6ODoiACoAX3R5cGUiO3M6MTE6ImFwcGxpY2F0aW9uIjtzOjExOiIAKgBfc3VidHlwZSI7czoxNzoieC12bmQua29sYWIuZXZlbnQiO3M6MTI6IgAqAF9jb250ZW50cyI7TjtzOjIwOiIAKgBfdHJhbnNmZXJFbmNvZGluZyI7czoxNjoicXVvdGVkLXByaW50YWJsZSI7czoxNToiACoAX2Rlc2NyaXB0aW9uIjtzOjA6IiI7czoxNToiACoAX2Rpc3Bvc2l0aW9uIjtzOjEwOiJhdHRhY2htZW50IjtzOjE0OiIAKgBfZGlzcFBhcmFtcyI7YToyOntzOjQ6InNpemUiO3M6MzoiNzA0IjtzOjg6ImZpbGVuYW1lIjtzOjk6ImtvbGFiLnhtbCI7fXM6MjE6IgAqAF9jb250ZW50VHlwZVBhcmFtcyI7YToxOntzOjQ6Im5hbWUiO3M6OToia29sYWIueG1sIjt9czo5OiIAKgBfcGFydHMiO2E6MDp7fXM6MTA6IgAqAF9taW1laWQiO3M6MToiMiI7czo3OiIAKgBfZW9sIjtzOjE6IgoiO3M6ODoiACoAX3RlbXAiO2E6MDp7fXM6MTI6IgAqAF9tZXRhZGF0YSI7YTowOnt9czoxMjoiACoAX2JvdW5kYXJ5IjtOO3M6OToiACoAX2J5dGVzIjtpOjcwNDtzOjEzOiIAKgBfY29udGVudGlkIjtOO3M6MTE6IgAqAF9yZWluZGV4IjtiOjA7czoxMjoiACoAX2Jhc2VwYXJ0IjtiOjA7czoxNDoiACoAX2hkckNoYXJzZXQiO047fX1zOjEwOiIAKgBfbWltZWlkIjtzOjE6IjAiO3M6NzoiACoAX2VvbCI7czoxOiIKIjtzOjg6IgAqAF90ZW1wIjthOjA6e31zOjEyOiIAKgBfbWV0YWRhdGEiO2E6MDp7fXM6MTI6IgAqAF9ib3VuZGFyeSI7czoyNToiPV9jZmVHU3J2Z2pobE5ZaFpIbFZRa215QSI7czo5OiIAKgBfYnl0ZXMiO047czoxMzoiACoAX2NvbnRlbnRpZCI7TjtzOjExOiIAKgBfcmVpbmRleCI7YjowO3M6MTI6IgAqAF9iYXNlcGFydCI7YjowO3M6MTQ6IgAqAF9oZHJDaGFyc2V0IjtOO30= Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/event.xml.qp0000644000175000017500000000143312207101545024262 0ustar janjan=0A=0A KOrganizer 3.3 (proko2 branch after 2.1.5), Kolab resource=0A libkcal-543769073.139=0A 2006-03-16T15:= 00:53Z=0A 2007-01-25T11:36:40Z=0A public=0A 1=0A 2006-03-15T18:30:00Z= =0A Summary=0A =0A Orga Nizer<= /display-name>=0A orga.nizer@example.com=0A <= /organizer>=0A ...=C3=BCbbe...=0A 0=0A busy=0A 2007-03-15T20:00:00Z=0A=0AHorde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/note.eml0000664000175000017500000000304412207101545023446 0ustar janjanFrom: user To: user Date: Tue, 11 Sep 2012 09:06:04 +0200 Subject: ABC1234 User-Agent: Horde::Kolab::Storage v@version@ MIME-Version: 1.0 X-Kolab-Type: application/x-vnd.kolab.note Content-Type: multipart/mixed; name="Kolab Groupware Data"; boundary="=_23WLX7vgjhlQTuLb6j00EAA" Content-Disposition: attachment; filename="Kolab Groupware Data" This message is in MIME format. --=_23WLX7vgjhlQTuLb6j00EAA Content-Type: text/plain; name="Kolab Groupware Information"; charset=utf-8 Content-Disposition: inline; filename="Kolab Groupware Information" This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit http://www.kolab.org/content/kolab-clients --=_23WLX7vgjhlQTuLb6j00EAA Content-Type: application/x-vnd.kolab.note; name=kolab.xml Content-Disposition: inline; x-kolab-type=xml; filename=kolab.xml Content-Transfer-Encoding: quoted-printable ABC1234 2012-09-11T09:06:04Z 2012-09-11T07:06:04Z public Horde_Kolab_Format_Xml-@version@ (api version: 2) TEST other client #000000 #ffff00 --=_23WLX7vgjhlQTuLb6j00EAA-- Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/preferences.10000644000175000017500000000560312207101545024366 0ustar janjanFrom: wrobel@example.com To: wrobel@example.com Date: Sat, 16 Apr 2011 13:24:17 +0200 X-Kolab-Type: application/x-vnd.kolab.h-prefs Subject: 20080626155721.771268tms63o0rs4@devmail.example.com User-Agent: Horde::Kolab v1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_6k30ome8aw00" Content-Transfer-Encoding: 7bit This message is in MIME format. --=_6k30ome8aw00 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Die ist ein Kolab-Groupware-Objekt. Um dieses Objekt anzuzeigen, ben=C3=B6ti= gen Sie ein E-Mail-Programm, das das Kolab-Groupware-Format unterst=C3=BCtzt. Ei= ne Liste solcher Programme finden Sie unter http://www.kolab.org/kolab2-clients.html --=_6k30ome8aw00 Content-Type: application/x-vnd.kolab.h-prefs; name="h-prefs.xml" Content-Disposition: inline; filename="h-prefs.xml" Content-Transfer-Encoding: quoted-printable 20080626155721.771268tms63o0rs4@devmail.example.com horde 2008-06-26T13:57:21Z 2011-04-16T11:24:17Z public Horde::Kolab default_identity:MA=3D=3D confirm_email:YTowOnt9 id: fullname: from_addr: credentials:YTowOnt9 security_question: security_answer: alternate_email: language:ZGVfREU=3D timezone:RXVyb3BlL0Jlcmxpbg=3D=3D twentyFour: date_format:JXg=3D first_week_day:MA=3D=3D theme:c2lsdmVy summary_refresh_time:MzAw show_sidebar:MQ=3D=3D sidebar_width:MjUw menu_view:Ym90aA=3D=3D menu_refresh_time:MzAw do_maintenance:MQ=3D=3D last_maintenance:MTI5OTAxNzc5Mw=3D=3D confirm_maintenance:MQ=3D=3D initial_application:aG9yZGU=3D widget_accesskey:MQ=3D=3D remote_summaries:YTowOnt9 last_login:YToyOntzOjQ6InRpbWUiO2k6MTMwMjk1MzA1NjtzOjQ6Imhvc3QiO3M6M= TQ6IjgyLjExMy4xMDYuMTk4Ijt9 show_last_login:MQ=3D=3D editor_plugins:YToyOntpOjA7czo4OiJMaXN0VHlwZSI7aToxO3M6MTI6IkNoYXJhY= 3Rlck1hcCI7fQ=3D=3D default_notepad:d3JvYmVsQHBhcmR1cy5kZQ=3D=3D sending_charset:VVRGLTg=3D display_contact:MQ=3D=3D add_source:SU5CT1glMkZCYWNrdXA=3D default_tasklist:d3JvYmVsQHBhcmR1cy5kZQ=3D=3D default_dir:d3JvYmVsQHBhcmR1cy5kZQ=3D=3D perpage:MjA=3D --=_6k30ome8aw00-- Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/fixtures/preferences.20000644000175000017500000001372212207101545024370 0ustar janjanFrom: wrobel@example.com To: wrobel@example.com Date: Tue, 01 Mar 2011 23:17:23 +0100 X-Kolab-Type: application/x-vnd.kolab.h-prefs Subject: 20090731103253.11391snjudt9zgpw@webmail.example.com User-Agent: Horde::Kolab v1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_3dyvh28nhxs0" Content-Transfer-Encoding: 7bit This message is in MIME format. --=_3dyvh28nhxs0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Die ist ein Kolab-Groupware-Objekt. Um dieses Objekt anzuzeigen, ben=C3=B6ti= gen Sie ein E-Mail-Programm, das das Kolab-Groupware-Format unterst=C3=BCtzt. Ei= ne Liste solcher Programme finden Sie unter http://www.kolab.org/kolab2-clients.html --=_3dyvh28nhxs0 Content-Type: application/x-vnd.kolab.h-prefs; name="h-prefs.xml" Content-Disposition: inline; filename="h-prefs.xml" Content-Transfer-Encoding: quoted-printable 20090731103253.11391snjudt9zgpw@webmail.example.com imp 2009-07-31T08:32:53Z 2011-03-01T22:17:23Z public Horde::Kolab replyto_addr: alias_addr: tieto_addr: bcc_addr: signature: sig_dashes:MA=3D=3D sig_first:MA=3D=3D save_sent_mail:MQ=3D=3D sent_mail_folder:c2VudC1tYWls use_vinbox:MQ=3D=3D use_vtask:MQ=3D=3D subscribe:MQ=3D=3D drafts_folder:RHJhZnRz trash_folder:VHJhc2g=3D spam_folder:L3NoYXJlZC5hbHNfc3BhbV9sZXJuZW4=3D acl: initial_page:SU5CT1g=3D rename_sentmail_monthly:MA=3D=3D delete_sentmail_monthly:MA=3D=3D delete_sentmail_monthly_keep:MTI=3D purge_sentmail:MA=3D=3D purge_sentmail_interval:Mg=3D=3D purge_sentmail_keep:MzA=3D delete_attachments_monthly:MQ=3D=3D delete_attachments_monthly_keep:Ng=3D=3D purge_spam:MA=3D=3D purge_spam_interval:Mg=3D=3D purge_spam_keep:MzA=3D purge_trash:MA=3D=3D purge_trash_interval:Mg=3D=3D purge_trash_keep:MzA=3D tos_agreement:MA=3D=3D compose_cc:MQ=3D=3D compose_bcc:MQ=3D=3D compose_spellcheck:MA=3D=3D compose_confirm:MA=3D=3D set_priority:MQ=3D=3D compose_popup:MQ=3D=3D compose_html:MA=3D=3D jseditor:eGluaGE=3D mail_domain: compose_cursor:c2ln default_encrypt:MQ=3D=3D save_attachments:YWx3YXlz disposition_request_read:YXNr reply_quote:MQ=3D=3D reply_format:MQ=3D=3D forward_default:Zm9yd2FyZF9hbGw=3D forward_bodytext:MQ=3D=3D reply_headers:MA=3D=3D attrib_text:UXVvdGluZyAlZjo=3D close_draft:MQ=3D=3D unseen_drafts:MA=3D=3D auto_save_drafts:MA=3D=3D filtering:MA=3D=3D strip_attachments:MA=3D=3D delete_spam_after_report:Mg=3D=3D html_image_replacement:MQ=3D=3D html_image_addrbook:MQ=3D=3D highlight_text:MQ=3D=3D highlight_simple_markup:MQ=3D=3D show_quoteblocks:dGhyZWFk dim_signature:MQ=3D=3D emoticons:MQ=3D=3D attachment_display:bGlzdA=3D=3D mail_hdr: default_msg_charset:VVRGLTg=3D alternative_display:bm9uZQ=3D=3D disposition_send_mdn:MQ=3D=3D mailbox_return:MA=3D=3D use_trash:MQ=3D=3D use_vtrash:MA=3D=3D vtrash_id: empty_trash_menu:MQ=3D=3D empty_spam_menu:MQ=3D=3D delhide:MA=3D=3D refresh_time:MA=3D=3D nav_popup:MA=3D=3D nav_audio:MA=3D=3D preview_enabled:MA=3D=3D preview_maxlen:MjUw preview_strip_nl:MQ=3D=3D preview_show_unread:MQ=3D=3D preview_show_tooltip:MA=3D=3D fetchmail_popup:MA=3D=3D fetchmail_menu:MA=3D=3D fm_accounts:YTowOnt9 fetchmail_login:MA=3D=3D mailbox_start:MQ=3D=3D sortby:MQ=3D=3D sortdir:MA=3D=3D max_msgs:MjA=3D from_link:MQ=3D=3D time_format:JVg=3D nav_expanded:MA=3D=3D tree_view:MA=3D=3D nav_expanded_sidebar:MA=3D=3D nav_poll_all: filter_on_login:MA=3D=3D filter_on_display:MA=3D=3D filter_on_sidebar:MA=3D=3D filter_menuitem: filter_any_mailbox:MA=3D=3D save_recipients:MA=3D=3D search_sources:SU5CT1glMkZCYWNrdXA=3D search_fields: use_pgp:MQ=3D=3D pgp_attach_pubkey:MA=3D=3D pgp_scan_body:MQ=3D=3D pgp_verify:MQ=3D=3D use_smime:MA=3D=3D smime_verify:MQ=3D=3D smime_private_key: smime_public_key: smime_additional_cert: vinbox_id:NWQ0Ym8xbzNrcHdrZ28wZ29ndzQ4 vtask_id:NWpna244cWg0c280ZzQwOHNnNGd3MA=3D=3D auto_delete_drafts:MA=3D=3D default_search: --=_3dyvh28nhxs0-- Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Server/DriverTest.php0000664000175000017500000001212512207101545024203 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Server test of the different driver implementations. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Server_DriverTest extends PHPUnit_Framework_TestCase { const MOCK = 'Mock'; const CCLIENT = 'Cclient'; const PEAR = 'Pear'; const IMAP_SOCKET = 'Imap_Socket'; public function setUp() { if (!isset($this->sharedFixture)) { $this->markTestSkipped('Testing of a running server skipped. No configuration fixture available.'); return; } /** Setup group handler */ require_once 'Horde/Group.php'; require_once 'Horde/Group/mock.php'; $this->group = new Group_mock(); } public function tearDown() { /** Reactivate strict reporting as we need to turn it off for PEAR-Net_IMAP */ if (!empty($this->old_error_reporting)) { error_reporting($this->old_error_reporting); } } public function provideDrivers() { return array( 'mock driver' => array(self::MOCK), 'PHP c-client based driver' => array(self::CCLIENT), 'PEAR-Net_IMAP based driver' => array(self::PEAR), 'Horde_Imap_Client_Socket based driver' => array(self::IMAP_SOCKET), ); } private function _getDriver($driver) { if ($driver == self::PEAR) { /** PEAR-Net_IMAP is not E_STRICT */ $this->old_error_reporting = error_reporting(E_ALL & ~E_STRICT); } if (!isset($this->sharedFixture->drivers[$driver])) { switch ($driver) { case self::MOCK: $connection = new Horde_Kolab_Storage_Driver_Mock($this->group); break; case self::CCLIENT: $connection = new Horde_Kolab_Storage_Driver_Cclient( $this->group ); break; case self::PEAR: $client = new Net_IMAP($this->sharedFixture->conf['host'], 143, false); $client->login( $this->sharedFixture->conf['user'], $this->sharedFixture->conf['pass'] ); $connection = new Horde_Kolab_Storage_Driver_Pear( $client, $this->group ); break; case self::IMAP_SOCKET: $params = array( 'hostspec' => $this->sharedFixture->conf['host'], 'username' => $this->sharedFixture->conf['user'], 'password' => $this->sharedFixture->conf['pass'], 'debug' => $this->sharedFixture->conf['debug'], 'port' => 143, 'secure' => false ); $client = Horde_Imap_Client::factory('socket', $params); $client->login(); $connection = new Horde_Kolab_Storage_Driver_Imap( $client, $this->group ); break; default: exit("Undefined storage driver!\n"); } $this->sharedFixture->drivers[$driver] = $connection; } return $this->sharedFixture->drivers[$driver]; } /** * @dataProvider provideDrivers */ public function testDriverType($driver) { $this->assertInstanceOf('Horde_Kolab_Storage_Driver', $this->_getDriver($driver)); } /** * @dataProvider provideDrivers */ public function testGetNamespace($driver) { $namespaces = array(); foreach ($this->_getDriver($driver)->getNamespace() as $namespace) { $namespaces[$namespace->getName()] = array( 'type' => $namespace->getType(), 'delimiter' => $namespace->getDelimiter(), ); } $this->assertEquals( array( 'INBOX' => array( 'type' => 'personal', 'delimiter' => '/', ), 'user' => array( 'type' => 'other', 'delimiter' => '/', ), '' => array( 'type' => 'shared', 'delimiter' => '/', ), ), $namespaces ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Stub/DataQuery.php0000644000175000017500000000062012207101545023451 0ustar janjansynchronized = true; } }Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Stub/Driver.php0000664000175000017500000002303312207101545023012 0ustar janjanuser = $user; } public function setMessage($folder, $id, $message) { $this->messages[$folder][$id] = $message; } /** * Create the backend driver. * * @return mixed The backend driver. */ public function createBackend() { } /** * Returns the actual backend driver. * * If there is no driver set the driver should be constructed within this * method. * * @return mixed The backend driver. */ public function getBackend() { } /** * Set the backend driver. * * @param mixed $backend The driver that should be used. * * @return NULL */ public function setBackend($backend) { } /** * Returns the parser for data objects. * * @return Horde_Kolab_Storage_Data_Parser The parser. */ public function getParser() { } /** * Set the data parser. * * @param mixed $parser The parser that should be used. * * @return NULL */ public function setParser(Horde_Kolab_Storage_Data_Parser $parser) { } /** * Return the id of the user currently authenticated. * * @return string The id of the user that opened the connection. */ public function getAuth() { return $this->user; } /** * Return the unique connection id. * * @return string The connection id. */ public function getId() { } /** * Return the connection parameters. * * @return array The connection parameters. */ public function getParameters() { } /** * Checks if the backend supports CATENATE. * * @return boolean True if the backend supports CATENATE. */ public function hasCatenateSupport() { } /** List functionality */ /** * Retrieves a list of folders from the server. * * @return array The list of folders. */ public function listFolders() { } /** * Create the specified folder. * * @param string $folder The folder to create. * * @return NULL */ public function create($folder) { } /** * Delete the specified folder. * * @param string $folder The folder to delete. * * @return NULL */ public function delete($folder) { } /** * Rename the specified folder. * * @param string $old The folder to rename. * @param string $new The new name of the folder. * * @return NULL */ public function rename($old, $new) { } /** * Does the backend support ACL? * * @return boolean True if the backend supports ACLs. */ public function hasAclSupport() { } /** * Retrieve the access rights for a folder. * * @param string $folder The folder to retrieve the ACL for. * * @return array An array of rights. */ public function getAcl($folder) { } /** * Retrieve the access rights the current user has on a folder. * * @param string $folder The folder to retrieve the user ACL for. * * @return string The user rights. */ public function getMyAcl($folder) { } /** * Set the access rights for a folder. * * @param string $folder The folder to act upon. * @param string $user The user to set the ACL for. * @param string $acl The ACL. * * @return NULL */ public function setAcl($folder, $user, $acl) { } /** * Delete the access rights for user on a folder. * * @param string $folder The folder to act upon. * @param string $user The user to delete the ACL for * * @return NULL */ public function deleteAcl($folder, $user) { } /** * Retrieves the specified annotation for the complete list of folders. * * @param string $annotation The name of the annotation to retrieve. * * @return array An associative array combining the folder names as key with * the corresponding annotation value. */ public function listAnnotation($annotation) { } /** * Fetches the annotation from a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to get. * * @return string The annotation value. */ public function getAnnotation($folder, $annotation) { } /** * Sets the annotation on a folder. * * @param string $folder The name of the folder. * @param string $annotation The annotation to set. * @param array $value The values to set * * @return NULL */ public function setAnnotation($folder, $annotation, $value) { } /** * Retrieve the namespace information for this connection. * * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler. */ public function getNamespace() { } /** Data functionality */ /** * Returns a stamp for the current folder status. This stamp can be used to * identify changes in the folder data. * * @param string $folder Return the stamp for this folder. * * @return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current * folder status. */ public function getStamp($folder) { } /** * Returns the status of the current folder. * * @param string $folder Check the status of this folder. * * @return array An array that contains 'uidvalidity' and 'uidnext'. */ public function status($folder) { } /** * Returns the message ids of the messages in this folder. * * @param string $folder Check the status of this folder. * * @return array The message ids. */ public function getUids($folder) { } /** * Fetches the objects for the specified UIDs. * * @param string $folder The folder to access. * @param array $uids The message UIDs. * @param array $options Additional options. *
     *  - type    - (string) The data type.
     *  - version - (int)    The format version.
     *  - raw     - (bool)   Should the raw data be returned? 
     * 
* * @return array The objects. */ public function fetch($folder, $uids, $options = array()) { } /** * Retrieves the messages for the given message ids. * * @param string $folder The folder to fetch the messages from. * @param array $uids The message UIDs. * * @return array An array of message structures parsed into Horde_Mime_Part * instances. */ public function fetchStructure($folder, $uids) { } /** * Retrieves a bodypart for the given message ID and mime part ID. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * @param array $id The mime part ID. * * @return resource|string The body part, as a stream resource or string. */ public function fetchBodypart($folder, $uid, $id) { $message = Horde_Mime_Part::parseMessage($this->messages[$folder][$uid]); return $message->getPart($id)->getContents(); } /** * Retrieves a complete message. * * @param string $folder The folder to fetch the messages from. * @param array $uid The message UID. * * @return array The message encapsuled as an array that contains a * Horde_Mime_Headers and a Horde_Mime_Part object. */ public function fetchComplete($folder, $uid) { return array( Horde_Mime_Headers::parseHeaders($this->messages[$folder][$uid]), Horde_Mime_Part::parseMessage($this->messages[$folder][$uid]) ); } public function fetchHeaders($folder, $uid) { return Horde_Mime_Headers::parseHeaders($this->messages[$folder][$uid]); } /** * Appends a message to the given folder. * * @param string $folder The folder to append the message(s) to. * @param resource $msg The message to append. * * @return mixed True or the UID of the new message in case the backend * supports UIDPLUS. */ public function appendMessage($folder, $msg) { rewind($msg); $this->messages[$folder][] = stream_get_contents($msg); return count($this->messages[$folder]) - 1; } /** * Deletes messages from the specified folder. * * @param string $folder The folder to delete messages from. * @param integer $uids IMAP message ids. * * @return NULL */ public function deleteMessages($folder, $uids) { } /** * Moves a message to a new folder. * * @param integer $uid IMAP message id. * @param string $old_folder Source folder. * @param string $new_folder Target folder. * * @return NULL */ public function moveMessage($uid, $old_folder, $new_folder) { } /** * Expunges messages in the current folder. * * @param string $folder The folder to expunge. * * @return NULL */ public function expunge($folder) { } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Cache/DataTest.php0000664000175000017500000004073412207101545024304 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the data cache. * * Copyright 2008-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Cache_DataTest extends Horde_Kolab_Storage_TestCase { public function testDataId() { $this->assertEquals('test', $this->getMockDataCache()->getDataId()); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingDataId() { $cache = new Horde_Kolab_Storage_Cache_Data($this->getMockCache()); $cache->getDataId(); } public function testNotInitialized() { $this->assertFalse($this->getMockDataCache()->isInitialized()); } public function testInvalidVersion() { $cache = $this->getMockCache(); $cache->storeData( 'test', serialize(array('S' => time(), 'V' => '0')) ); $this->assertFalse($this->getMockDataCache($cache)->isInitialized()); } public function testMissingSync() { $cache = $this->getMockCache(); $cache->storeData( 'test', serialize( array('V' => Horde_Kolab_Storage_Cache_Data::VERSION) ) ); $this->assertFalse($this->getMockDataCache($cache)->isInitialized()); } public function testGetObjects() { $this->_getSyncedCache()->getObjects(); } public function testGetObjectsEmpty() { $this->assertEquals( array(), $this->_getSyncedCache()->getObjects() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingObjects() { $this->getMockDataCache()->getObjects(); } public function testGetObjectsOne() { $this->assertEquals( array('test' => array('uid' => 'test')), $this->_getSyncedCacheWithData()->getObjects() ); } public function testGetObjectsTwo() { $this->assertEquals( array('test', 'test2'), array_keys($this->_getSyncedCacheWithMoreData()->getObjects()) ); } public function testGetObjectToBackend() { $this->_getSyncedCache()->getObjectToBackend(); } public function testGetObjectToBackendEmpty() { $this->assertEquals( array(), $this->_getSyncedCache()->getObjectToBackend() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingObjectToBackend() { $this->getMockDataCache()->getObjectToBackend(); } public function testGetObjectToBackendOne() { $this->assertEquals( array('test' => '1'), $this->_getSyncedCacheWithData()->getObjectToBackend() ); } public function testGetObjectToBackendTwo() { $this->assertEquals( array('test' => '1', 'test2' => '2'), $this->_getSyncedCacheWithMoreData()->getObjectToBackend() ); } public function testGetBackendToObject() { $this->_getSyncedCache()->getBackendToObject(); } public function testGetBackendToObjectEmpty() { $this->assertEquals( array(), $this->_getSyncedCache()->getBackendToObject() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingBackendToObject() { $this->getMockDataCache()->getBackendToObject(); } public function testGetBackendToObjectOne() { $this->assertEquals( array('1' => 'test'), $this->_getSyncedCacheWithData()->getBackendToObject() ); } public function testGetBackendToObjectTwo() { $this->assertEquals( array('1'=> 'test', '2' => 'test2'), $this->_getSyncedCacheWithMoreData()->getBackendToObject() ); } public function testGetStamp() { $this->_getSyncedCache()->getStamp(); } public function testGetStampEmpty() { $this->assertInternalType( 'string', $this->_getSyncedCache()->getStamp() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingStamp() { $this->getMockDataCache()->getStamp(); } public function testGetStampOne() { $this->assertEquals( 'C:37:"Horde_Kolab_Storage_Folder_Stamp_Uids":30:{a:2:{i:0;s:1:"a";i:1;s:1:"b";}}', $this->_getSyncedCacheWithData()->getStamp() ); } public function testGetStampTwo() { $this->assertEquals( 'C:37:"Horde_Kolab_Storage_Folder_Stamp_Uids":30:{a:2:{i:0;s:1:"c";i:1;s:1:"d";}}', $this->_getSyncedCacheWithMoreData()->getStamp() ); } public function testGetVersion() { $this->_getSyncedCache()->getVersion(); } public function testGetVersionEmpty() { $this->assertInternalType( 'string', $this->_getSyncedCache()->getVersion() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingVersion() { $this->getMockDataCache()->getVersion(); } public function testGetVersionOne() { $this->assertEquals( '1', $this->_getSyncedCacheWithData()->getVersion() ); } public function testGetVersionTwo() { $this->assertEquals( '2', $this->_getSyncedCacheWithMoreData()->getVersion() ); } public function testDuplicates() { $cache = $this->_getSyncedCacheWithMoreData(); $cache->store( array('3' => array('uid' => 'test')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals( array('test' => array(1, 3)), $cache->getDuplicates() ); } public function testErrors() { $cache = $this->_getSyncedCacheWithMoreData(); $cache->store( array('3' => false), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals(array(3), $cache->getErrors()); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testReset() { $cache = $this->_getSyncedCache(); $cache->reset(); $cache->getStamp(); } public function testStoreBackendMapping() { $cache = $this->getMockDataCache(); $cache->store( array('1000' => array('uid' => 'OBJECTID')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals( array('1000' => 'OBJECTID'), $cache->getBackendToObject() ); } public function testStoreObjectMapping() { $cache = $this->getMockDataCache(); $cache->store( array('1000' => array('uid' => 'OBJECTID')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals( array('OBJECTID' => '1000'), $cache->getObjectToBackend() ); } public function testStoreObjects() { $cache = $this->getMockDataCache(); $cache->store( array('1000' => array('uid' => 'OBJECTID')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals( array('OBJECTID' => array('uid' => 'OBJECTID')), $cache->getObjects() ); } public function testIgnoreNoUid() { $cache = $this->getMockDataCache(); $cache->store( array('1000' => array('test' => 'test')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals( array('1000' => false), $cache->getBackendToObject() ); } public function testIgnoreFalse() { $cache = $this->getMockDataCache(); $cache->store( array('1000' => false), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $this->assertEquals( array('1000' => false), $cache->getBackendToObject() ); } public function testLoadSave() { $cache = new Horde_Kolab_Storage_Cache(new Horde_Cache(new Horde_Cache_Storage_Mock())); $data_cache = new Horde_Kolab_Storage_Cache_Data( $cache ); $data_cache->setDataId('test'); $data_cache->store( array('1000' => array('uid' => 'OBJECTID')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $data_cache->save(); $data_cache = new Horde_Kolab_Storage_Cache_Data( $cache ); $data_cache->setDataId('test'); $data_cache->store( array('1001' => false), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'c'), '1' ); $data_cache->save(); $data_cache = new Horde_Kolab_Storage_Cache_Data( $cache ); $data_cache->setDataId('test'); $this->assertEquals( array('OBJECTID' => array('uid' => 'OBJECTID')), $data_cache->getObjects() ); } public function testDeletion() { $this->assertEquals( array(), $this->_getWithDeletion()->getObjects() ); } public function testDeletionInObjectMapping() { $this->assertEquals( array(), $this->_getWithDeletion()->getObjectToBackend() ); } public function testDeletionInBackendMapping() { $this->assertEquals( array('1001' => false), $this->_getWithDeletion()->getBackendToObject() ); } public function testGetMissingAttachment() { $this->assertFalse($this->getMockDataCache()->getAttachment('100', '1')); } public function testGetAttachment() { $resource = fopen('php://temp', 'r+'); $this->horde_cache = $this->getMockCache(); $cache = $this->horde_cache->getDataCache( array( 'host' => 'localhost', 'port' => '143', 'prefix' => 'INBOX', 'folder' => 'test', 'type' => 'event', 'owner' => 'someuser', ) ); $this->horde_cache->storeAttachment( $cache->getDataId(), '100', '1', $resource ); $this->assertSame( $resource, $cache->getAttachment('100', '1') ); } public function testGetStoredAttachment() { $resource = fopen('php://temp', 'r+'); $this->assertSame( $resource, $this->_getSyncedCacheWithAttachment($resource) ->getAttachment('100', '1') ); } public function testDeletedAttachment() { $resource = fopen('php://temp', 'r+'); $cache = $this->_getSyncedCacheWithAttachment($resource); $cache->store( array(), new Horde_Kolab_Storage_Folder_Stamp_Uids('c', 'd'), '2', array('100' => 'test') ); $this->assertFalse( $cache->getAttachment('100', '1') ); } public function testGetAttachmentByName() { $this->assertEquals( array('1', '3'), array_keys( $this->_getSyncedCacheWithAttachment('Y') ->getAttachmentByName('100', 'test.txt') ) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingAttachmentByName() { $this->_getSyncedCacheWithAttachment('Y') ->getAttachmentByName('100', 'dubidu.txt'); } public function testGetAttachmentByType() { $this->assertEquals( array('1', '2', '3'), array_keys( $this->_getSyncedCacheWithAttachment('Y') ->getAttachmentByType('100', 'application/x-vnd.kolab.event') ) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingAttachmentType() { $this->_getSyncedCacheWithAttachment('Y') ->getAttachmentByType('100', 'application/x-vnd.kolab.contact'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingAttachmentByType() { $this->_getSyncedCacheWithAttachment('Y') ->getAttachmentByType('200', 'application/x-vnd.kolab.event'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingQuery() { $this->getMockDataCache()->getQuery('x'); } public function testHasQuery() { $cache = $this->getMockDataCache(); $cache->setQuery('x', 'something'); $this->assertTrue($cache->hasQuery('x')); } public function testGetSetQuery() { $cache = $this->getMockDataCache(); $cache->setQuery('x', 'something'); $this->assertEquals('something', $cache->getQuery('x')); } private function _getSyncedCache() { $cache = $this->getMockDataCache(); $cache->store( array(), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); return $cache; } private function _getSyncedCacheWithData() { $cache = $this->getMockDataCache(); $cache->store( array('1' => array('uid' => 'test')), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); return $cache; } private function _getSyncedCacheWithMoreData() { $cache = $this->getMockDataCache(); $cache->store( array( '1' => array('uid' => 'test'), '2' => array('uid' => 'test2') ), new Horde_Kolab_Storage_Folder_Stamp_Uids('c', 'd'), '2' ); return $cache; } private function _getSyncedCacheWithAttachment($resource) { $cache = $this->getMockDataCache(); $cache->store( array( '100' => array( 'uid' => 'test', '_attachments' => array( '1' => array( 'name' => 'test.txt', 'type' => 'application/x-vnd.kolab.event', 'content' => $resource ), '2' => array( 'type' => 'application/x-vnd.kolab.event', 'content' => $resource ), '3' => array( 'name' => 'test.txt', 'type' => 'application/x-vnd.kolab.event', 'content' => $resource ), '4' => array( 'content' => $resource ) ) ), ), new Horde_Kolab_Storage_Folder_Stamp_Uids('c', 'd'), '2' ); return $cache; } private function _getWithDeletion() { $cache = $this->getMockDataCache(); $cache->store( array('1000' => array('uid' => 'OBJECTID'), '1001' => false), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1' ); $cache->store( array(), new Horde_Kolab_Storage_Folder_Stamp_Uids('a', 'b'), '1', array('1000' => 'OBJECTID') ); return $cache; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Data/Decorator/LogTest.php0000664000175000017500000000224612207101545025740 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the data log decorator. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Data_Decorator_LogTest extends Horde_Kolab_Storage_TestCase { public function testDelete() { $list = new Horde_Kolab_Storage_Data_Decorator_Log( $this->getMock('Horde_Kolab_Storage_Data'), $this->getMockLogger() ); $list->delete('x'); $this->assertLogCount(2); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Data/Query/History/BaseTest.php0000664000175000017500000001127412207101545026716 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of the history data query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Data_Query_History_BaseTest extends Horde_Kolab_Storage_TestCase { public function testSynchronize() { $this->_getDataQuery(); $this->assertEquals( 1, count( $this->history->getHistory( '20080626155721.771268tms63o0rs4@devmail.example.com' ) ) ); } public function testAdded() { $this->_getDataQuery(); $this->assertEquals( array( '20080626155721.771268tms63o0rs4@devmail.example.com' => 1, '20090731103253.11391snjudt9zgpw@webmail.example.com' => 2 ), $this->history->getByTimestamp( '>', time() - 10, array( array( 'field' => 'action', 'op' => '=', 'value' => 'add' ) ) ) ); } public function testSingleAdd() { $this->_getDataQuery()->synchronize(); $this->assertEquals( array( '20080626155721.771268tms63o0rs4@devmail.example.com' => 1, '20090731103253.11391snjudt9zgpw@webmail.example.com' => 2 ), $this->history->getByTimestamp( '>', time() - 10, array( array( 'field' => 'action', 'op' => '=', 'value' => 'add' ) ) ) ); } public function testModify() { $data = $this->_getData(); $o = $data->getObject('20090731103253.11391snjudt9zgpw@webmail.example.com'); $data->modify($o); $this->assertEquals( array( '20090731103253.11391snjudt9zgpw@webmail.example.com' => 3 ), $this->history->getByTimestamp( '>', time() - 10, array( array( 'field' => 'action', 'op' => '=', 'value' => 'modify' ) ) ) ); } public function testDelete() { $data = $this->_getData(); $data->delete('20090731103253.11391snjudt9zgpw@webmail.example.com'); $this->assertEquals( array( '20090731103253.11391snjudt9zgpw@webmail.example.com' => 3 ), $this->history->getByTimestamp( '>', time() - 10, array( array( 'field' => 'action', 'op' => '=', 'value' => 'delete' ) ) ) ); } private function _getData() { return $this->_getFolder()->getData('INBOX/History'); } private function _getDataQuery() { return $this->_getData() ->getQuery(Horde_Kolab_Storage_Data::QUERY_HISTORY); } private function _getFolder() { $this->history = new Horde_History_Mock('test'); return $this->getDataStorage( $this->getDataAccount( array( 'user/test/History' => array( 't' => 'h-prefs.default', 'm' => array( 1 => array('file' => __DIR__ . '/../../../../fixtures/preferences.1'), 2 => array('file' => __DIR__ . '/../../../../fixtures/preferences.2'), ), ) ) ), array( 'queryset' => array('data' => array('queryset' => 'horde')), 'history' => $this->history ) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Data/Query/Preferences/BaseTest.php0000664000175000017500000000410412207101545027510 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of the preference data query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Data_Query_Preferences_BaseTest extends Horde_Kolab_Storage_TestCase { public function testHordeApplication() { $prefs = $this->_getDataQuery()->getApplicationPreferences('horde'); $this->assertEquals( '20080626155721.771268tms63o0rs4@devmail.example.com', $prefs['uid'] ); } private function _getData() { return $this->_getPreferences()->getData('INBOX/Preferences'); } private function _getDataQuery() { return $this->_getData() ->getQuery(Horde_Kolab_Storage_Data::QUERY_PREFS); } private function _getPreferences() { return $this->getDataStorage( $this->getDataAccount( array( 'user/test/Preferences' => array( 't' => 'h-prefs.default', 'm' => array( 1 => array('file' => __DIR__ . '/../../../../fixtures/preferences.1'), 2 => array('file' => __DIR__ . '/../../../../fixtures/preferences.2'), ), ) ) ), array( 'queryset' => array('data' => array('queryset' => 'horde')), ) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Data/Query/Preferences/CacheTest.php0000664000175000017500000000613212207101545027644 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of the cached preference data query. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Data_Query_Preferences_CacheTest extends Horde_Kolab_Storage_TestCase { public function testNumberOfObjects() { $storage = $this->_getPreferences(); $data = $storage->getData('INBOX/Preferences'); $data->synchronize(); $this->assertEquals(2, count($data->getObjects())); } public function testHordeApplication() { $prefs = $this->_getDataQuery()->getApplicationPreferences('horde'); $this->assertEquals( '20080626155721.771268tms63o0rs4@devmail.example.com', $prefs['uid'] ); } public function testCaching() { $data = $this->_getData(); $query = $this->_getQuery($data); $prefs = $query->getApplicationPreferences('horde'); $this->assertEquals( '20080626155721.771268tms63o0rs4@devmail.example.com', $prefs['uid'] ); } private function _getData() { return $this->_getPreferences()->getData('INBOX/Preferences'); } private function _getDataQuery() { return $this->_getData() ->getQuery(Horde_Kolab_Storage_Data::QUERY_PREFS); } private function _getQuery($data) { $cache = new Horde_Kolab_Storage_Cache($this->_cache); $data_cache = $cache->getDataCache($data->getIdParameters()); $params = array('cache' => $data_cache); return new Horde_Kolab_Storage_Data_Query_Preferences_Cache( $data, $params ); } private function _getPreferences() { $this->_cache = new Horde_Cache(new Horde_Cache_Storage_Mock()); return $this->getDataStorage( $this->getDataAccount( array( 'user/test/Preferences' => array( 't' => 'h-prefs.default', 'm' => array( 1 => array('file' => __DIR__ . '/../../../../fixtures/preferences.1'), 2 => array('file' => __DIR__ . '/../../../../fixtures/preferences.2'), ), ) ) ), array( 'cache' => $this->_cache, 'queryset' => array('data' => array('queryset' => 'horde')), ) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Data/BaseTest.php0000664000175000017500000003060612207101545024150 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the basic data handler. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Data_BaseTest extends Horde_Kolab_Storage_TestCase { public function testBrokenObject() { $objects = $this->_getBrokenStore()->fetch(array('1')); $this->assertEquals(array(1 => ''), $objects[1]->getParseErrors()); } public function testErrors() { $this->assertEquals( array(1), array_keys($this->_getBrokenStore()->getErrors()) ); } public function testDefaultType() { $this->assertEquals( 'event', $this->getMessageStorage() ->getData('INBOX/Calendar') ->getType() ); } public function testOverriddenType() { $this->assertEquals( 'other', $this->getMessageStorage() ->getData('INBOX/Calendar', 'other') ->getType() ); } public function testId() { $this->assertEquals( '2758ded05e635994e5dbeba82185feb2', $this->getMessageStorage() ->getData('INBOX/WithDeleted') ->getId() ); } public function testStamp() { $this->assertEquals( 'C:37:"Horde_Kolab_Storage_Folder_Stamp_Uids":86:{a:2:{i:0;a:2:{s:11:"uidvalidity";s:8:"12346789";s:7:"uidnext";i:5;}i:1;a:1:{i:0;i:4;}}}', serialize( $this->getMessageStorage() ->getData('INBOX/WithDeleted') ->getStamp() ) ); } public function testFetchPart() { $part = stream_get_contents( $this->getMessageStorage() ->getData('INBOX/Calendar') ->fetchPart(1, '2') ); $this->assertContains('getMessageStorage() ->getData('INBOX/Calendar') ->fetch(array(1, 2, 4)); $this->assertEquals('libkcal-543769073.130', $objects[4]['uid']); } public function testDataQueriable() { $data = $this->getMessageStorage() ->getData('INBOX/Calendar'); $this->assertTrue($data instanceOf Horde_Kolab_Storage_Queriable); } public function testQuerySynchronization() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getMessageStorage() ->getData('INBOX/Calendar'); $query = new Horde_Kolab_Storage_Stub_DataQuery( $data, array('factory' => $factory) ); $data->registerQuery('stub', $query); $data->synchronize(); $this->assertTrue($query->synchronized); } public function testGetQuery() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getMessageStorage() ->getData('INBOX/Calendar'); $query = new Horde_Kolab_Storage_Stub_DataQuery( $data, array('factory' => $factory) ); $data->registerQuery('Horde_Kolab_Storage_Stub_DataQuery', $query); $this->assertInstanceOf( 'Horde_Kolab_Storage_Stub_DataQuery', $data->getQuery('Horde_Kolab_Storage_Stub_DataQuery') ); } public function testGetBaseQuery() { $factory = new Horde_Kolab_Storage_Factory(); $data = $this->getMessageStorage() ->getData('INBOX/Calendar'); $query = new Horde_Kolab_Storage_Stub_DataQuery( $data, array('factory' => $factory) ); $data->registerQuery( Horde_Kolab_Storage_Data::QUERY_PREFS, $query ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Stub_DataQuery', $data->getQuery(Horde_Kolab_Storage_Data::QUERY_PREFS) ); } public function testGetObjects() { $this->assertInternalType( 'array', $this->getMessageStorage() ->getData('INBOX/Calendar') ->getObjects() ); } public function testObjects() { $objects = $this->getMessageStorage() ->getData('INBOX/Calendar') ->getObjects(); $this->assertEquals( 'libkcal-543769073.130', $objects['libkcal-543769073.130']['uid'] ); } public function testGetObjectIds() { $this->assertInternalType( 'array', $this->getMessageStorage()->getData('INBOX/Calendar')->getObjectIds() ); } public function testObjectIds() { $this->assertEquals( array( 'libkcal-543769073.132', 'libkcal-543769073.131', 'libkcal-543769073.130' ), $this->getMessageStorage()->getData('INBOX/Calendar')->getObjectIds() ); } public function testBackendId() { $this->assertEquals( '1', $this->getMessageStorage() ->getData('INBOX/Calendar') ->getBackendId('libkcal-543769073.132') ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingBackendId() { $this->getMessageStorage() ->getData('INBOX/Calendar') ->getBackendId('NOSUCHOBJECT'); } public function testExists() { $this->assertTrue( $this->getMessageStorage() ->getData('INBOX/Calendar') ->objectIdExists('libkcal-543769073.130') ); } public function testDoesNotExist() { $this->assertFalse( $this->getMessageStorage() ->getData('INBOX/Calendar') ->objectIdExists('NOSUCHOBJECT') ); } public function testGetObject() { $object = $this->getMessageStorage() ->getData('INBOX/Calendar') ->getObject('libkcal-543769073.132'); $this->assertEquals( 'libkcal-543769073.132', $object['uid'] ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingObject() { $object = $this->getMessageStorage() ->getData('INBOX/Calendar') ->getObject('NOSUCHOBJECT'); } public function testCreateReturnsString() { $object = array('summary' => 'test'); $this->assertEquals( 1, $this->getMessageStorage() ->getData('INBOX/Notes') ->create($object) ); } public function testFetchRaw() { $objects = $this->getMessageStorage() ->getData('INBOX/Calendar') ->fetch(array(1, 2, 4), true); $part = $objects[4]->getContent(); rewind($part); $this->assertContains('libkcal-543769073.130', stream_get_contents($part)); } public function testCreateRaw() { $this->markTestIncomplete('Split of the raw function'); $test = fopen('php://temp', 'r+'); $object = array('content' => $test); fputs($test, 'test'); rewind($test); $this->assertEquals( 1, $this->getMessageStorage() ->getData('INBOX/Notes') ->create($object, true) ); } public function testListAddedObjects() { $data = $this->getMessageStorage()->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $data->create($object); $this->assertEquals( array('UID'), $data->getObjectIds() ); } public function testDeleteObject() { $data = $this->getMessageStorage()->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $data->create($object); $data->delete('UID'); $this->assertEquals( array(), $data->getObjectIds() ); } public function testDeleteAll() { $data = $this->getMessageStorage()->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID1'); $data->create($object); $object = array('summary' => 'test', 'uid' => 'UID2'); $data->create($object); $data->deleteAll(); $this->assertEquals( array(), $data->getObjectIds() ); } public function testMoveObject() { $store = $this->getMessageStorage(); $data = $store->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $data->create($object); $data->move('UID', 'INBOX/OtherNotes'); $other = $store->getData('INBOX/OtherNotes'); $this->assertEquals( array(), $data->getObjectIds() ); $this->assertEquals( array('UID'), $other->getObjectIds() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testModifyWithoutUid() { $store = $this->getMessageStorage(); $data = $store->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $data->create($object); $data->modify(array('summary' => 'test')); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testModifyWithIncorrectUid() { $store = $this->getMessageStorage(); $data = $store->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $data->create($object); $data->modify(array('summary' => 'test', 'uid' => 'NOSUCHUID')); } public function testModify() { $store = $this->getMessageStorage(); $data = $store->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $obid = $data->create($object); $storage_objects = $data->fetch(array($obid)); $storage_objects[$obid]->setData(array('summary' => 'modified', 'uid' => 'UID')); $data->modify($storage_objects[$obid]); $object = $data->getObject('UID'); $this->assertEquals('modified', $object['summary']); } public function testDuplicatesAddedObjects() { $data = $this->getMessageStorage()->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $data->create($object); $data->create($object); $this->assertEquals( array('UID' => array(1, 2)), $data->getDuplicates() ); } private function _getBrokenStore($params = array()) { $default_params = array( 'cache' => new Horde_Cache(new Horde_Cache_Storage_Mock()), 'driver' => 'mock', 'params' => array( 'username' => 'test', 'host' => 'localhost', 'port' => 143, 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/Notes' => array( 't' => 'note.default', 'm' => array( 1 => array( 'stream' => fopen( __DIR__ . '/../../fixtures/broken_note.eml', 'r' ) ) ) ) ) ) ) ); $params = array_merge($default_params, $params); $factory = new Horde_Kolab_Storage_Factory($params); $driver = $factory->createDriver(); $storage = $this->createStorage($driver, $factory); return $storage->getData('INBOX/Notes'); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Data/CachedTest.php0000664000175000017500000001212612207101545024442 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the cached data handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Data_CachedTest extends Horde_Kolab_Storage_TestCase { public function testDefaultType() { $this->assertEquals( 'event', $this->_getDataCache() ->getType() ); } public function testStamp() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Stamp', $this->_getDataCache()->getStamp() ); } public function testFetchPart() { $part = stream_get_contents( $this->_getDataCache() ->fetchPart(1, '2') ); $this->assertContains('getMockDataCache()->getObjects(); } public function testSynchronize() { $this->_getDataCache()->synchronize(); } public function testFetch() { $objects = $this->_getDataCache() ->fetch(array(1, 2, 4)); $this->assertEquals('libkcal-543769073.130', $objects[4]['uid']); } public function testDataQueriable() { $data = $this->_getDataCache(); $this->assertTrue($data instanceOf Horde_Kolab_Storage_Queriable); } public function testGetObjects() { $this->assertInternalType( 'array', $this->_getDataCache() ->getObjects() ); } public function testObjects() { $objects = $this->_getDataCache() ->getObjects(); $this->assertEquals( 'libkcal-543769073.130', $objects['libkcal-543769073.130']['uid'] ); } public function testGetObjectIds() { $this->assertInternalType( 'array', $this->_getDataCache()->getObjectIds() ); } public function testObjectIds() { $this->assertEquals( array( 'libkcal-543769073.132', 'libkcal-543769073.131', 'libkcal-543769073.130' ), $this->_getDataCache()->getObjectIds() ); } public function testBackendId() { $this->assertEquals( '1', $this->_getDataCache() ->getBackendId('libkcal-543769073.132') ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingBackendId() { $this->_getDataCache() ->getBackendId('NOSUCHOBJECT'); } public function testExists() { $this->assertTrue( $this->_getDataCache() ->objectIdExists('libkcal-543769073.132') ); } public function testDoesNotExist() { $this->assertFalse( $this->_getDataCache() ->objectIdExists('NOSUCHOBJECT') ); } public function testGetObject() { $object = $this->_getDataCache() ->getObject('libkcal-543769073.130'); $this->assertEquals( 'libkcal-543769073.130', $object['uid'] ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMissingObject() { $object = $this->_getDataCache() ->getObject('NOSUCHOBJECT'); } public function testModify() { $store = $this->getMessageStorage( array( 'cache' => new Horde_Cache(new Horde_Cache_Storage_Mock()) ) ); $data = $store->getData('INBOX/Notes'); $object = array('summary' => 'test', 'uid' => 'UID'); $obid = $data->create($object); $storage_objects = $data->fetch(array($obid)); $storage_objects[$obid]->setData(array('summary' => 'modified', 'uid' => 'UID')); $data->modify($storage_objects[$obid]); $object = $data->getObject('UID'); $this->assertEquals('modified', $object['summary']); } private function _getDataCache() { $this->storage = $this->getMessageStorage( array( 'cache' => new Horde_Cache(new Horde_Cache_Storage_Mock()) ) ); $cache = $this->storage->getData('INBOX/Calendar'); $cache->synchronize(); return $cache; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Decorator/LogTest.php0000664000175000017500000000241012207101545025060 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the log decorator for the storage handler. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Decorator_LogTest extends Horde_Kolab_Storage_TestCase { public function testDecoratedList() { $storage = new Horde_Kolab_Storage_Decorator_Log( $this->createStorage($this->getNullMock()), $this->getMockLogger() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Tools', $storage->getList() ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Decorator/SynchronizationTest.php0000664000175000017500000000250212207101545027542 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the synchronization decorator for the storage handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Decorator_SynchronizationTest extends Horde_Kolab_Storage_TestCase { public function testList() { $storage = new Horde_Kolab_Storage_Decorator_Synchronization( $this->createStorage($this->getNullMock()), new Horde_Kolab_Storage_Synchronization() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Tools', $storage->getList() ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Driver/Decorator/LogTest.php0000664000175000017500000001546312207101545026327 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the log decorator for the backend drivers. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Driver_Decorator_LogTest extends Horde_Kolab_Storage_TestCase { public function testGetMailboxesLogsEntry() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $this->getNullMock(), $this->getMockLogger() ); $driver->listFolders(); $this->assertLogCount(2); } public function testGetMailboxesFolderCount() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $this->getTwoFolderMock(), $this->getMockLogger() ); $driver->listFolders(); $this->assertLogContains('Driver "Horde_Kolab_Storage_Driver_Mock": List contained 2 folders.'); } public function testListAnnotationLogsEntry() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $this->getNullMock(), $this->getMockLogger() ); $driver->listAnnotation('/shared/vendor/kolab/folder-type'); $this->assertLogCount(2); } public function testListAnnotationFolderCount() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $this->getAnnotatedMock(), $this->getMockLogger() ); $driver->listAnnotation('/shared/vendor/kolab/folder-type'); $this->assertLogContains('Driver "Horde_Kolab_Storage_Driver_Mock": List contained 4 folder annotations.'); } public function testGetNamespaceLogsEntry() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $this->getNullMock(), $this->getMockLogger() ); $driver->getNamespace(); $this->assertLogCount(2); } public function testGetNamespaceType() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Log( $this->getNullMock(), $this->getMockLogger() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace', $driver->getNamespace() ); } public function testCreateFolderLog() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->exactly(2)) ->method('debug') ->with( $this->logicalOr( 'Driver "' . get_class($driver) . '": Creating folder INBOX/Test.', 'Driver "' . get_class($driver) . '": Successfully created folder INBOX/Test.' ) ); $log = new Horde_Kolab_Storage_Driver_Decorator_Log($driver, $logger); $log->create('INBOX/Test'); } public function testDeleteFolderLog() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->exactly(2)) ->method('debug') ->with( $this->logicalOr( 'Driver "' . get_class($driver) . '": Deleting folder INBOX/Test.', 'Driver "' . get_class($driver) . '": Successfully deleted folder INBOX/Test.' ) ); $log = new Horde_Kolab_Storage_Driver_Decorator_Log($driver, $logger); $log->delete('INBOX/Test'); } public function testRenameFolderLog() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->exactly(2)) ->method('debug') ->with( $this->logicalOr( 'Driver "' . get_class($driver) . '": Renaming folder INBOX/Foo.', 'Driver "' . get_class($driver) . '": Successfully renamed folder INBOX/Foo to INBOX/Bar.' ) ); $log = new Horde_Kolab_Storage_Driver_Decorator_Log($driver, $logger); $log->rename('INBOX/Foo', 'INBOX/Bar'); } public function testCreateFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('create') ->with('INBOX/Test'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $log = new Horde_Kolab_Storage_Driver_Decorator_Log($driver, $logger); $log->create('INBOX/Test'); } public function testDeleteFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('delete') ->with('INBOX/Test'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $log = new Horde_Kolab_Storage_Driver_Decorator_Log($driver, $logger); $log->delete('INBOX/Test'); } public function testRenameFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('rename') ->with('INBOX/Test', 'FOO'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $log = new Horde_Kolab_Storage_Driver_Decorator_Log($driver, $logger); $log->rename('INBOX/Test', 'FOO'); } public function testSetAclLogsEntry() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('setAcl') ->with('a', 'b', 'c'); $logger = new Horde_Kolab_Storage_Driver_Decorator_Log( $driver, $this->getMockLogger() ); $logger->setAcl('a', 'b', 'c'); $this->assertLogCount(2); } public function testDeleteAclLogsEntry() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('deleteAcl') ->with('a', 'b'); $logger = new Horde_Kolab_Storage_Driver_Decorator_Log( $driver, $this->getMockLogger() ); $logger->deleteAcl('a', 'b'); $this->assertLogCount(2); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Driver/Decorator/TimerTest.php0000664000175000017500000001134212207101545026656 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the stop watch decorator for the backend drivers. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Driver_Decorator_TimerTest extends Horde_Kolab_Storage_TestCase { public function setUp() { parent::setUp(); if (!class_exists('Horde_Support_Timer')) { $this->markTestSkipped('The "Horde_Support" package seems to be missing!'); } } public function testGetMailboxesLogsEntry() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $this->getNullMock(), new Horde_Support_Timer(), $this->getMockLogger() ); $driver->listFolders(); $this->assertLogCount(1); } public function testGetMailboxesFolderCount() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $this->getTwoFolderMock(), new Horde_Support_Timer(), $this->getMockLogger() ); $driver->listFolders(); $this->assertLogRegExp('/REQUEST OUT IMAP:.*listFolders.*/'); } public function testListAnnotationLogsEntry() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $this->getNullMock(), new Horde_Support_Timer(), $this->getMockLogger() ); $driver->listAnnotation('/shared/vendor/kolab/folder-type'); $this->assertLogCount(1); } public function testListAnnotationFolderCount() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $this->getTwoFolderMock(), new Horde_Support_Timer(), $this->getMockLogger() ); $driver->listAnnotation('/shared/vendor/kolab/folder-type'); $this->assertLogRegExp('/REQUEST OUT IMAP:.*listAnnotation.*/'); } public function testGetNamespaceLogsEntry() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $this->getTwoFolderMock(), new Horde_Support_Timer(), $this->getMockLogger() ); $driver->getNamespace(); $this->assertLogRegExp('/REQUEST OUT IMAP:.*getNamespace.*/'); } public function testGetNamespaceType() { $driver = new Horde_Kolab_Storage_Driver_Decorator_Timer( $this->getTwoFolderMock(), new Horde_Support_Timer(), $this->getMockLogger() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace', $driver->getNamespace() ); } public function testCreateLogsEntry() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('create') ->with('a'); $logger = new Horde_Kolab_Storage_Driver_Decorator_Timer( $driver, new Horde_Support_Timer(), $this->getMockLogger() ); $logger->create('a'); $this->assertLogRegexp('/REQUEST OUT IMAP:.*createFolder.*/'); } public function testSetAclLogsEntry() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('setAcl') ->with('a', 'b', 'c'); $logger = new Horde_Kolab_Storage_Driver_Decorator_Timer( $driver, new Horde_Support_Timer(), $this->getMockLogger() ); $logger->setAcl('a', 'b', 'c'); $this->assertLogRegexp('/REQUEST OUT IMAP:.*setAcl.*/'); } public function testDeleteAclLogsEntry() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('deleteAcl') ->with('a', 'b'); $logger = new Horde_Kolab_Storage_Driver_Decorator_Timer( $driver, new Horde_Support_Timer(), $this->getMockLogger() ); $logger->deleteAcl('a', 'b'); $this->assertLogRegexp('/REQUEST OUT IMAP:.*deleteAcl.*/'); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Driver/CclientTest.php0000664000175000017500000000456612207101545025247 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the Kolab mock driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Driver_CclientTest extends PHPUnit_Framework_TestCase { public function setUp() { parent::setUp(); if (!function_exists('imap_open')) { $this->markTestSkipped('Missing PHP IMAP extension.'); } } public function testGetNamespaceReturnsNamespaceHandler() { $driver = new Horde_Kolab_Storage_Driver_Cclient( new Horde_Kolab_Storage_Factory(), array() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace', $driver->getNamespace() ); } public function testGetNamespaceReturnsExpectedNamespaces() { $driver = new Horde_Kolab_Storage_Driver_Cclient( new Horde_Kolab_Storage_Factory(), array('username' => 'test') ); $namespaces = array(); foreach ($driver->getNamespace() as $namespace) { $namespaces[$namespace->getName()] = array( 'type' => $namespace->getType(), 'delimiter' => $namespace->getDelimiter(), ); } $this->assertEquals( array( 'INBOX' => array( 'type' => 'personal', 'delimiter' => '/', ), 'user' => array( 'type' => 'other', 'delimiter' => '/', ), '' => array( 'type' => 'shared', 'delimiter' => '/', ), ), $namespaces ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Driver/ImapTest.php0000664000175000017500000000656712207101545024557 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the Kolab mock driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Driver_ImapTest extends PHPUnit_Framework_TestCase { public function testGetNamespaceReturnsNamespaceHandler() { $driver = new Horde_Kolab_Storage_Driver_Imap( new Horde_Kolab_Storage_Factory(), array('backend' => $this->_getNamespaceMock()) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace', $driver->getNamespace() ); } public function testGetNamespaceReturnsExpectedNamespaces() { $driver = new Horde_Kolab_Storage_Driver_Imap( new Horde_Kolab_Storage_Factory(), array('backend' => $this->_getNamespaceMock()) ); $namespaces = array(); foreach ($driver->getNamespace() as $namespace) { $namespaces[$namespace->getName()] = array( 'type' => $namespace->getType(), 'delimiter' => $namespace->getDelimiter(), ); } $this->assertEquals( array( 'INBOX' => array( 'type' => 'personal', 'delimiter' => '/', ), 'user' => array( 'type' => 'other', 'delimiter' => '/', ), '' => array( 'type' => 'shared', 'delimiter' => '/', ), ), $namespaces ); } private function _getNamespaceMock() { $imap = $this->getMock('Horde_Imap_Client_Socket', array(), array(), '', false, false); $imap->expects($this->once()) ->method('queryCapability') ->with('NAMESPACE') ->will($this->returnValue(true)); $imap->expects($this->once()) ->method('getNamespaces') ->will( $this->returnValue( array( array( 'type' => 'personal', 'name' => 'INBOX', 'delimiter' => '/', ), array( 'type' => 'other', 'name' => 'user', 'delimiter' => '/', ), array( 'type' => 'shared', 'name' => '', 'delimiter' => '/', ), ) ) ); return $imap; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Driver/MockTest.php0000664000175000017500000003613212207101545024551 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the Kolab mock driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Driver_MockTest extends Horde_Kolab_Storage_TestCase { public function testGetMailboxesReturnsArray() { $this->assertInternalType('array', $this->getNullMock()->listFolders()); } public function testGetMailboxesEmpty() { $this->assertEquals(array(), $this->getEmptyMock()->listFolders()); } public function testGetMailboxesReturnsMailboxes() { $this->assertEquals( array('INBOX', 'INBOX/a'), $this->getTwoFolderMock()->listFolders() ); } public function testPersonalFolder() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $this->assertEquals( 'lrswipkxtecda', $mock->getMyAcl('INBOX/Test') ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetAclFailsOnMissing() { $this->getNullMock()->getAcl('INBOX/test'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetAclOnHidden() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', $mock->getAuth(), ''); $mock->getAcl('INBOX/Test'); } public function testGetAclOnNoAdmin() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', $mock->getAuth(), 'lr'); try { $mock->getAcl('INBOX/Test'); } catch (Horde_Kolab_Storage_Exception $e) { $this->assertEquals('Permission denied!', $e->getMessage()); } } public function testGetAclWithAnyone() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anyone', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $this->assertEquals(array('anyone' => 'a'), $mock->getAcl('INBOX/Test')); } public function testGetAclWithAnonymous() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anonymous', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $this->assertEquals(array('anonymous' => 'a'), $mock->getAcl('INBOX/Test')); } public function testGetAclWithGroup() { $mock = $this->getNullMock(); $mock->setGroups(array($mock->getAuth() => array('group'))); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'group:group', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $this->assertEquals(array('group:group' => 'a'), $mock->getAcl('INBOX/Test')); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMyAclFailsOnMissing() { $this->getNullMock()->getMyAcl('INBOX/test'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testGetMyAclOnHidden() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->getMyAcl('INBOX/Test'); } public function testGetMyAclWithAnyone() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anyone', 'l'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $this->assertEquals('l', $mock->getMyAcl('INBOX/Test')); } public function testGetMyAclWithAnonymous() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anonymous', 'l'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $this->assertEquals('l', $mock->getMyAcl('INBOX/Test')); } public function testGetMyAclWithGroup() { $mock = $this->getNullMock(); $mock->setGroups(array($mock->getAuth() => array('group'))); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'group:group', 'l'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $this->assertEquals('l', $mock->getMyAcl('INBOX/Test')); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testSetAclFailsOnMissing() { $this->getNullMock()->setAcl('INBOX/test', 'a', 'b'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testSetAclOnHidden() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->setAcl('INBOX/Test', 'a', 'b'); } public function testSetAclOnNoAdmin() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', $mock->getAuth(), 'lr'); try { $mock->setAcl('INBOX/Test', 'a', 'b'); } catch (Horde_Kolab_Storage_Exception $e) { $this->assertEquals('Permission denied!', $e->getMessage()); } } public function testSetAclWithAnyone() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anyone', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->setAcl('INBOX/Test', 'a', 'b'); } public function testSetAclWithAnonymous() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anonymous', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->setAcl('INBOX/Test', 'a', 'b'); } public function testSetAclWithGroup() { $mock = $this->getNullMock(); $mock->setGroups(array($mock->getAuth() => array('group'))); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'group:group', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->setAcl('INBOX/Test', 'a', 'b'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDeleteAclFailsOnMissing() { $this->getNullMock()->deleteAcl('INBOX/test', 'a'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDeleteAclOnHidden() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', $mock->getAuth(), ''); $mock->deleteAcl('INBOX/Test', 'a'); } public function testDeleteAclOnNoAdmin() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', $mock->getAuth(), 'lr'); try { $mock->deleteAcl('INBOX/Test', 'a'); } catch (Horde_Kolab_Storage_Exception $e) { $this->assertEquals('Permission denied!', $e->getMessage()); } } public function testDeleteAclWithAnyone() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anyone', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->deleteAcl('INBOX/Test', 'anyone'); } public function testDeleteAclWithAnonymous() { $mock = $this->getNullMock(); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'anonymous', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->deleteAcl('INBOX/Test', 'anonymous'); } public function testDeleteAclWithGroup() { $mock = $this->getNullMock(); $mock->setGroups(array($mock->getAuth() => array('group'))); $mock->create('INBOX/Test'); $mock->setAcl('INBOX/Test', 'group:group', 'a'); $mock->deleteAcl('INBOX/Test', $mock->getAuth()); $mock->deleteAcl('INBOX/Test', 'group:group'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testSetAnnotationFailsOnMissing() { $this->getNullMock()->setAnnotation('INBOX/test', 'a', 'b'); } public function testListAnnotationReturnsArray() { $this->assertInternalType( 'array', $this->getNullMock()->listAnnotation( '/shared/vendor/kolab/folder-type' ) ); } public function testListAnnotationSize() { $this->assertEquals( 4, count( $this->getAnnotatedMock()->listAnnotation( '/shared/vendor/kolab/folder-type' ) ) ); } public function testListAnnotationKeys() { $this->assertEquals( array('INBOX/Calendar', 'INBOX/Contacts', 'INBOX/Notes', 'INBOX/Tasks'), array_keys( $this->getAnnotatedMock()->listAnnotation( '/shared/vendor/kolab/folder-type' ) ) ); } public function testListAnnotationGermanKeys() { $this->assertEquals( array('INBOX/Kalender', 'INBOX/Kontakte', 'INBOX/Notizen', 'INBOX/Aufgaben'), array_keys( $this->getGermanAnnotatedMock()->listAnnotation( '/shared/vendor/kolab/folder-type' ) ) ); } public function testGetAnnotationReturnsAnnotationValue() { $data = array( 'username' => 'test', 'data' => array( 'user/test/Contacts' => array( 'annotations' => array( '/shared/vendor/kolab/folder-type' => 'contact.default', ), 'permissions' => array('anyone' => 'lrid'), ), ), ); $driver = new Horde_Kolab_Storage_Driver_Mock( new Horde_Kolab_Storage_Factory(), $data ); $this->assertEquals( 'contact.default', $driver->getAnnotation('INBOX/Contacts', '/shared/vendor/kolab/folder-type') ); } public function testNullAuth() { $data = array( 'username' => '', 'data' => array( 'user/test/Contacts' => array( 'permissions' => array('test' => 'lrid'), ), 'user/a' => array( 'permissions' => array('anyone' => 'lrid'), ), 'shared.Something' => array( 'permissions' => array('anyone' => 'lrid'), ), ), ); $driver = new Horde_Kolab_Storage_Driver_Mock( new Horde_Kolab_Storage_Factory(), $data ); $this->assertEquals( array('user/test/Contacts', 'user/a', 'shared.Something'), $driver->listFolders() ); } public function testGetNamespaceReturnsNamespaceHandler() { $driver = new Horde_Kolab_Storage_Driver_Mock( new Horde_Kolab_Storage_Factory(), array() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace', $driver->getNamespace() ); } public function testGetNamespaceReturnsExpectedNamespaces() { $driver = new Horde_Kolab_Storage_Driver_Mock( new Horde_Kolab_Storage_Factory(), array('username' => 'test') ); $namespaces = array(); foreach ($driver->getNamespace() as $namespace) { $namespaces[$namespace->getName()] = array( 'type' => $namespace->getType(), 'delimiter' => $namespace->getDelimiter(), ); } $this->assertEquals( array( 'INBOX' => array( 'type' => 'personal', 'delimiter' => '/', ), 'user' => array( 'type' => 'other', 'delimiter' => '/', ), '' => array( 'type' => 'shared', 'delimiter' => '/', ), ), $namespaces ); } public function testGetIdReturnsString() { $this->assertInternalType('string', $this->getNullMock()->getId()); } public function testSelect() { $mock = $this->getMessageMock(); $mock->select('INBOX/Test'); } public function testSelected() { $mock = $this->getMessageMock(); $mock->select('INBOX/Test'); $status = $mock->status('INBOX/Test'); $this->assertEquals(1, $status['uidnext']); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissing() { $mock = $this->getNullMock(); $mock->select('INBOX/Test'); } public function testSelectUmlaut() { $mock = $this->getMessageMock(); $mock->select('INBOX/ÄÖÜ'); $status = $mock->status('INBOX/ÄÖÜ'); $this->assertEquals(1, $status['uidnext']); } public function testGetUids() { $mock = $this->getMessageMock(); $mock->getUids('INBOX/Test'); } public function testGetUidList() { $mock = $this->getMessageMock(); $this->assertEquals( array(), $mock->getUids('INBOX/Test') ); } public function testGetUidListSelected() { $mock = $this->getMessageMock(); $this->assertEquals( array(1), $mock->getUids('INBOX/Pretend') ); } public function testGetUidWithoutDeleted() { $mock = $this->getMessageMock(); $this->assertEquals( array(4), $mock->getUids('INBOX/WithDeleted') ); } public function testGetStamp() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Stamp', $this->getMessageMock()->getStamp('INBOX/WithDeleted') ); } public function testStructureArray() { $structure = $this->getMessageMock() ->fetchStructure( 'INBOX/Calendar', array(1) ); $this->assertInstanceOf( 'Horde_Mime_Part', $structure[1]['structure'] ); } public function testBodypartResource() { $this->assertInternalType( 'resource', $this->getMessageMock() ->fetchBodypart( 'INBOX/Calendar', 4, '2' ) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Driver/PearTest.php0000664000175000017500000000676012207101545024553 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the Kolab mock driver. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Driver_PearTest extends PHPUnit_Framework_TestCase { public function testGetNamespaceReturnsNamespaceHandler() { $driver = new Horde_Kolab_Storage_Driver_Pear( new Horde_Kolab_Storage_Factory(), array('backend' => $this->_getNamespaceMock()) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace', $driver->getNamespace() ); } public function testGetNamespaceReturnsExpectedNamespaces() { $driver = new Horde_Kolab_Storage_Driver_Pear( new Horde_Kolab_Storage_Factory(), array('backend' => $this->_getNamespaceMock()) ); $namespaces = array(); foreach ($driver->getNamespace() as $namespace) { $namespaces[$namespace->getName()] = array( 'type' => $namespace->getType(), 'delimiter' => $namespace->getDelimiter(), ); } $this->assertEquals( array( 'INBOX' => array( 'type' => 'personal', 'delimiter' => '/', ), 'user' => array( 'type' => 'other', 'delimiter' => '/', ), '' => array( 'type' => 'shared', 'delimiter' => '/', ), ), $namespaces ); } private function _getNamespaceMock() { $imap = $this->getMock('Net_IMAP', array('hasCapability', 'getNameSpace'), array(), '', false, false); $imap->expects($this->once()) ->method('hasCapability') ->with('NAMESPACE') ->will($this->returnValue(true)); $imap->expects($this->once()) ->method('getNamespace') ->will( $this->returnValue( array( 'personal' => array( array( 'name' => 'INBOX', 'delimter' => '/', ) ), 'others' => array( array( 'name' => 'user', 'delimter' => '/', ) ), 'shared' => array( array( 'name' => '', 'delimter' => '/', ) ), ) ) ); return $imap; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Folder/Stamp/UidsTest.php0000664000175000017500000001130112207101545025617 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the stamp based on UIDs. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Folder_Stamp_UidsTest extends Horde_Kolab_Storage_TestCase { public function setUp() { parent::setUp(); $this->status = array('uidvalidity' => '99', 'uidnext' => '5'); $this->uids = array(1, 2, 4); } public function testUidValidity() { $this->assertEquals('99', $this->_getStamp()->uidvalidity()); } public function testUidNext() { $this->assertEquals('5', $this->_getStamp()->uidnext()); } public function testIds() { $this->assertEquals(array(1, 2, 4), $this->_getStamp()->ids()); } public function testNoReset() { $this->assertFalse($this->_getStamp()->isReset($this->_getStamp())); } public function testReset() { $stamp = new Horde_Kolab_Storage_Folder_Stamp_Uids( array('uidvalidity' => '100', 'uidnext' => '5'), $this->uids ); $this->assertTrue($this->_getStamp()->isReset($stamp)); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testInvalidStampTypeForReset() { $this->_getStamp()->isReset($this->getMock('Horde_Kolab_Storage_Folder_Stamp')); } public function testSerialize() { $this->assertEquals( serialize(array($this->status, $this->uids)), $this->_getStamp()->serialize() ); } public function testSerialize2() { $this->assertEquals( 'C:37:"Horde_Kolab_Storage_Folder_Stamp_Uids":100:{a:2:{i:0;a:2:{s:11:"uidvalidity";s:2:"99";s:7:"uidnext";s:1:"5";}i:1;a:3:{i:0;i:1;i:1;i:2;i:2;i:4;}}}', serialize($this->_getStamp()) ); } public function testUnserialize() { $this->assertFalse( $this->_getStamp()->getChanges( unserialize(serialize($this->_getStamp())) ) ); } public function testNoChange() { $this->assertFalse($this->_getStamp()->getChanges($this->_getStamp())); } public function testAdded() { $stamp = new Horde_Kolab_Storage_Folder_Stamp_Uids( array('uidvalidity' => '99', 'uidnext' => '6'), array(1, 2, 4, 6) ); $this->assertEquals( array( Horde_Kolab_Storage_Folder_Stamp::DELETED => array(), Horde_Kolab_Storage_Folder_Stamp::ADDED => array(6), ), $this->_getStamp()->getChanges($stamp) ); } public function testDeleted() { $stamp = new Horde_Kolab_Storage_Folder_Stamp_Uids( $this->status, array(1, 4) ); $this->assertEquals( array( Horde_Kolab_Storage_Folder_Stamp::DELETED => array(2), Horde_Kolab_Storage_Folder_Stamp::ADDED => array(), ), $this->_getStamp()->getChanges($stamp) ); } public function testUpdated() { $stamp = new Horde_Kolab_Storage_Folder_Stamp_Uids( array('uidvalidity' => '99', 'uidnext' => '8'), array(4, 6, 7) ); $this->assertEquals( array( Horde_Kolab_Storage_Folder_Stamp::DELETED => array(1, 2), Horde_Kolab_Storage_Folder_Stamp::ADDED => array(6, 7), ), $this->_getStamp()->getChanges($stamp) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testInvalidStampType() { $this->_getStamp()->getChanges($this->getMock('Horde_Kolab_Storage_Folder_Stamp')); } public function testToString() { $this->assertEquals( "uidvalidity: 99\nuidnext: 5\nuids: 1, 2, 4", (string) $this->_getStamp() ); } private function _getStamp() { return new Horde_Kolab_Storage_Folder_Stamp_Uids($this->status, $this->uids); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Folder/BaseTest.php0000664000175000017500000002214712207101545024513 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the Kolab folder handler. * * Copyright 2008-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Folder_BaseTest extends Horde_Kolab_Storage_TestCase { public function testConstructor() { $this->_getFolderMock(); } public function testGetPath() { $this->assertEquals('path', $this->_getFolderMock()->getPath()); } public function testGetNamespace() { $this->assertEquals( 'personal', $this->_getFolderMock(array('namespace' => 'personal')) ->getNamespace() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingNamespace() { $this->_getFolderMock()->getNamespace(); } public function testGetTitle() { $this->assertEquals( 'title', $this->_getFolderMock(array('name' => 'title'))->getTitle() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingTitle() { $this->_getFolderMock()->getTitle(); } public function testGetOwner() { $this->assertEquals( 'owner', $this->_getFolderMock(array('owner' => 'owner'))->getOwner() ); } public function testMissingOwner() { $this->assertNull($this->_getFolderMock()->getOwner()); } public function testGetSubpath() { $this->assertEquals( 'subpath', $this->_getFolderMock(array('subpath' => 'subpath'))->getSubpath() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingSubpath() { $this->_getFolderMock()->getSubpath(); } public function testGetDefault() { $this->assertTrue( $this->_getFolderMock(array('default' => true))->isDefault() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingDefault() { $this->_getFolderMock()->isDefault(); } public function testGetType() { $this->assertEquals( 'type', $this->_getFolderMock(array('type' => 'type'))->getType() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingType() { $this->_getFolderMock()->getType(); } public function testGetPrefix() { $this->assertEquals( 'prefix', $this->_getFolderMock(array('prefix' => 'prefix'))->getPrefix() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingPrefix() { $this->_getFolderMock()->getPrefix(); } private function _getFolderMock($data = array()) { return new Horde_Kolab_Storage_Folder_Base( $this->_getListMock($data), 'path' ); } private function _getListMock($data = array()) { $query = $this->getMock('Horde_Kolab_Storage_List_Query_List'); $query->expects($this->any()) ->method('folderData') ->will($this->returnValue($data)); return $query; } /** * Test renaming. */ public function testSetName() { $this->markTestIncomplete('Currently broken'); $GLOBALS['language'] = 'de_DE'; $storage = $this->getMock('Horde_Kolab_Storage', array(), array(), '', false, false); $connection = $this->getMock('Horde_Kolab_Storage_Driver'); $connection->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(new Horde_Kolab_Storage_Driver_Namespace_Fixed())); $folder = new Horde_Kolab_Storage_Folder_Base('INBOX/Contacts'); $folder->restore($storage, $connection); $folder->setName('TestAÖÜ'); $this->assertEquals(Horde_String::convertCharset('INBOX/TestAÖÜ', 'UTF-8', 'UTF7-IMAP'), $folder->new_name); } /** * Test saving objects. */ public function testSave() { $this->markTestIncomplete('Currently broken'); $folder = $this->storage->getNewFolder(); try { $result = $folder->save(); } catch (Exception $e) { $this->assertEquals(Horde_Kolab_Storage_Exception::FOLDER_NAME_UNSET , $e->getCode()); } $folder->setName('TestÄÖÜ'); $result = $folder->exists(); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertFalse($result); $result = $folder->accessible(); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertFalse($result); $result = $folder->save(); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertTrue($result); $this->assertEquals("wrobel@example.org", $folder->getOwner()); $this->assertEquals("TestÄÖÜ", $folder->getTitle()); $this->assertEquals("mail", $folder->getType()); $this->assertFalse($folder->isDefault()); $this->assertTrue($folder->exists()); $this->assertTrue($folder->accessible()); $folder2 = $this->storage->getNewFolder(); $folder2->setName('TestEvents'); $attributes = array( 'type' => 'event', 'default' => true, ); $result = $folder2->save($attributes); $this->assertTrue($result); $this->assertEquals("wrobel@example.org", $folder2->getOwner()); $this->assertEquals("TestEvents", $folder2->getTitle()); $this->assertEquals("event", $folder2->getType()); $this->assertTrue($folder2->isDefault()); $attributes = array( 'default' => false, 'dummy' =>'test', 'desc' =>'A test folder', ); $result = $folder2->save($attributes); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertTrue($result); $this->assertEquals('test', $folder2->getAttribute('dummy')); $this->assertEquals('A test folder', $folder2->getAttribute('desc')); $folder2->setName('TestEventsNew'); $result = $folder2->save($attributes); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertTrue($result); $result = $folder->delete(); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertTrue($result); $result = $folder2->delete(); if (is_a($result, 'PEAR_Error')) { $this->assertEquals('', $result->message); } $this->assertTrue($result); } /** * Test class construction with missing configuration data. */ public function testGetImapFailNoServer() { $this->markTestIncomplete('Currently broken'); $session = Horde_Kolab_Session::singleton('anonymous', null, true); $imap = $session->getImapParams(); $this->assertEquals('localhost', $imap['hostspec']); } /** * Test triggering. */ public function testTriggerOwn() { $this->markTestIncomplete('Currently broken'); $folder = $this->getMock('Horde_Kolab_Storage_Folder', array('triggerUrl')); $folder->expects($this->once()) ->method('triggerUrl') ->with($this->equalTo('https://fb.example.org/freebusy/trigger/wrobel@example.org/Kalender.pfb')); $connection = $this->storage->getConnection(); $folder->restore($this->storage, $connection->connection); $folder->setName('Kalender'); $folder->save(array('type' => 'event')); } /** * Test triggering. */ public function testTriggerForeign() { $this->markTestIncomplete('Currently broken'); $folder = $this->getMock('Horde_Kolab_Storage_Folder', array('triggerUrl')); $folder->expects($this->exactly(2)) ->method('triggerUrl') ->with($this->equalTo('https://fb.example.org/freebusy/trigger/test@example.org/Kalender.pfb')); $connection = $this->storage->getConnection(); $folder->restore($this->storage, $connection->connection); $folder->setName('user/test/Kalender'); $folder->save(array('type' => 'event')); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Folder/DataTest.php0000664000175000017500000000775012207101545024515 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the folder data helper. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Folder_DataTest extends PHPUnit_Framework_TestCase { public function testType() { $data = $this->_getData()->toArray(); $this->assertEquals('test', $data['type']); } public function testDefault() { $data = $this->_getData()->toArray(); $this->assertEquals(true, $data['default']); } public function testOwner() { $data = $this->_getData()->toArray(); $this->assertEquals('owner', $data['owner']); } public function testName() { $data = $this->_getData()->toArray(); $this->assertEquals('Test', $data['name']); } public function testSubpath() { $data = $this->_getData()->toArray(); $this->assertEquals('INBOX/Test', $data['subpath']); } public function testParent() { $data = $this->_getData()->toArray(); $this->assertEquals('INBOX', $data['parent']); } public function testNamespace() { $data = $this->_getData()->toArray(); $this->assertEquals('private', $data['namespace']); } public function testPrefix() { $data = $this->_getData()->toArray(); $this->assertEquals('', $data['prefix']); } public function testDelimiter() { $data = $this->_getData()->toArray(); $this->assertEquals('/', $data['delimiter']); } private function _getData() { $type = $this->getMock('Horde_Kolab_Storage_Folder_Type', array(), array('a')); $type->expects($this->once()) ->method('getType') ->will($this->returnValue('test')); $type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $namespace->expects($this->once()) ->method('getTitle') ->with('INBOX/Test') ->will($this->returnValue('Test')); $namespace->expects($this->once()) ->method('getSubpath') ->with('INBOX/Test') ->will($this->returnValue('INBOX/Test')); $namespace->expects($this->once()) ->method('getParent') ->with('INBOX/Test') ->will($this->returnValue('INBOX')); $namespace->expects($this->exactly(3)) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $ns->expects($this->once()) ->method('getName') ->will($this->returnValue('')); $ns->expects($this->once()) ->method('getDelimiter') ->will($this->returnValue('/')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue('private')); return new Horde_Kolab_Storage_Folder_Data( 'INBOX/Test', $type, $namespace ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Folder/NamespaceTest.php0000664000175000017500000002730212207101545025533 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of namespaces. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Folder_NamespaceTest extends Horde_Kolab_Storage_TestCase { public function setUp() { parent::setUp(); $this->_storage = $this->getMock('Horde_Kolab_Storage', array(), array(), '', false, false); $this->_connection = $this->getMock('Horde_Kolab_Storage_Driver'); } public function testTitleForPersonalNS() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX', $namespace); $this->assertEquals('', $folder->getTitle()); } } public function testTitleWithoutPersonalPrefix() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX/test', $namespace); $this->assertEquals('test', $folder->getTitle()); } } public function testTitleWithoutOtherUserPrefix() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test/his_folder', $namespace); $this->assertEquals('his_folder', $folder->getTitle()); } } public function testTitleSeparator() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX/test/sub', $namespace); $this->assertEquals('sub', $folder->getTitle()); } } public function testOwnerForPersonalNS() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX', $namespace); $this->assertEquals('test', $folder->getOwner()); } } public function testOwnerInPersonalNS() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX/mine', $namespace); $this->assertEquals('test', $folder->getOwner()); } } public function testOwnerForOtherUserNS() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test', $namespace); $this->assertEquals('test', $folder->getOwner()); } } public function testOwnerInOtherUserNS() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test/mine', $namespace); $this->assertEquals('test', $folder->getOwner()); } } public function testAnonymousForSharedNamespace() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('shared.test', $namespace); $this->assertFalse($folder->getOwner()); } } public function testOwnerDomain() { foreach ($this->_getNamespaces('test@example.com') as $namespace) { $folder = $this->_getFolder('user/test/mine', $namespace); $this->assertEquals('test@example.com', $folder->getOwner()); } } public function testOwnerCurrentDomain() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test/mine@example.com', $namespace); $this->assertEquals('test@example.com', $folder->getOwner()); } } public function testSubpathWithoutUsername() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test/mine', $namespace); $this->assertEquals('mine', $folder->getSubpath()); } } public function testSubpathWithoutPrefix() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX/a/b', $namespace); $this->assertEquals('a/b', $folder->getSubpath()); } } public function testParent() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX/a/b', $namespace); $this->assertEquals('INBOX/a', $folder->getParent()); } } public function testRoot() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('INBOX/a', $namespace); $this->assertEquals('INBOX', $folder->getParent()); } } public function testParentInOther() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test/mine/a', $namespace); $this->assertEquals('user/test/mine', $folder->getParent()); } } public function testRootInOther() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('user/test/mine', $namespace); $this->assertEquals('user/test', $folder->getParent()); } } public function testParentInShared() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('shared.a/b', $namespace); $this->assertEquals('shared.a', $folder->getParent()); } } public function testRootInShared() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('shared.a', $namespace); $this->assertEquals('', $folder->getParent()); } } public function testSubpathWithoutSharedPrefix() { foreach ($this->_getNamespaces() as $namespace) { $folder = $this->_getFolder('shared.a/b', $namespace); $this->assertEquals('a/b', $folder->getSubpath()); } } public function testConstructFolderNamePersonal() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('INBOX/b', $namespace->constructFolderName('test', 'b')); } } public function testConstructFolderNameOther() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('user/other/c', $namespace->constructFolderName('other', 'c')); } } public function testConstructFolderNameShared() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('shared.c', $namespace->constructFolderName(null, 'c')); } } public function testConstructFolderPathPersonal() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('INBOX/b', $namespace->constructFolderName('test', 'b', 'INBOX')); } } public function testConstructFolderPathOther() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('user/other/c', $namespace->constructFolderName('other', 'c', 'user')); } } public function testConstructFolderPathOtherWithDomain() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('user/other/c@domain.de', $namespace->constructFolderName('other@domain.de', 'c', 'user')); } } public function testConstructFolderPathOtherWithoutDomain() { foreach ($this->_getNamespaces('test@domain.de') as $namespace) { $this->assertEquals('user/other/c', $namespace->constructFolderName('other@domain.de', 'c', 'user')); } } public function testConstructFolderPathShared() { foreach ($this->_getNamespaces() as $namespace) { $this->assertEquals('shared.c', $namespace->constructFolderName(false, 'c', '')); } } public function testToString() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test@example.com'); $this->assertEquals( 'Horde_Kolab_Storage_Folder_Namespace_Fixed: "INBOX" (personal, "/"), "user" (other, "/"), "" (shared, "/")', (string) $namespace ); } public function testSerializable() { $data = array(); foreach ($this->_getNamespaces() as $namespace) { $data[] = (string) unserialize(serialize($namespace)); } $this->assertEquals( array( 'Horde_Kolab_Storage_Folder_Namespace_Fixed: "INBOX" (personal, "/"), "user" (other, "/"), "" (shared, "/")', 'Horde_Kolab_Storage_Folder_Namespace_Config: "INBOX" (personal, "/"), "user" (other, "/"), "" (shared, "/")', 'Horde_Kolab_Storage_Folder_Namespace_Imap: "INBOX" (personal, "/"), "user" (other, "/"), "" (shared, "/")' ), $data ); } private function _getFolder($name, $namespace) { $factory = new Horde_Kolab_Storage_Factory(); $this->_connection->expects($this->any()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->_connection->expects($this->any()) ->method('listFolders') ->will($this->returnValue(array($name))); $this->_connection->expects($this->any()) ->method('listAnnotation') ->will($this->returnValue(array($name => 'mail'))); $list = new Horde_Kolab_Storage_List_Query_List_Base( $this->_connection, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); return new Horde_Kolab_Storage_Folder_Base($list, $name); } private function _getNamespaces($user = 'test') { return array( new Horde_Kolab_Storage_Folder_Namespace_Fixed($user), new Horde_Kolab_Storage_Folder_Namespace_Config( $user, array( array( 'type' => Horde_Kolab_Storage_Folder_Namespace::PERSONAL, 'name' => 'INBOX/', 'delimiter' => '/', 'add' => true, ), array( 'type' => Horde_Kolab_Storage_Folder_Namespace::OTHER, 'name' => 'user/', 'delimiter' => '/', ), array( 'type' => Horde_Kolab_Storage_Folder_Namespace::SHARED, 'name' => '', 'delimiter' => '/', 'prefix' => 'shared.' ), ) ), new Horde_Kolab_Storage_Folder_Namespace_Imap( $user, array( array( 'name' => 'INBOX/', 'type' => Horde_Kolab_Storage_Folder_Namespace::PERSONAL, 'delimiter' => '/', ), array( 'name' => 'user/', 'type' => Horde_Kolab_Storage_Folder_Namespace::OTHER, 'delimiter' => '/', ), array( 'name' => '', 'type' => Horde_Kolab_Storage_Folder_Namespace::SHARED, 'delimiter' => '/', 'prefix' => 'shared.' ), ) ) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Folder/TypesTest.php0000664000175000017500000000422312207101545024740 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the folder type factory. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Folder_TypesTest extends PHPUnit_Framework_TestCase { public function testConstruction() { new Horde_Kolab_Storage_Folder_Types(); } public function testType() { $types = new Horde_Kolab_Storage_Folder_Types(); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Type', $types->create('event') ); } public function testTypeContact() { $types = new Horde_Kolab_Storage_Folder_Types(); $this->assertEquals('contact', $types->create('contact')->getType()); } public function testTypeDefaultEvent() { $types = new Horde_Kolab_Storage_Folder_Types(); $this->assertEquals('event', $types->create('event.default')->getType()); } public function testTypeDefaultIsDefault() { $types = new Horde_Kolab_Storage_Folder_Types(); $this->assertTrue($types->create('contact.default')->isDefault()); } public function testNoDefault() { $types = new Horde_Kolab_Storage_Folder_Types(); $this->assertFalse($types->create('contact')->isDefault()); } public function testSame() { $types = new Horde_Kolab_Storage_Folder_Types(); $this->assertSame( $types->create('contact'), $types->create('contact') ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Folder/TypeTest.php0000664000175000017500000000353112207101545024556 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the folder type handler. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Folder_TypeTest extends PHPUnit_Framework_TestCase { public function testConstruction() { new Horde_Kolab_Storage_Folder_Type('event'); } public function testTypeEvent() { $type = new Horde_Kolab_Storage_Folder_Type('event'); $this->assertEquals('event', $type->getType()); } public function testTypeContact() { $type = new Horde_Kolab_Storage_Folder_Type('contact'); $this->assertEquals('contact', $type->getType()); } public function testTypeDefaultEvent() { $type = new Horde_Kolab_Storage_Folder_Type('event.default'); $this->assertEquals('event', $type->getType()); } public function testTypeDefaultIsDefault() { $type = new Horde_Kolab_Storage_Folder_Type('contact.default'); $this->assertTrue($type->isDefault()); } public function testNoDefault() { $type = new Horde_Kolab_Storage_Folder_Type('contact'); $this->assertFalse($type->isDefault()); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Manipulation/Decorator/LogTest.php0000664000175000017500000001104712207101545030441 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the operations of the list manipulation log decorator. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Manipulation_Decorator_LogTest extends PHPUnit_Framework_TestCase { public function testCreateFolder() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $base->expects($this->once()) ->method('createFolder') ->with('TEST'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $this->getMock('Horde_Log_Logger') ); $manipulation->createFolder('TEST'); } public function testDeleteFolder() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $base->expects($this->once()) ->method('deleteFolder') ->with('TEST'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $this->getMock('Horde_Log_Logger') ); $manipulation->deleteFolder('TEST'); } public function testRenameFolder() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $base->expects($this->once()) ->method('renameFolder') ->with('FOO', 'BAR'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $this->getMock('Horde_Log_Logger') ); $manipulation->renameFolder('FOO', 'BAR'); } public function testRegisterListener() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $base->expects($this->once()) ->method('registerListener'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $this->getMock('Horde_Log_Logger') ); $listener = $this->getMock('Horde_Kolab_Storage_List_Manipulation_Listener'); $manipulation->registerListener($listener); } public function testCreateFolderLog() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->exactly(2)) ->method('debug') ->with( $this->logicalOr( 'Creating folder TEST.', 'Successfully created folder TEST [type: ].' ) ); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $logger ); $manipulation->createFolder('TEST'); } public function testDeleteFolderLog() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->exactly(2)) ->method('debug') ->with( $this->logicalOr( 'Deleting folder TEST.', 'Successfully deleted folder TEST.' ) ); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $logger ); $manipulation->deleteFolder('TEST'); } public function testRenameFolderLog() { $base = $this->getMock('Horde_Kolab_Storage_List_Manipulation'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->exactly(2)) ->method('debug') ->with( $this->logicalOr( 'Renaming folder FOO.', 'Successfully renamed folder FOO to BAR.' ) ); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Decorator_Log( $base, $logger ); $manipulation->renameFolder('FOO', 'BAR'); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Manipulation/BaseTest.php0000664000175000017500000001073112207101545026647 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the operations of the list modifier. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Manipulation_BaseTest extends PHPUnit_Framework_TestCase { public function testCreateFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('create') ->with('TEST'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $manipulation->createFolder('TEST'); } public function testCreateFolderWithType() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('create') ->with('TEST'); $driver->expects($this->once()) ->method('setAnnotation') ->with('TEST', '/shared/vendor/kolab/folder-type', 'event'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $manipulation->createFolder('TEST', 'event'); } public function testDeleteFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('delete') ->with('TEST'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $manipulation->deleteFolder('TEST'); } public function testRenameFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('rename') ->with('FOO', 'BAR'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $manipulation->renameFolder('FOO', 'BAR'); } public function testUpdateAfterCreateFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $listener = $this->getMock('Horde_Kolab_Storage_List_Manipulation_Listener'); $listener->expects($this->once()) ->method('updateAfterCreateFolder') ->with('TEST'); $manipulation->registerListener($listener); $manipulation->createFolder('TEST'); } public function testUpdateAfterCreateFolderWithType() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $listener = $this->getMock('Horde_Kolab_Storage_List_Manipulation_Listener'); $listener->expects($this->once()) ->method('updateAfterCreateFolder') ->with('TEST', 'event'); $manipulation->registerListener($listener); $manipulation->createFolder('TEST', 'event'); } public function testUpdateAfterDeleteFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $listener = $this->getMock('Horde_Kolab_Storage_List_Manipulation_Listener'); $listener->expects($this->once()) ->method('updateAfterDeleteFolder') ->with('TEST'); $manipulation->registerListener($listener); $manipulation->deleteFolder('TEST'); } public function testUpdateAfterRenameFolder() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $manipulation = new Horde_Kolab_Storage_List_Manipulation_Base($driver); $listener = $this->getMock('Horde_Kolab_Storage_List_Manipulation_Listener'); $listener->expects($this->once()) ->method('updateAfterRenameFolder') ->with('FOO', 'BAR'); $manipulation->registerListener($listener); $manipulation->renameFolder('FOO', 'BAR'); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/Acl/BaseTest.php0000664000175000017500000001420312207101545026011 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of ACL. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_Acl_BaseTest extends PHPUnit_Framework_TestCase { public function testHasAclSupport() { $acl = $this->_getAcl(); $this->assertTrue($acl->hasAclSupport()); } public function testGetAcl() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue('a')); $this->driver->expects($this->once()) ->method('getAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->assertEquals(array('user' => 'lra'), $acl->getAcl('INBOX')); } public function testGetAclWithException() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue('a')); $this->driver->expects($this->once()) ->method('getAcl') ->with('INBOX') ->will($this->throwException(new Horde_Kolab_Storage_Exception())); $this->driver->expects($this->once()) ->method('getAuth') ->will($this->returnValue('user')); $this->assertEquals(array('user' => 'a'), $acl->getAcl('INBOX')); } public function testGetAclWithNoAcl() { $acl = $this->_getAcl(false); $this->driver->expects($this->once()) ->method('getAuth') ->will($this->returnValue('current')); $this->assertEquals( array('current' => 'lrid'), $acl->getAcl('INBOX') ); } public function testGetAclWithoutAdminRights() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getAuth') ->will($this->returnValue('current')); $this->driver->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue('lr')); $this->assertEquals(array('current' => 'lr'), $acl->getAcl('INBOX')); } public function testGetAclForeignFolderNoAdmin() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getMyAcl') ->with('user/example/Notes') ->will($this->returnValue('lr')); $this->driver->expects($this->once()) ->method('getAuth') ->will($this->returnValue('current')); $this->assertEquals(array('current' => 'lr'), $acl->getAcl('user/example/Notes')); } public function testGetAclForeignFolderWithAdmin() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getMyAcl') ->with('user/example/Notes') ->will($this->returnValue('lra')); $this->driver->expects($this->once()) ->method('getAcl') ->with('user/example/Notes') ->will($this->returnValue(array('current' => 'lra'))); $this->assertEquals(array('current' => 'lra'), $acl->getAcl('user/example/Notes')); } public function testGetMyAcl() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue('lra')); $this->assertEquals('lra', $acl->getMyAcl('INBOX')); } public function testGetMyAclWithNoAcl() { $acl = $this->_getAcl(false); $this->assertEquals('lrid', $acl->getMyAcl('INBOX')); } public function testGetAllAcl() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('getAcl') ->with('INBOX') ->will($this->returnValue(array('test' => 'lra'))); $this->assertEquals(array('test' => 'lra'), $acl->getAllAcl('INBOX')); } public function testGetAllAclWithNoAcl() { $acl = $this->_getAcl(false); $this->driver->expects($this->once()) ->method('getAuth') ->will($this->returnValue('current')); $this->assertEquals(array('current' => 'lrid'), $acl->getAllAcl('INBOX')); } public function testSetAcl() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('setAcl') ->with('INBOX', 'user', 'lra'); $acl->setAcl('INBOX', 'user', 'lra'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testSetAclWithNoAclSupport() { $acl = $this->_getAcl(false); $acl->setAcl('INBOX', 'user', 'lra'); } public function testDeleteAcl() { $acl = $this->_getAcl(); $this->driver->expects($this->once()) ->method('deleteAcl') ->with('INBOX', 'user'); $acl->deleteAcl('INBOX', 'user'); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDeleteAclWithNoAclSupport() { $acl = $this->_getAcl(false); $acl->deleteAcl('INBOX', 'user'); } private function _getAcl($has_support = true) { $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); $this->driver->expects($this->any()) ->method('hasAclSupport') ->will($this->returnValue($has_support)); return new Horde_Kolab_Storage_List_Query_Acl_Base( $this->driver ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/Acl/CacheTest.php0000664000175000017500000003024212207101545026143 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the cached handling of ACL. * * Copyright 2011-2013 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPvL). If you * did not receive this file, see http://www.horde.org/licenses/lgpl21. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_Acl_CacheTest extends PHPUnit_Framework_TestCase { public function testInitGetAcl() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_Acl'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $this->cache->expects($this->exactly(3)) ->method('hasQuery') ->with( $this->logicalOr( Horde_Kolab_Storage_List_Query_Acl_Cache::ACL, Horde_Kolab_Storage_List_Query_Acl_Cache::MYRIGHTS, Horde_Kolab_Storage_List_Query_Acl_Cache::ALLRIGHTS ) )->will($this->returnValue(true)); $this->cache->expects($this->exactly(3)) ->method('getQuery') ->with( $this->logicalOr( Horde_Kolab_Storage_List_Query_Acl_Cache::ACL, Horde_Kolab_Storage_List_Query_Acl_Cache::MYRIGHTS, Horde_Kolab_Storage_List_Query_Acl_Cache::ALLRIGHTS ) )->will($this->returnValue(array('INBOX' => array('user' => 'lra')))); $this->query->expects($this->never()) ->method('getAcl'); $this->query->expects($this->never()) ->method('getMyAcl'); $this->query->expects($this->never()) ->method('getAllAcl'); $acl = new Horde_Kolab_Storage_List_Query_Acl_Cache( $this->query, $this->cache ); $this->assertEquals(array('user' => 'lra'), $acl->getAcl('INBOX')); $this->assertEquals(array('user' => 'lra'), $acl->getMyAcl('INBOX')); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testHasAclSupport() { $acl = $this->_getAcl(); $this->cache->expects($this->once()) ->method('issetSupport') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::CAPABILITY) ->will($this->returnValue(true)); $this->cache->expects($this->never()) ->method('save'); $this->cache->expects($this->once()) ->method('hasSupport') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::CAPABILITY) ->will($this->returnValue(true)); $this->assertTrue($acl->hasAclSupport()); } public function testUncachedMissingAclSupport() { $acl = $this->_getAcl(); $this->cache->expects($this->once()) ->method('issetSupport') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::CAPABILITY) ->will($this->returnValue(false)); $this->query->expects($this->once()) ->method('hasAclSupport') ->will($this->returnValue(false)); $this->cache->expects($this->once()) ->method('setSupport') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::CAPABILITY, false) ->will($this->returnValue(false)); $this->cache->expects($this->once()) ->method('save'); $this->cache->expects($this->once()) ->method('hasSupport') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::CAPABILITY) ->will($this->returnValue(false)); $this->assertFalse($acl->hasAclSupport()); } public function testGetAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->assertEquals(array('user' => 'lra'), $acl->getAcl('INBOX')); } public function testCachedGetAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAcl('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getAcl('INBOX')); } public function testStoredGetAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->cache->expects($this->once()) ->method('setQuery') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::ACL, array('INBOX' => array('user' => 'lra'))); $this->cache->expects($this->once()) ->method('save'); $acl->getAcl('INBOX'); } public function testPurgeGetAcl() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAcl('INBOX'); $acl->updateAfterDeleteFolder('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getAcl('INBOX')); } public function testGetMyAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->assertEquals(array('user' => 'lra'), $acl->getMyAcl('INBOX')); } public function testCachedGetMyAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getMyAcl('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getMyAcl('INBOX')); } public function testStoredGetMyAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->cache->expects($this->once()) ->method('setQuery') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::MYRIGHTS, array('INBOX' => array('user' => 'lra'))); $this->cache->expects($this->once()) ->method('save'); $acl->getMyAcl('INBOX'); } public function testPurgeMyAcl() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getMyAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getMyAcl('INBOX'); $acl->updateAfterDeleteFolder('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getMyAcl('INBOX')); } public function testGetAllAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testCachedGetAllAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAllAcl('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testStoredGetAllAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $this->cache->expects($this->once()) ->method('setQuery') ->with(Horde_Kolab_Storage_List_Query_Acl_Cache::ALLRIGHTS, array('INBOX' => array('user' => 'lra'))); $this->cache->expects($this->once()) ->method('save'); $acl->getAllAcl('INBOX'); } public function testPurgeGetAllAcl() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAllAcl('INBOX'); $acl->updateAfterDeleteFolder('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testDeleteAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('deleteAcl') ->with('INBOX', 'test'); $acl->deleteAcl('INBOX', 'test'); } public function testDeletePurgesAcl() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAllAcl('INBOX'); $acl->deleteAcl('INBOX', 'test'); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testSetAcl() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('setAcl') ->with('INBOX', 'test', 'lra'); $acl->setAcl('INBOX', 'test', 'lra'); } public function testSetPurgesAcl() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAllAcl('INBOX'); $acl->setAcl('INBOX', 'test', 'lra'); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testPurgeAfterRename() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAllAcl('INBOX'); $acl->updateAfterRenameFolder('INBOX', 'FOO'); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testCreateChangesNothing() { $acl = $this->_getAcl(); $this->query->expects($this->once()) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAllAcl('INBOX'); $acl->updateAfterCreateFolder('INBOX'); $this->assertEquals(array('user' => 'lra'), $acl->getAllAcl('INBOX')); } public function testSynchronize() { $acl = $this->_getAcl(); $this->query->expects($this->exactly(2)) ->method('getAcl') ->with('FOO') ->will($this->returnValue(array('user' => 'lra'))); $this->query->expects($this->exactly(2)) ->method('getMyAcl') ->with('BAR') ->will($this->returnValue(array('user' => 'lra'))); $this->query->expects($this->exactly(2)) ->method('getAllAcl') ->with('INBOX') ->will($this->returnValue(array('user' => 'lra'))); $acl->getAcl('FOO'); $acl->getMyAcl('BAR'); $acl->getAllAcl('INBOX'); $acl->synchronize(); $acl->getAcl('FOO'); $acl->getMyAcl('BAR'); $acl->getAllAcl('INBOX'); } private function _getAcl() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_Acl'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); return new Horde_Kolab_Storage_List_Query_Acl_Cache( $this->query, $this->cache ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/ActiveSync/BaseTest.php0000664000175000017500000000557512207101545027376 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of active sync data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_Activesync_BaseTest extends PHPUnit_Framework_TestCase { public function testGetEmptyActiveSync() { $activesync = $this->_getActivesync(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/priv/vendor/kolab/activesync') ->will($this->returnValue('')); $this->assertEquals(null, $activesync->getActiveSync('INBOX')); } public function testGetValidActiveSync() { $activesync = $this->_getActivesync(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/priv/vendor/kolab/activesync') ->will($this->returnValue('eyJ4IjoieSJ9')); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } public function testGetInvalidBase64ActiveSync() { $activesync = $this->_getActivesync(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/priv/vendor/kolab/activesync') ->will($this->returnValue('#&&')); $this->assertEquals(null, $activesync->getActiveSync('INBOX')); } public function testGetInvalidJsonActiveSync() { $activesync = $this->_getActivesync(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/priv/vendor/kolab/activesync') ->will($this->returnValue('SGFsbG8K')); $this->assertEquals(null, $activesync->getActiveSync('INBOX')); } public function testSetActiveSync() { $activesync = $this->_getActivesync(); $this->driver->expects($this->once()) ->method('setAnnotation') ->with('INBOX', '/priv/vendor/kolab/activesync', 'eyJ4IjoieSJ9'); $activesync->setActiveSync('INBOX', array('x' => 'y')); } private function _getActivesync() { $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); return new Horde_Kolab_Storage_List_Query_ActiveSync_Base( $this->driver ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/ActiveSync/CacheTest.php0000664000175000017500000001447712207101545027530 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of cached active sync data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_ActiveSync_CacheTest extends PHPUnit_Framework_TestCase { public function testInitActiveSync() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_ActiveSync'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_ActiveSync_Cache::ACTIVE_SYNC) ->will($this->returnValue(true)); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_ActiveSync_Cache::ACTIVE_SYNC) ->will( $this->returnValue( array('INBOX' => array('x' => 'y')) ) ); $this->query->expects($this->never()) ->method('getActiveSync'); $activesync = new Horde_Kolab_Storage_List_Query_ActiveSync_Cache( $this->query, $this->cache ); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } public function testGetActiveSync() { $activesync = $this->_getActivesync(); $this->query->expects($this->once()) ->method('getActiveSync') ->with('INBOX') ->will($this->returnValue(array('x' => 'y'))); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } public function testCachedGetActiveSync() { $activesync = $this->_getActivesync(); $this->query->expects($this->once()) ->method('getActiveSync') ->with('INBOX') ->will($this->returnValue(array('x' => 'y'))); $activesync->getActiveSync('INBOX'); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } public function testStoredGetActiveSync() { $activesync = $this->_getActivesync(); $this->query->expects($this->once()) ->method('getActiveSync') ->with('INBOX') ->will($this->returnValue(array('x' => 'y'))); $this->cache->expects($this->once()) ->method('setQuery') ->with( Horde_Kolab_Storage_List_Query_ActiveSync_Cache::ACTIVE_SYNC, array('INBOX' => array('x' => 'y')) ); $this->cache->expects($this->once()) ->method('save'); $activesync->getActiveSync('INBOX'); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } public function testSetActiveSync() { $activesync = $this->_getActivesync(); $this->query->expects($this->once()) ->method('setActiveSync') ->with('INBOX', array('x' => 'y')); $activesync->setActiveSync('INBOX', array('x' => 'y')); } public function testCacheSetActiveSync() { $activesync = $this->_getActivesync(); $this->cache->expects($this->once()) ->method('setQuery') ->with( Horde_Kolab_Storage_List_Query_ActiveSync_Cache::ACTIVE_SYNC, array('INBOX' => array('x' => 'y')) ); $this->cache->expects($this->once()) ->method('save'); $activesync->setActiveSync('INBOX', array('x' => 'y')); } public function testSetGetActiveSync() { $activesync = $this->_getActivesync(); $value = array('FOO' => 'BAR'); $activesync->setActiveSync('INBOX', $value); $this->assertEquals($value, $activesync->getActiveSync('INBOX')); } public function testUpdateAfterCreateFolder() { $activesync = $this->_getActivesync(); $this->query->expects($this->never()) ->method('getActiveSync'); $activesync->updateAfterCreateFolder('INBOX'); } public function testUpdateAfterDeleteFolder() { $activesync = $this->_getActivesync(); $this->query->expects($this->exactly(2)) ->method('getActiveSync') ->with('INBOX') ->will($this->returnValue(array('x' => 'y'))); $activesync->getActiveSync('INBOX'); $activesync->updateAfterDeleteFolder('INBOX'); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } public function testUpdateAfterRenameFolder() { $activesync = $this->_getActivesync(); $this->query->expects($this->once()) ->method('getActiveSync') ->with('FOO') ->will($this->returnValue(array('x' => 'y'))); $activesync->getActiveSync('FOO'); $activesync->updateAfterRenameFolder('FOO', 'BAR'); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('BAR')); } public function testSynchronize() { $activesync = $this->_getActivesync(); $this->query->expects($this->exactly(2)) ->method('getActiveSync') ->with('INBOX') ->will($this->returnValue(array('x' => 'y'))); $activesync->getActiveSync('INBOX'); $activesync->synchronize(); $this->assertEquals(array('x' => 'y'), $activesync->getActiveSync('INBOX')); } private function _getActivesync() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_ActiveSync'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); return new Horde_Kolab_Storage_List_Query_ActiveSync_Cache( $this->query, $this->cache ); } } ././@LongLink000 145 0003736 LHorde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/List/Cache/SynchronizationTest.phpHorde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/List/Cache/SynchronizationTest.ph0000664000175000017500000005263112207101545031406 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the synchronization machinery. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_List_Cache_SynchronizationTest extends PHPUnit_Framework_TestCase { public function testSynchronizeNamespace() { $synchronization = $this->_getSynchronization(); $synchronization->setCache($this->cache); $this->cache->expects($this->once()) ->method('setNamespace') ->with('N;'); $synchronization->synchronize($this->cache); } public function testSynchronizeFolderlist() { $synchronization = $this->_getSynchronization(); $synchronization->setCache($this->cache); $this->cache->expects($this->once()) ->method('store') ->with( array('INBOX/Test'), array('INBOX/Test' => 'a.default') ); $synchronization->synchronize($this->cache); } public function testSynchronizeQueries() { $synchronization = $this->_getSynchronization(); $synchronization->setCache($this->cache); $this->cache->expects($this->exactly(6)) ->method('setQuery') ->with( $this->logicalOr( Horde_Kolab_Storage_List_Query_List_Cache::TYPES, Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS, Horde_Kolab_Storage_List_Query_List_Cache::OWNERS, Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE, Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS, Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS ), $this->logicalOr( array( 'INBOX/Test' => 'a' ), array( 'INBOX/Test' => array( 'folder' => 'INBOX/Test', 'type' => 'a', 'default' => true, 'owner' => 'owner', 'name' => 'Test', 'subpath' => 'INBOX/Test', 'parent' => 'INBOX', 'namespace' => 'personal', 'prefix' => '', 'delimiter' => '/', ) ), array( 'INBOX/Test' => 'owner' ), array( 'a' => array( 'INBOX/Test' => array( 'folder' => 'INBOX/Test', 'type' => 'a', 'default' => true, 'owner' => 'owner', 'name' => 'Test', 'subpath' => 'INBOX/Test', 'parent' => 'INBOX', 'namespace' => 'personal', 'prefix' => '', 'delimiter' => '/', ) ) ), array( 'owner' => array('a' => 'INBOX/Test') ), array( 'a' => 'INBOX/Test' ) ) ); $synchronization->synchronize($this->cache); } public function testUpdateAfterCreateFolderExit() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->once()) ->method('hasNamespace') ->will($this->returnValue(false)); $cache->expects($this->never()) ->method('getFolders'); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterCreateFolder('INBOX/FooBar'); } public function testUpdateAfterCreateFolder() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2)) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(serialize($namespace))); $cache->expects($this->once()) ->method('getFolders') ->will($this->returnValue(array('INBOX/Foo', 'INBOX/Bar'))); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note'))); $cache->expects($this->once()) ->method('store') ->with( array('INBOX/Foo', 'INBOX/Bar', 'INBOX/FooBar'), array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note') ); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterCreateFolder('INBOX/FooBar'); } public function testUpdateAfterCreateFolderWithType() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2)) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(serialize($namespace))); $cache->expects($this->once()) ->method('getFolders') ->will($this->returnValue(array('INBOX/Foo', 'INBOX/Bar'))); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note'))); $cache->expects($this->once()) ->method('store') ->with( array('INBOX/Foo', 'INBOX/Bar', 'INBOX/FooBar'), array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note', 'INBOX/FooBar' => 'note') ); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterCreateFolder('INBOX/FooBar', 'note'); } public function testUpdateAfterDeleteFolderExit() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->once()) ->method('hasNamespace') ->will($this->returnValue(false)); $cache->expects($this->never()) ->method('getFolders'); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterDeleteFolder('INBOX/FooBar'); } public function testUpdateAfterDeleteFolder() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2)) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(serialize($namespace))); $cache->expects($this->once()) ->method('getFolders') ->will($this->returnValue(array('INBOX/Foo', 'INBOX/Bar'))); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note'))); $cache->expects($this->once()) ->method('store') ->with( array('INBOX/Foo'), array('INBOX/Foo' => 'contact') ); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterDeleteFolder('INBOX/Bar'); } public function testUpdateAfterRenameFolderExit() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->once()) ->method('hasNamespace') ->will($this->returnValue(false)); $cache->expects($this->never()) ->method('getFolders'); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterRenameFolder('INBOX/Foo', 'INBOX/FooBar'); } public function testUpdateAfterRenameFolder() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2)) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(serialize($namespace))); $cache->expects($this->once()) ->method('getFolders') ->will($this->returnValue(array('INBOX/Foo', 'INBOX/Bar'))); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/Foo' => 'contact', 'INBOX/Bar' => 'note'))); $cache->expects($this->once()) ->method('store') ->with( array(0 => 'INBOX/Foo', 2 => 'INBOX/FooBar'), array('INBOX/Foo' => 'contact', 'INBOX/FooBar' => 'note') ); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->updateAfterRenameFolder('INBOX/Bar', 'INBOX/FooBar'); } private function _getSynchronization() { $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $this->driver->expects($this->once()) ->method('listFolders') ->will($this->returnValue(array('INBOX/Test'))); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'a.default'))); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->exactly(2)) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $namespace->expects($this->once()) ->method('getTitle') ->with('INBOX/Test') ->will($this->returnValue('Test')); $namespace->expects($this->once()) ->method('getSubpath') ->with('INBOX/Test') ->will($this->returnValue('INBOX/Test')); $namespace->expects($this->once()) ->method('getParent') ->with('INBOX/Test') ->will($this->returnValue('INBOX')); $namespace->expects($this->exactly(3)) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $ns->expects($this->once()) ->method('getName') ->will($this->returnValue('')); $ns->expects($this->once()) ->method('getDelimiter') ->will($this->returnValue('/')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue('personal')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); return new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $this->driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } public function testGetDuplicateDefaults() { $duplicates = array('a' => 'b'); $defaults = $this->getMock('Horde_Kolab_Storage_List_Query_List_Defaults_Bail'); $defaults->expects($this->once()) ->method('getDuplicates') ->will($this->returnValue($duplicates)); $synchronization = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $this->getMock('Horde_Kolab_Storage_Driver'), new Horde_Kolab_Storage_Folder_Types(), $defaults ); $this->assertEquals($duplicates, $synchronization->getDuplicateDefaults()); } public function testSetDefaultExit() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->once()) ->method('hasNamespace') ->will($this->returnValue(false)); $cache->expects($this->never()) ->method('getFolders'); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->setDefault('INBOX/Foo'); } public function testSetDefault() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('setAnnotation') ->with( 'INBOX/Foo', Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE, 'contact.default' ); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2)) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(serialize($namespace))); $cache->expects($this->once()) ->method('getFolders') ->will($this->returnValue(array('INBOX/Foo'))); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/Foo' => 'contact'))); $cache->expects($this->once()) ->method('store') ->with( array('INBOX/Foo'), array('INBOX/Foo' => 'contact.default') ); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->setDefault( array( 'folder' => 'INBOX/Foo', 'namespace' => 'personal', 'type' => 'contact' ) ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testSetDefaultFailsWithoutPreviousType() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array('hasNamespace', 'getFolderTypes'), array(), '', false, false); $cache->expects($this->once()) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/FooBar' => 'contact'))); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->setDefault( array( 'folder' => 'INBOX/Foo', 'namespace' => 'personal', 'type' => 'contact' ) ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testSetDefaultFailsOutsidePersonalNamespace() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array('hasNamespace', 'getFolderTypes'), array(), '', false, false); $cache->expects($this->once()) ->method('hasNamespace') ->will($this->returnValue(true)); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->setDefault( array( 'folder' => 'INBOX/Foo', 'namespace' => 'shared', 'type' => 'contact' ) ); } public function testSetDefaultResetPreviousDefault() { $namespace = new Horde_Kolab_Storage_Folder_Namespace_Fixed('test'); $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->exactly(2)) ->method('setAnnotation') ->with( $this->logicalOr( 'INBOX/Foo', 'INBOX/Bar' ), Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE, $this->logicalOr( 'event.default', 'event' ) ); $cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $cache->expects($this->exactly(2)) ->method('hasNamespace') ->will($this->returnValue(true)); $cache->expects($this->once()) ->method('getNamespace') ->will($this->returnValue(serialize($namespace))); $cache->expects($this->once()) ->method('getFolders') ->will($this->returnValue(array('INBOX/Foo', 'INBOX/Bar'))); $cache->expects($this->once()) ->method('getFolderTypes') ->will($this->returnValue(array('INBOX/Foo' => 'event', 'INBOX/Bar' => 'event.default'))); $cache->expects($this->once()) ->method('store') ->with( array('INBOX/Foo', 'INBOX/Bar'), array('INBOX/Foo' => 'event.default', 'INBOX/Bar' => 'event') ); $list = new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $list->setCache($cache); $list->setDefault( array( 'folder' => 'INBOX/Foo', 'namespace' => 'personal', 'type' => 'event' ), 'INBOX/Bar' ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/List/BaseTest.php0000664000175000017500000005415112207101545026233 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the basic list query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_List_BaseTest extends PHPUnit_Framework_TestCase { public function testListTypes() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('a' => 'a'))); $this->types->expects($this->once()) ->method('create') ->with('a') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('A')); $this->assertEquals( array('a' => 'A'), $list->listTypes() ); } public function testListByType() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('a' => 'a'))); $this->types->expects($this->once()) ->method('create') ->with('a') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('A')); $this->assertEquals(array('a'), $list->listByType('A')); } public function testDataByType() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'a'))); $this->types->expects($this->once()) ->method('create') ->with('a') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->exactly(2)) ->method('getType') ->will($this->returnValue('test')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $namespace->expects($this->once()) ->method('getTitle') ->with('INBOX/Test') ->will($this->returnValue('Test')); $namespace->expects($this->once()) ->method('getSubpath') ->with('INBOX/Test') ->will($this->returnValue('INBOX/Test')); $namespace->expects($this->once()) ->method('getParent') ->with('INBOX/Test') ->will($this->returnValue('INBOX')); $namespace->expects($this->exactly(3)) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $ns->expects($this->once()) ->method('getName') ->will($this->returnValue('')); $ns->expects($this->once()) ->method('getDelimiter') ->will($this->returnValue('/')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue('private')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( array( 'INBOX/Test' => array( 'folder' => 'INBOX/Test', 'type' => 'test', 'default' => true, 'owner' => 'owner', 'name' => 'Test', 'subpath' => 'INBOX/Test', 'parent' => 'INBOX', 'namespace' => 'private', 'prefix' => '', 'delimiter' => '/', ) ), $list->dataByType('test') ); } public function testFolderData() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'a'))); $this->driver->expects($this->once()) ->method('listFolders') ->will($this->returnValue(array('INBOX/Test'))); $this->types->expects($this->once()) ->method('create') ->with('a') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('test')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $namespace->expects($this->once()) ->method('getTitle') ->with('INBOX/Test') ->will($this->returnValue('Test')); $namespace->expects($this->once()) ->method('getSubpath') ->with('INBOX/Test') ->will($this->returnValue('INBOX/Test')); $namespace->expects($this->once()) ->method('getParent') ->with('INBOX/Test') ->will($this->returnValue('INBOX')); $namespace->expects($this->exactly(3)) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $ns->expects($this->once()) ->method('getName') ->will($this->returnValue('')); $ns->expects($this->once()) ->method('getDelimiter') ->will($this->returnValue('/')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue('private')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( array( 'folder' => 'INBOX/Test', 'type' => 'test', 'default' => true, 'owner' => 'owner', 'name' => 'Test', 'subpath' => 'INBOX/Test', 'parent' => 'INBOX', 'namespace' => 'private', 'prefix' => '', 'delimiter' => '/', ), $list->folderData('INBOX/Test') ); } public function testMailFolderData() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array())); $this->driver->expects($this->once()) ->method('listFolders') ->will($this->returnValue(array('INBOX/Test'))); $this->types->expects($this->once()) ->method('create') ->with('mail') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('mail')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(false)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $namespace->expects($this->once()) ->method('getTitle') ->with('INBOX/Test') ->will($this->returnValue('Test')); $namespace->expects($this->once()) ->method('getSubpath') ->with('INBOX/Test') ->will($this->returnValue('INBOX/Test')); $namespace->expects($this->once()) ->method('getParent') ->with('INBOX/Test') ->will($this->returnValue('INBOX')); $namespace->expects($this->exactly(3)) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $ns->expects($this->once()) ->method('getName') ->will($this->returnValue('')); $ns->expects($this->once()) ->method('getDelimiter') ->will($this->returnValue('/')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue('private')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( array( 'folder' => 'INBOX/Test', 'type' => 'mail', 'default' => false, 'owner' => 'owner', 'name' => 'Test', 'subpath' => 'INBOX/Test', 'parent' => 'INBOX', 'namespace' => 'private', 'prefix' => '', 'delimiter' => '/', ), $list->folderData('INBOX/Test') ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testMissingFolderData() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listFolders') ->will($this->returnValue(array('INBOX/Test'))); $list->folderData('INBOX/NO'); } public function testListOwners() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listFolders') ->will($this->returnValue(array('INBOX/Test'))); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( array('INBOX/Test' => 'owner'), $list->listOwners() ); } public function testListPersonalDefaults() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'test'))); $this->types->expects($this->once()) ->method('create') ->with('test') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('test')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue(Horde_Kolab_Storage_Folder_Namespace::PERSONAL)); $namespace->expects($this->once()) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( array('test' => 'INBOX/Test'), $list->listPersonalDefaults() ); } public function testSetDefault() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('setAnnotation') ->with( 'INBOX/Foo', Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE, 'event.default' ); $this->driver->expects($this->exactly(2)) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Foo' => 'event'))); $this->types->expects($this->exactly(2)) ->method('create') ->with('event') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $list->setDefault('INBOX/Foo'); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testSetDefaultFailsWithoutPreviousType() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Bar' => 'event'))); $this->types->expects($this->once()) ->method('create') ->with('event') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $list->setDefault('INBOX/Foo'); } public function testSetDefaultResetPreviousDefault() { $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); $this->types = new Horde_Kolab_Storage_Folder_Types(); $list = new Horde_Kolab_Storage_List_Query_List_Base( $this->driver, $this->types, new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $this->driver->expects($this->exactly(2)) ->method('setAnnotation') ->with( $this->logicalOr( 'INBOX/Foo', 'INBOX/Bar' ), Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE, $this->logicalOr( 'event.default', 'event' ) ); $this->driver->expects($this->exactly(2)) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will( $this->returnValue( array( 'INBOX/Foo' => 'event', 'INBOX/Bar' => 'event.default' ) ) ); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue(Horde_Kolab_Storage_Folder_Namespace::PERSONAL)); $namespace->expects($this->once()) ->method('matchNamespace') ->will($this->returnValue($ns)); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $list->setDefault('INBOX/Foo'); } public function testListDefaults() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'test'))); $this->types->expects($this->once()) ->method('create') ->with('test') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('test')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue(Horde_Kolab_Storage_Folder_Namespace::PERSONAL)); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( array('owner' => array('test' => 'INBOX/Test')), $list->listDefaults() ); } public function testGetDefault() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'test'))); $this->types->expects($this->once()) ->method('create') ->with('test') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('test')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue(Horde_Kolab_Storage_Folder_Namespace::PERSONAL)); $namespace->expects($this->once()) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( 'INBOX/Test', $list->getDefault('test') ); } public function testGetForeignDefault() { $list = $this->_getList(); $this->driver->expects($this->once()) ->method('listAnnotation') ->with(Horde_Kolab_Storage_List_Query_List_Base::ANNOTATION_FOLDER_TYPE) ->will($this->returnValue(array('INBOX/Test' => 'test'))); $this->types->expects($this->once()) ->method('create') ->with('test') ->will($this->returnValue($this->mock_type)); $this->mock_type->expects($this->once()) ->method('getType') ->will($this->returnValue('test')); $this->mock_type->expects($this->once()) ->method('isDefault') ->will($this->returnValue(true)); $ns = $this->getMock('Horde_Kolab_Storage_Folder_Namespace_Element', array(), array('A', 'B', 'C')); $ns->expects($this->once()) ->method('getType') ->will($this->returnValue(Horde_Kolab_Storage_Folder_Namespace::PERSONAL)); $namespace = $this->getMock('Horde_Kolab_Storage_Folder_Namespace', array(), array(array())); $namespace->expects($this->once()) ->method('getOwner') ->with('INBOX/Test') ->will($this->returnValue('owner')); $namespace->expects($this->once()) ->method('matchNamespace') ->with('INBOX/Test') ->will($this->returnValue($ns)); $this->driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue($namespace)); $this->assertEquals( 'INBOX/Test', $list->getForeignDefault('owner', 'test') ); } private function _getList() { $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); $this->types = $this->getMock('Horde_Kolab_Storage_Folder_Types'); $this->mock_type = $this->getMock('Horde_Kolab_Storage_Folder_Type', array(), array('event.default')); return new Horde_Kolab_Storage_List_Query_List_Base( $this->driver, $this->types, new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/List/CacheTest.php0000664000175000017500000003475712207101545026376 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the cached list query. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_List_CacheTest extends PHPUnit_Framework_TestCase { public function testListTypes() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::TYPES) ->will($this->returnValue(array('foo' => 'BAR'))); $this->assertEquals(array('foo' => 'BAR'), $list->listTypes()); } public function testUnitializedListTypes() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::TYPES) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $list->listTypes('foo'); } public function testInitializedListTypes() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::TYPES) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $list->listTypes('foo'); } public function testListByType() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE) ->will($this->returnValue(array('foo' => array('BAR' => array('a' => 'b'))))); $this->assertEquals( array('BAR'), $list->listByType('foo') ); } public function testUnitializedListByType() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $list->listByType('foo'); } public function testItializedListByType() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $list->listByType('foo'); } public function testDataByType() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE) ->will($this->returnValue(array('foo' => array('BAR' => array('a' => 'b'))))); $this->assertEquals( array('BAR' => array('a' => 'b')), $list->dataByType('foo') ); } public function testUnitializedDataByType() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $list->dataByType('foo'); } public function testItializedDataByType() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::BY_TYPE) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $list->dataByType('foo'); } public function testFolderData() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS) ->will($this->returnValue(array('BAR' => array('a' => 'b')))); $this->assertEquals(array('a' => 'b'), $list->folderData('BAR')); } public function testUninitializedFolderData() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS) ->will($this->returnValue(array('BAR' => array('a' => 'b')))); $list->folderData('BAR'); } public function testInitializedFolderData() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS) ->will($this->returnValue(array('BAR' => array('a' => 'b')))); $list->folderData('BAR'); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testMissingFolderData() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS) ->will($this->returnValue(array('BAR' => array('a' => 'b')))); $list->folderData('INBOX/NO'); } public function testListOwners() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::OWNERS) ->will($this->returnValue(array('FOO' => 'bar'))); $this->assertEquals( array('FOO' => 'bar'), $list->listOwners() ); } public function testUninitializedListOwners() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::OWNERS) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $list->listOwners(); } public function testInitializedListOwners() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::OWNERS) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $list->listOwners(); } public function testSetDefault() { $list = $this->_getList(); $this->cache->expects($this->exactly(2)) ->method('getQuery') ->with( $this->logicalOr( Horde_Kolab_Storage_List_Query_List_Cache::FOLDERS, Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS ) ) ->will($this->returnValue(array('INBOX/Foo' => array('folder' => 'INBOX/Foo', 'type' => 'event')))); $this->sync->expects($this->once()) ->method('setDefault') ->with(array('folder' => 'INBOX/Foo', 'type' => 'event'), null); $list->setDefault('INBOX/Foo'); } public function testListPersonalDefaults() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS) ->will($this->returnValue(array('FOO' => 'bar'))); $this->assertEquals( array('FOO' => 'bar'), $list->listPersonalDefaults() ); } public function testUninitializedListPersonalDefaults() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $list->listPersonalDefaults(); } public function testInitializedListPersonalDefaults() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $list->listPersonalDefaults(); } public function testListDefaults() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS) ->will($this->returnValue(array('FOO' => 'bar'))); $this->assertEquals( array('FOO' => 'bar'), $list->listDefaults() ); } public function testUninitializedListDefaults() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS) ->will($this->returnValue(false)); $this->sync->expects($this->once()) ->method('synchronize'); $list->listDefaults(); } public function testInitializedListDefaults() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS) ->will($this->returnValue(true)); $this->sync->expects($this->never()) ->method('synchronize'); $list->listDefaults(); } public function testGetDefault() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS) ->will($this->returnValue(array('bar' => 'FOO'))); $this->assertEquals('FOO', $list->getDefault('bar')); } public function testMissingDefault() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::PERSONAL_DEFAULTS) ->will($this->returnValue(array('bar' => 'FOO'))); $this->assertFalse($list->getDefault('foo')); } public function testGetForeignDefault() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS) ->will($this->returnValue(array('owner' => array('bar' => 'FOO')))); $this->assertEquals( 'FOO', $list->getForeignDefault('owner', 'bar') ); } public function testMissingForeignDefault() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_List_Cache::DEFAULTS) ->will($this->returnValue(array('owner' => array('bar' => 'FOO')))); $this->assertFalse($list->getForeignDefault('owner', 'foo')); } public function testGetStamp() { $list = $this->_getList(); $this->cache->expects($this->once()) ->method('getStamp') ->will($this->returnValue('STAMP')); $this->assertEquals( 'STAMP', $list->getStamp() ); } public function testUpdateAfterCreateFolder() { $list = $this->_getList(); $this->sync->expects($this->once()) ->method('updateAfterCreateFolder') ->with('INBOX/Calendar', 'event.default'); $list->updateAfterCreateFolder('INBOX/Calendar', 'event.default'); } public function testUpdateAfterDeleteFolder() { $list = $this->_getList(); $this->sync->expects($this->once()) ->method('updateAfterDeleteFolder') ->with('INBOX/Calendar'); $list->updateAfterDeleteFolder('INBOX/Calendar'); } public function testUpdateAfterRenameFolder() { $list = $this->_getList(); $this->sync->expects($this->once()) ->method('updateAfterRenameFolder') ->with('INBOX/Calendar', 'INBOX/Kalender'); $list->updateAfterRenameFolder('INBOX/Calendar', 'INBOX/Kalender'); } public function testSynchronize() { $list = $this->_getList(); $this->sync->expects($this->once()) ->method('synchronize') ->with(); $list->synchronize(); } public function testDuplicateDefaults() { $duplicates = array('a' => 'b'); $list = $this->_getList(); $this->sync->expects($this->once()) ->method('getDuplicateDefaults') ->will($this->returnValue($duplicates)); $this->assertEquals($duplicates, $list->getDuplicateDefaults()); } private function _getList() { $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $this->sync = $this->getMock('Horde_Kolab_Storage_List_Query_List_Cache_Synchronization', array(), array(), '', false, false); return new Horde_Kolab_Storage_List_Query_List_Cache( $this->sync, $this->cache ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/List/DefaultsTest.php0000664000175000017500000001202512207101545027122 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the defaults helper. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_List_DefaultsTest extends PHPUnit_Framework_TestCase { public function testMarkCompleteIsComplete() { $defaults = new Horde_Kolab_Storage_List_Query_List_Defaults_Bail(); $defaults->markComplete(); $this->assertTrue($defaults->isComplete()); } public function testGetDefaults() { $defaults = new Horde_Kolab_Storage_List_Query_List_Defaults_Bail(); $defaults->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', false); $defaults->rememberDefault('FooC', 'TypeFOOBAR', 'Mr. Foo', false); $defaults->rememberDefault('BarA', 'TypeBAR', 'Mr. Bar', false); $defaults->rememberDefault('BarC', 'TypeFOOBAR', 'Mr. Bar', false); $this->assertEquals( array( 'Mr. Foo' => array( 'TypeFOO' => 'FooA', 'TypeFOOBAR' => 'FooC', ), 'Mr. Bar' => array( 'TypeBAR' => 'BarA', 'TypeFOOBAR' => 'BarC', ), ), $defaults->getDefaults() ); } public function testGetPersonalDefaults() { $defaults = new Horde_Kolab_Storage_List_Query_List_Defaults_Bail(); $defaults->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', true); $defaults->rememberDefault('FooC', 'TypeFOOBAR', 'Mr. Foo', true); $defaults->rememberDefault('BarA', 'TypeBAR', 'Mr. Bar', false); $this->assertEquals( array( 'TypeFOO' => 'FooA', 'TypeFOOBAR' => 'FooC', ), $defaults->getPersonalDefaults() ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testBailOnDoubleDefault() { $bail = new Horde_Kolab_Storage_List_Query_List_Defaults_Bail(); $bail->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', false); $bail->rememberDefault('FooC', 'TypeFOO', 'Mr. Foo', false); } public function testLogOnDoubleDefault() { $logger = $this->getMock('Horde_Log_Logger', array('err')); $logger->expects($this->once()) ->method('err') ->with('Both folders "FooA" and "FooC" of owner "Mr. Foo" are marked as default folder of type "TypeFOO"!'); $log = new Horde_Kolab_Storage_List_Query_List_Defaults_Log( $logger ); $log->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', false); $log->rememberDefault('FooC', 'TypeFOO', 'Mr. Foo', false); } public function testDuplicates() { $logger = $this->getMock('Horde_Log_Logger', array('err')); $log = new Horde_Kolab_Storage_List_Query_List_Defaults_Log( $logger ); $log->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', false); $log->rememberDefault('FooC', 'TypeFOO', 'Mr. Foo', false); $this->assertEquals( array( 'TypeFOO' => array( 'Mr. Foo' => array('FooA', 'FooC') ) ), $log->getDuplicates() ); } public function testTriplicate() { $logger = $this->getMock('Horde_Log_Logger', array('err')); $log = new Horde_Kolab_Storage_List_Query_List_Defaults_Log( $logger ); $log->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', false); $log->rememberDefault('FooB', 'TypeFOO', 'Mr. Foo', false); $log->rememberDefault('FooC', 'TypeFOO', 'Mr. Foo', false); $this->assertEquals( array( 'TypeFOO' => array( 'Mr. Foo' => array('FooA', 'FooB', 'FooC') ) ), $log->getDuplicates() ); } public function testReset() { $defaults = new Horde_Kolab_Storage_List_Query_List_Defaults_Bail(); $defaults->rememberDefault('FooA', 'TypeFOO', 'Mr. Foo', false); $defaults->rememberDefault('FooC', 'TypeFOOBAR', 'Mr. Foo', false); $defaults->rememberDefault('BarA', 'TypeBAR', 'Mr. Bar', false); $defaults->rememberDefault('BarC', 'TypeFOOBAR', 'Mr. Bar', false); $defaults->reset(); $this->assertEquals(array(), $defaults->getDefaults()); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/Share/BaseTest.php0000664000175000017500000000546412207101545026365 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of share data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_Share_BaseTest extends PHPUnit_Framework_TestCase { public function testGetDescription() { $share = $this->_getShare(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/shared/comment') ->will($this->returnValue('description')); $this->assertEquals('description', $share->getDescription('INBOX')); } public function testGetParameters() { $share = $this->_getShare(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/shared/vendor/horde/share-params') ->will($this->returnValue(base64_encode(serialize(array('params'))))); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } public function testGetEmptyParameters() { $share = $this->_getShare(); $this->driver->expects($this->once()) ->method('getAnnotation') ->with('INBOX', '/shared/vendor/horde/share-params') ->will($this->returnValue('')); $this->assertEquals(array(), $share->getParameters('INBOX')); } public function testSetDescription() { $share = $this->_getShare(); $this->driver->expects($this->once()) ->method('setAnnotation') ->with('INBOX', '/shared/comment', 'test'); $share->setDescription('INBOX', 'test'); } public function testSetParameters() { $share = $this->_getShare(); $this->driver->expects($this->once()) ->method('setAnnotation') ->with( 'INBOX', '/shared/vendor/horde/share-params', base64_encode(serialize(array('params'))) ); $share->setParameters('INBOX', array('params')); } private function _getShare() { $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); return new Horde_Kolab_Storage_List_Query_Share_Base( $this->driver ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Query/Share/CacheTest.php0000664000175000017500000002471612207101545026517 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of cached share data. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Query_Share_CacheTest extends PHPUnit_Framework_TestCase { public function testInitDescription() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_Share'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $this->cache->expects($this->once()) ->method('hasQuery') ->with(Horde_Kolab_Storage_List_Query_Share_Cache::DESCRIPTIONS) ->will($this->returnValue(true)); $this->cache->expects($this->once()) ->method('getQuery') ->with(Horde_Kolab_Storage_List_Query_Share_Cache::DESCRIPTIONS) ->will( $this->returnValue( array('INBOX' => 'Description') ) ); $this->query->expects($this->never()) ->method('getDescription'); $share = new Horde_Kolab_Storage_List_Query_Share_Cache( $this->query, $this->cache ); $this->assertEquals('Description', $share->getDescription('INBOX')); } public function testGetDescription() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getDescription') ->with('INBOX') ->will($this->returnValue('description')); $this->assertEquals('description', $share->getDescription('INBOX')); } public function testCachedGetDescription() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getDescription') ->with('INBOX') ->will($this->returnValue('description')); $share->getDescription('INBOX'); $this->assertEquals('description', $share->getDescription('INBOX')); } public function testStoredGetDescription() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getDescription') ->with('INBOX') ->will($this->returnValue('description')); $this->cache->expects($this->once()) ->method('setQuery') ->with( Horde_Kolab_Storage_List_Query_Share_Cache::DESCRIPTIONS, array('INBOX' => 'description') ); $this->cache->expects($this->once()) ->method('save'); $share->getDescription('INBOX'); } public function testInitParameter() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_Share'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); $this->cache->expects($this->once()) ->method('hasLongTerm') ->with(Horde_Kolab_Storage_List_Query_Share_Cache::PARAMETERS) ->will($this->returnValue(true)); $this->cache->expects($this->once()) ->method('getLongTerm') ->with(Horde_Kolab_Storage_List_Query_Share_Cache::PARAMETERS) ->will( $this->returnValue( array('INBOX' => array('params')) ) ); $this->query->expects($this->never()) ->method('getParameters'); $share = new Horde_Kolab_Storage_List_Query_Share_Cache( $this->query, $this->cache ); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } public function testGetParameter() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getParameters') ->with('INBOX') ->will($this->returnValue(array('params'))); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } public function testCachedGetParameter() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getParameters') ->with('INBOX') ->will($this->returnValue(array('params'))); $share->getParameters('INBOX'); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } public function testStoredGetParameter() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getParameters') ->with('INBOX') ->will($this->returnValue(array('params'))); $this->cache->expects($this->once()) ->method('setLongTerm') ->with( Horde_Kolab_Storage_List_Query_Share_Cache::PARAMETERS, array('INBOX' => array('params')) ); $this->cache->expects($this->once()) ->method('save'); $share->getParameters('INBOX'); } public function testSetDescription() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('setDescription') ->with('INBOX', 'Description'); $share->setDescription('INBOX', 'Description'); } public function testCacheSetDescription() { $share = $this->_getShare(); $this->cache->expects($this->once()) ->method('setQuery') ->with( Horde_Kolab_Storage_List_Query_Share_Cache::DESCRIPTIONS, array('INBOX' => 'Description') ); $this->cache->expects($this->once()) ->method('save'); $share->setDescription('INBOX', 'Description'); } public function testSetGetDescription() { $share = $this->_getShare(); $share->setDescription('INBOX', 'TEST'); $this->assertEquals('TEST', $share->getDescription('INBOX')); } public function testSetParameters() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('setParameters') ->with('INBOX', array('params')); $share->setParameters('INBOX', array('params')); } public function testCacheSetParameters() { $share = $this->_getShare(); $this->cache->expects($this->once()) ->method('setLongTerm') ->with( Horde_Kolab_Storage_List_Query_Share_Cache::PARAMETERS, array('INBOX' => array('params')) ); $this->cache->expects($this->once()) ->method('save'); $share->setParameters('INBOX', array('params')); } public function testSetGetParameters() { $share = $this->_getShare(); $share->setParameters('INBOX', array('params')); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } public function testUpdateAfterCreateFolder() { $share = $this->_getShare(); $this->query->expects($this->never()) ->method('getDescription'); $share->updateAfterCreateFolder('INBOX'); } public function testUpdateDescriptionAfterDeleteFolder() { $share = $this->_getShare(); $this->query->expects($this->exactly(2)) ->method('getDescription') ->with('INBOX') ->will($this->returnValue('Description')); $share->getDescription('INBOX'); $share->updateAfterDeleteFolder('INBOX'); $this->assertEquals('Description', $share->getDescription('INBOX')); } public function testUpdateParametersAfterDeleteFolder() { $share = $this->_getShare(); $this->query->expects($this->exactly(2)) ->method('getParameters') ->with('INBOX') ->will($this->returnValue(array('params'))); $share->getParameters('INBOX'); $share->updateAfterDeleteFolder('INBOX'); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } public function testUpdateDescriptionAfterRenameFolder() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getDescription') ->with('FOO') ->will($this->returnValue('Description')); $share->getDescription('FOO'); $share->updateAfterRenameFolder('FOO', 'BAR'); $this->assertEquals('Description', $share->getDescription('BAR')); } public function testUpdateParametersAfterRenameFolder() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getParameters') ->with('FOO') ->will($this->returnValue(array('params'))); $share->getParameters('FOO'); $share->updateAfterRenameFolder('FOO', 'BAR'); $this->assertEquals(array('params'), $share->getParameters('BAR')); } public function testSynchronizeDescription() { $share = $this->_getShare(); $this->query->expects($this->exactly(2)) ->method('getDescription') ->with('INBOX') ->will($this->returnValue('Description')); $share->getDescription('INBOX'); $share->synchronize(); $this->assertEquals('Description', $share->getDescription('INBOX')); } public function testSynchronizeParameters() { $share = $this->_getShare(); $this->query->expects($this->once()) ->method('getParameters') ->with('INBOX') ->will($this->returnValue(array('params'))); $share->getParameters('INBOX'); $share->synchronize(); $this->assertEquals(array('params'), $share->getParameters('INBOX')); } private function _getShare() { $this->query = $this->getMock('Horde_Kolab_Storage_List_Query_Share'); $this->cache = $this->getMock('Horde_Kolab_Storage_List_Cache', array(), array(), '', false, false); return new Horde_Kolab_Storage_List_Query_Share_Cache( $this->query, $this->cache ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Synchronization/Decorator/LogTest.php0000664000175000017500000000447012207101545031204 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the synchronisation log decorator. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Synchronization_Decorator_LogTest extends PHPUnit_Framework_TestCase { public function testRegisterListener() { $base = $this->getMock('Horde_Kolab_Storage_List_Synchronization'); $base->expects($this->once()) ->method('registerListener'); $synchronization = new Horde_Kolab_Storage_List_Synchronization_Decorator_Log( $base, $this->getMock('Horde_Log_Logger') ); $listener = $this->getMock('Horde_Kolab_Storage_List_Synchronization_Listener'); $synchronization->registerListener($listener); } public function testSynchronize() { $base = $this->getMock('Horde_Kolab_Storage_List_Synchronization'); $base->expects($this->once()) ->method('synchronize'); $synchronization = new Horde_Kolab_Storage_List_Synchronization_Decorator_Log( $base, $this->getMock('Horde_Log_Logger') ); $synchronization->synchronize(); } public function testSynchronizationLog() { $base = $this->getMock('Horde_Kolab_Storage_List_Synchronization'); $logger = $this->getMock('Horde_Log_Logger', array('debug')); $logger->expects($this->once()) ->method('debug') ->with('Synchronized the Kolab folder list!'); $synchronization = new Horde_Kolab_Storage_List_Synchronization_Decorator_Log( $base, $logger ); $synchronization->synchronize(); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/Synchronization/BaseTest.php0000664000175000017500000000246412207101545027414 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the synchronisation handler. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_Synchronization_BaseTest extends PHPUnit_Framework_TestCase { public function testSynchronize() { $synchronization = new Horde_Kolab_Storage_List_Synchronization_Base(); $listener = $this->getMock('Horde_Kolab_Storage_List_Synchronization_Listener'); $listener->expects($this->once()) ->method('synchronize'); $synchronization->registerListener($listener); $synchronization->synchronize(); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/List/ToolsTest.php0000664000175000017500000002622112207101545024436 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the list toolset handler. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_List_ToolsTest extends PHPUnit_Framework_TestCase { public function testManipulation() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Manipulation', $tools->getListManipulation() ); } public function testDebugLogsManipulation() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'log' => array('debug') ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Manipulation_Decorator_Log', $tools->getListManipulation() ); } public function testSpecificallyLogManipulation() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'log' => array('list_manipulation') ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Manipulation_Decorator_Log', $tools->getListManipulation() ); } public function testSynchronization() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array() ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Synchronization', $tools->getListSynchronization() ); } public function testDebugLogsSynchronization() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'log' => array('debug') ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Synchronization_Decorator_Log', $tools->getListSynchronization() ); } public function testSpecificallyLogSynchronization() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'log' => array('list_synchronization') ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Synchronization_Decorator_Log', $tools->getListSynchronization() ); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testInvalidQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array() ); $tools->getQuery('TEST'); } /** * @expectedException Horde_Kolab_Storage_List_Exception */ public function testMissingQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array() ); $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_SHARE); } public function testDefaultQueries() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array() ); $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_BASE); } public function testListQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array('queries' => array(Horde_Kolab_Storage_List_Tools::QUERY_BASE)) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_List_Base', $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_BASE) ); } public function testUnspecifiedQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array('queries' => array(Horde_Kolab_Storage_List_Tools::QUERY_BASE)) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_List_Base', $tools->getQuery() ); } public function testCachedListQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'queries' => array( 'list' => array( Horde_Kolab_Storage_List_Tools::QUERY_BASE => array( 'defaults_bail' => true, 'cache' => true ) ) ) ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_List_Cache', $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_BASE) ); } public function testAclQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'queries' => array( 'list' => array( Horde_Kolab_Storage_List_Tools::QUERY_BASE => true, Horde_Kolab_Storage_List_Tools::QUERY_ACL => true ) ) ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_Acl_Base', $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_ACL) ); } public function testCachedAclQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'queries' => array( 'list' => array( Horde_Kolab_Storage_List_Tools::QUERY_ACL => array( 'cache' => true ) ) ) ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_Acl_Cache', $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_ACL) ); } public function testShareQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'queries' => array( 'list' => array( Horde_Kolab_Storage_List_Tools::QUERY_SHARE => true ) ) ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_Share_Base', $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_SHARE) ); } public function testCachedShareQuery() { $tools = new Horde_Kolab_Storage_List_Tools( $this->_getDriver(), $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), array( 'queries' => array( 'list' => array( Horde_Kolab_Storage_List_Tools::QUERY_SHARE => array( 'cache' => true ) ) ) ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Query_Share_Cache', $tools->getQuery(Horde_Kolab_Storage_List_Tools::QUERY_SHARE) ); } public function testGetId() { $driver = $this->_getDriver(); $driver->expects($this->once()) ->method('getId') ->will($this->returnValue('ID')); $tools = new Horde_Kolab_Storage_List_Tools( $driver, $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger') ); $this->assertEquals('ID', $tools->getId()); } public function testGetNamespace() { $driver = $this->_getDriver(); $driver->expects($this->once()) ->method('getNamespace') ->will($this->returnValue('NAMESPACE')); $tools = new Horde_Kolab_Storage_List_Tools( $driver, $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger') ); $this->assertEquals('NAMESPACE', $tools->getNamespace()); } private function _getDriver() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('getParameters') ->will( $this->returnValue( array('host' => 'a', 'port' => 1, 'user' => 'b') ) ); return $driver; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Object/Writer/FormatTest.php0000664000175000017500000001343312207101545026336 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the conversion of Kolab MIME parts content to data arrays. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Object_Writer_FormatTest extends PHPUnit_Framework_TestCase { public function testLoad() { $array = array('x' => 'y'); $data = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data); $format = $this->getMock('Horde_Kolab_Format'); $format->expects($this->once()) ->method('load') ->with($content) ->will($this->returnValue($array)); $factory = $this->getMock('Horde_Kolab_Format_Factory'); $factory->expects($this->once()) ->method('create') ->with('Xml', 'event', array()) ->will($this->returnValue($format)); $raw = new Horde_Kolab_Storage_Object_Writer_Format( $factory ); $object = $this->getMock('Horde_Kolab_Storage_Object'); $object->expects($this->once()) ->method('setData') ->with($array); $object->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->assertTrue($raw->load($content, $object)); } public function testLoadFailure() { $data = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data); $format = $this->getMock('Horde_Kolab_Format'); $format->expects($this->once()) ->method('load') ->with($content) ->will($this->throwException(new Horde_Kolab_Format_Exception())); $factory = $this->getMock('Horde_Kolab_Format_Factory'); $factory->expects($this->once()) ->method('create') ->with('Xml', 'event', array()) ->will($this->returnValue($format)); $raw = new Horde_Kolab_Storage_Object_Writer_Format( $factory ); $object = $this->getMock('Horde_Kolab_Storage_Object'); $object->expects($this->once()) ->method('setContent') ->with($content); $object->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $result = $raw->load($content, $object); $this->assertInstanceOf('Exception', $result); } public function testSave() { $array = array('x' => 'y'); $data = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data); $format = $this->getMock('Horde_Kolab_Format'); $format->expects($this->once()) ->method('save') ->with($array, array('previous' => 'previous')) ->will($this->returnValue($content)); $factory = $this->getMock('Horde_Kolab_Format_Factory'); $factory->expects($this->once()) ->method('create') ->with('Xml', 'event', array()) ->will($this->returnValue($format)); $raw = new Horde_Kolab_Storage_Object_Writer_Format( $factory ); $object = $this->getMock('Horde_Kolab_Storage_Object'); $object->expects($this->once()) ->method('getData') ->will($this->returnValue($array)); $object->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $object->expects($this->once()) ->method('getCurrentContent') ->will($this->returnValue('previous')); $this->assertSame( $content, $raw->save($object) ); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testSaveFailure() { $array = array('x' => 'y'); $data = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data); $format = $this->getMock('Horde_Kolab_Format'); $format->expects($this->once()) ->method('save') ->with($array, array('previous' => 'previous')) ->will($this->throwException(new Horde_Kolab_Format_Exception())); $factory = $this->getMock('Horde_Kolab_Format_Factory'); $factory->expects($this->once()) ->method('create') ->with('Xml', 'event', array()) ->will($this->returnValue($format)); $raw = new Horde_Kolab_Storage_Object_Writer_Format( $factory ); $object = $this->getMock('Horde_Kolab_Storage_Object'); $object->expects($this->once()) ->method('getData') ->will($this->returnValue($array)); $object->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $object->expects($this->once()) ->method('getCurrentContent') ->will($this->returnValue('previous')); $raw->save($object); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Object/Writer/RawTest.php0000664000175000017500000000371412207101545025640 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the rewriting of Kolab MIME part content to a plain content string. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Object_Writer_RawTest extends PHPUnit_Framework_TestCase { public function testLoad() { $data = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data); $raw = new Horde_Kolab_Storage_Object_Writer_Raw(); $object = $this->getMock('Horde_Kolab_Storage_Object'); $object->expects($this->once()) ->method('setContent') ->with($content); $raw->load($content, $object); } public function testSave() { $data = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data); $raw = new Horde_Kolab_Storage_Object_Writer_Raw(); $object = $this->getMock('Horde_Kolab_Storage_Object'); $object->expects($this->once()) ->method('getContent') ->will($this->returnValue($content)); $this->assertSame( $content, $raw->save($object) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Object/MimeTypeTest.php0000664000175000017500000001473012207101545025364 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the Kolab mime type handling. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Object_MimeTypeTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getObjectAndMimeTypes */ public function testMimeTypeFromObjectType($type, $mime_type) { $this->assertEquals( $mime_type, Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType($type) ); } /** * @expectedException Horde_Kolab_Storage_Data_Exception */ public function testUndefinedMimeObjectType() { Horde_Kolab_Storage_Object_MimeType::getMimeTypeFromObjectType('UNDEFINED'); } /** * @dataProvider getObjectAndMimeTypes */ public function testMatchMimePartToObjectType($type, $mime_type) { $this->assertEquals( 2, Horde_Kolab_Storage_Object_MimeType::matchMimePartToObjectType( $this->getMultipartMimeMessage($mime_type), $type ) ); } public function testNoMatchToObjectType() { $this->assertFalse( Horde_Kolab_Storage_Object_MimeType::matchMimePartToObjectType( $this->getMultipartMimeMessage('dummy/dummy'), 'event' ) ); } /** * @dataProvider getObjectAndMimeTypes */ public function testGetObjectTypeFromMimePart($type, $mime_type) { $this->assertEquals( $type, Horde_Kolab_Storage_Object_MimeType::getObjectTypeFromMimePart( $this->getMultipartMimeMessage($mime_type), 2 ) ); } public function testGetUnknownObjectType() { $this->assertFalse( Horde_Kolab_Storage_Object_MimeType::getObjectTypeFromMimePart( $this->getMultipartMimeMessage('dummy/dummy'), 2 ) ); } /** * @dataProvider getObjectAndMimeTypes */ public function testMatchMimePartToHeaderType($type, $mime_type) { $headers = new Horde_Mime_Headers(); $headers->addHeader('X-Kolab-Type', $mime_type); $this->assertEquals( array(2, $type), Horde_Kolab_Storage_Object_MimeType::matchMimePartToHeaderType( $this->getMultipartMimeMessage($mime_type), $headers ) ); } public function testUndefinedKolabTypeHeader() { $headers = new Horde_Mime_Headers(); $this->assertFalse( Horde_Kolab_Storage_Object_MimeType::matchMimePartToHeaderType( $this->getMultipartMimeMessage('test/test'), $headers ) ); } private function getMultipartMimeMessage($mime_type) { $envelope = new Horde_Mime_Part(); $envelope->setType('multipart/mixed'); $foo = new Horde_Mime_Part(); $foo->setType('foo/bar'); $envelope->addPart($foo); $kolab = new Horde_Mime_Part(); $kolab->setType($mime_type); $envelope->addPart($kolab); $envelope->buildMimeIds(); return $envelope; } public function getObjectandMimeTypes() { return array( array('contact', 'application/x-vnd.kolab.contact'), array('distribution-list', 'application/x-vnd.kolab.contact.distlist'), array('event', 'application/x-vnd.kolab.event'), array('journal', 'application/x-vnd.kolab.journal'), array('note', 'application/x-vnd.kolab.note'), array('task', 'application/x-vnd.kolab.task'), array('configuration', 'application/x-vnd.kolab.configuration'), array('h-prefs', 'application/x-vnd.kolab.h-prefs'), array('h-ledger', 'application/x-vnd.kolab.h-ledger'), ); } /** * @dataProvider getFolderAndMimeTypes */ public function testMimeTypeFromFolderType($type, $mime_types) { $this->assertEquals( $mime_types, Horde_Kolab_Storage_Object_MimeType::getMimeTypesFromFolderType($type) ); } /** * @expectedException Horde_Kolab_Storage_Data_Exception */ public function testUndefinedMimeFolderType() { Horde_Kolab_Storage_Object_MimeType::getMimeTypesFromFolderType('UNDEFINED'); } /** * @dataProvider getFolderAndMimeTypes */ public function testMatchMimePartToFolderType($type, $mime_types) { foreach ($mime_types as $mime_type) { $this->assertEquals( array(2, Horde_Kolab_Storage_Object_MimeType::getObjectTypeFromMimeType($mime_type)), Horde_Kolab_Storage_Object_MimeType::matchMimePartToFolderType( $this->getMultipartMimeMessage($mime_type), $type ) ); } } public function testNoMatchMimePartToFolderType() { $this->assertFalse( Horde_Kolab_Storage_Object_MimeType::matchMimePartToFolderType( $this->getMultipartMimeMessage('application/x-vnd.kolab.event'), 'note' ) ); } public function getFolderandMimeTypes() { return array( array('contact', array( 'application/x-vnd.kolab.contact', 'application/x-vnd.kolab.contact.distlist' ) ), array('event', array('application/x-vnd.kolab.event')), array('journal', array('application/x-vnd.kolab.journal')), array('note', array('application/x-vnd.kolab.note')), array('task', array('application/x-vnd.kolab.task')), array('h-prefs', array('application/x-vnd.kolab.h-prefs')), array('h-ledger', array('application/x-vnd.kolab.h-ledger')), ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/QuerySet/UncachedTest.php0000664000175000017500000000465512207101545025725 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the uncached query set. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_QuerySet_UncachedTest extends Horde_Kolab_Storage_TestCase { public function testAddDataQuery() { $this->_assertDataQuery(array('data' => array('queryset' => 'horde'))); } public function testAddMySet() { $this->_assertDataQuery( array('data' => array('myset' => array(Horde_Kolab_Storage_Data::QUERY_PREFS => 'h-prefs'))) ); } private function _assertDataQuery($params) { $driver = $this->getNullMock(); $factory = new Horde_Kolab_Storage_Factory(); $list = new Horde_Kolab_Storage_List_Query_List_Base( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); $data = new Horde_Kolab_Storage_Data_Base( new Horde_Kolab_Storage_Folder_Base( $list, 'INBOX/Preferences' ), $driver, $factory, 'h-prefs' ); $query_set = new Horde_Kolab_Storage_QuerySet_Uncached( $factory, $params ); $query_set->addDataQuerySet($data); $this->assertInstanceOf( 'Horde_Kolab_Storage_Data_Query', $data->getQuery(Horde_Kolab_Storage_Data::QUERY_PREFS) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testNoSuchDataQuerySet() { $factory = new Horde_Kolab_Storage_Factory(); new Horde_Kolab_Storage_QuerySet_Uncached( $factory, array('data' => array('queryset' => 'NO_SUCH_SET')) ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Synchronization/OncePerSessionTest.php0000664000175000017500000001160712207101545030525 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the "once per session" synchronization handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Synchronization_OncePerSessionTest extends PHPUnit_Framework_TestCase { public function testSynchronizeListReturn() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $this->assertNull($synchronization->synchronizeList($list)); } public function testListSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); } public function testListSynchronizationInSession() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getId') ->will($this->returnValue('test')); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); $this->assertTrue($_SESSION['kolab_storage']['synchronization']['list']['test']); } public function testDuplicateListSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); $synchronization->synchronizeList($list); } public function testSynchronizeDataReturn() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $this->assertNull($synchronization->synchronizeData($data)); } public function testDataSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('synchronize'); $synchronization->synchronizeData($data); } public function testDataSynchronizationInSession() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('getId') ->will($this->returnValue('test')); $synchronization->synchronizeData($data); $this->assertTrue($_SESSION['kolab_storage']['synchronization']['data']['test']); } public function testDuplicateDataSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_OncePerSession(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('synchronize'); $synchronization->synchronizeData($data); $synchronization->synchronizeData($data); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/Synchronization/TimeBasedTest.php0000664000175000017500000001265112207101545027463 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the "time based" synchronization handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_Synchronization_TimeBasedTest extends PHPUnit_Framework_TestCase { public function testSynchronizeListReturn() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $this->assertNull($synchronization->synchronizeList($list)); } public function testListSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); } public function testListSynchronizationInSession() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getId') ->will($this->returnValue('test')); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); $this->assertTrue($_SESSION['kolab_storage']['synchronization']['list']['test']); } public function testDuplicateListSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); $synchronization->synchronizeList($list); } public function testSynchronizeDataReturn() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $this->assertNull($synchronization->synchronizeData($data)); } public function testDataSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('synchronize'); $synchronization->synchronizeData($data); } public function testDataSynchronizationInSession() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('getId') ->will($this->returnValue('test')); $synchronization->synchronizeData($data); $this->assertTrue(isset($_SESSION['kolab_storage']['synchronization']['data']['test'])); } public function testDuplicateDataSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('synchronize'); $synchronization->synchronizeData($data); $synchronization->synchronizeData($data); } public function testDuplicateDataSynchronizationAfterSyncTimeElapsed() { $this->markTestSkipped('Test with embedded "sleep()". Only useful for the development phase.'); $synchronization = new Horde_Kolab_Storage_Synchronization_TimeBased(1, 0); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->exactly(2)) ->method('synchronize'); $synchronization->synchronizeData($data); sleep(2); $synchronization->synchronizeData($data); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/CachedTest.php0000664000175000017500000000434612207101545023576 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the cache decorator for the storage handler. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_CachedTest extends Horde_Kolab_Storage_TestCase { public function testConstruction() { $this->createCachedStorage(); } public function testGetList() { $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Tools', $this->createCachedStorage()->getList() ); } public function testSameList() { $base = $this->createCachedStorage(); $this->assertSame($base->getList(), $base->getList()); } public function testGetFolder() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder', $this->createCachedStorage($this->getAnnotatedMock())->getFolder('INBOX') ); } public function testGetData() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Data_Cached', $this->createCachedStorage($this->getAnnotatedMock())->getData('INBOX') ); } public function testSameData() { $base = $this->createCachedStorage($this->getAnnotatedMock()); $this->assertSame( $base->getData('INBOX'), $base->getData('INBOX') ); } public function testDifferentFolders() { $base = $this->createCachedStorage($this->getAnnotatedMock()); $this->assertNotSame( $base->getData('INBOX'), $base->getData('INBOX/a') ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/CacheTest.php0000664000175000017500000001756412207101545023440 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the Kolab cache. * * Copyright 2008-2013 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. * * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_CacheTest extends Horde_Kolab_Storage_TestCase { public function setUp() { parent::setUp(); $this->horde_cache = new Horde_Cache( new Horde_Cache_Storage_Mock() ); $this->cache = new Horde_Kolab_Storage_Cache($this->horde_cache); } public function testGetDataCache() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Cache_Data', $this->cache->getDataCache($this->_getDataParameters()) ); } public function testCachedDataCache() { $this->assertSame( $this->cache->getDataCache($this->_getDataParameters()), $this->cache->getDataCache($this->_getDataParameters()) ); } public function testNewHostNewData() { $params = $this->_getDataParameters(); $params['host'] = 'b'; $this->assertNotSame( $this->cache->getDataCache($params), $this->cache->getDataCache($this->_getDataParameters()) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDataMissingHost() { $params = $this->_getDataParameters(); unset($params['host']); $this->cache->getDataCache($params); } public function testNewPortNewData() { $params = $this->_getDataParameters(); $params['port'] = 2; $this->assertNotSame( $this->cache->getDataCache($params), $this->cache->getDataCache($this->_getDataParameters()) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDataMissingPort() { $params = $this->_getDataParameters(); unset($params['port']); $this->cache->getDataCache($params); } public function testNewFolderNewData() { $params = $this->_getDataParameters(); $params['folder'] = 'J'; $this->assertNotSame( $this->cache->getDataCache($params), $this->cache->getDataCache($this->_getDataParameters()) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDataMissingFolder() { $params = $this->_getDataParameters(); unset($params['folder']); $this->cache->getDataCache($params); } public function testNewTypeNewData() { $params = $this->_getDataParameters(); $params['type'] = 'f'; $this->assertNotSame( $this->cache->getDataCache($params), $this->cache->getDataCache($this->_getDataParameters()) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDataMissingType() { $params = $this->_getDataParameters(); unset($params['type']); $this->cache->getDataCache($params); } public function testNewOwnerNewData() { $params = $this->_getDataParameters(); $params['owner'] = 'f'; $this->assertNotSame( $this->cache->getDataCache($params), $this->cache->getDataCache($this->_getDataParameters()) ); } public function testKeyCollision() { $params2 = $this->_getDataParameters(); $params2['folder'] = 'I'; $params2['type'] = 'e/'; $params = $this->_getDataParameters(); $params['folder'] = 'I/e'; $params['type'] = ''; $this->assertNotSame( $this->cache->getDataCache($params), $this->cache->getDataCache($params2) ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testDataMissingOwner() { $params = $this->_getDataParameters(); unset($params['owner']); $this->cache->getDataCache($params); } public function testLoadData() { $this->assertFalse( $this->cache->loadData('test') ); } public function testStoreData() { $this->cache->storeData('test', true); $this->assertTrue( $this->cache->loadData('test') ); } public function testLoadAttachment() { $this->assertFalse( $this->cache->loadAttachment('test', '1', '1') ); } public function testStoreAttachment() { $this->cache->storeAttachment('test', '1', '1', $this->_getResource()); $this->assertEquals( 'test', stream_get_contents( $this->cache->loadAttachment('test', '1', '1') ) ); } public function testStoreSameAttachment() { $resource = $this->_getResource(); $resource2 = $this->_getResource(); $this->cache->storeAttachment('test', '1', '1', $resource); $this->cache->storeAttachment('test', '1', '1', $resource2); $this->assertSame( $resource2, $this->cache->loadAttachment('test', '1', '1') ); $this->assertNotSame( $resource, $this->cache->loadAttachment('test', '1', '1') ); } public function testStoreDifferentUidAttachment() { $resource = $this->_getResource(); $resource2 = $this->_getResource(); $this->cache->storeAttachment('test', '1', '1', $resource); $this->cache->storeAttachment('test', '2', '1', $resource2); $this->assertSame( $resource, $this->cache->loadAttachment('test', '1', '1') ); $this->assertSame( $resource2, $this->cache->loadAttachment('test', '2', '1') ); } public function testStoreDifferentAttachmentId() { $resource = $this->_getResource(); $resource2 = $this->_getResource(); $this->cache->storeAttachment('test', '1', '1', $resource); $this->cache->storeAttachment('test', '1', '2', $resource2); $this->assertSame( $resource, $this->cache->loadAttachment('test', '1', '1') ); $this->assertSame( $resource2, $this->cache->loadAttachment('test', '1', '2') ); } public function testLoadList() { $this->assertFalse( $this->cache->loadList('test') ); } public function testStoreList() { $this->cache->storeList('test', true); $this->assertTrue( $this->cache->loadList('test') ); } public function testCachingListData() { $this->cache->storeList('user@example.com:143', array('folders' => array('a', 'b'))); $this->assertEquals(array('folders' => array('a', 'b')), $this->cache->loadList('user@example.com:143')); } private function _getIdParameters() { return array('host' => 'a', 'port' => 1, 'user' => 'x'); } private function _getDataParameters() { return array( 'host' => 'a', 'port' => 1, 'prefix' => 'P', 'folder' => 'I', 'type' => 'e', 'owner' => 'x', ); } private function _getResource() { $resource = fopen('php://temp', 'r+'); fwrite($resource, 'test'); rewind($resource); return $resource; } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/FactoryTest.php0000664000175000017500000000763212207101545024037 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the factory. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_FactoryTest extends Horde_Kolab_Storage_TestCase { public function testCreationFromParams() { $factory = new Horde_Kolab_Storage_Factory(array('driver' => 'mock', 'logger' => $this->getMock('Horde_Log_Logger'))); $this->assertInstanceOf( 'Horde_Kolab_Storage', $factory->create() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testMissingDriver() { $factory = new Horde_Kolab_Storage_Factory( array() ); $factory->createDriver(); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testInvalidDriver() { $factory = new Horde_Kolab_Storage_Factory( array('driver' => 'something') ); $factory->createDriver(); } public function testMockDriver() { $factory = new Horde_Kolab_Storage_Factory( array('driver' => 'mock') ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Driver_Mock', $factory->createDriver() ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testInvalidNamespace() { $factory = new Horde_Kolab_Storage_Factory(); $factory->createNamespace( 'undefined', 'test' ); } public function testFixedNamespace() { $factory = new Horde_Kolab_Storage_Factory(); $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder_Namespace_Fixed', $factory->createNamespace( 'fixed', 'test' ) ); } public function testTimerDecoration() { $logger = $this->getMockLogger(); $factory = new Horde_Kolab_Storage_Factory( array( 'driver' => 'mock', 'logger' => $logger, 'log' => array('driver_time'), ) ); $this->assertInstanceOf( 'Horde_Kolab_Storage_Driver_Decorator_Timer', $factory->createDriver() ); } public function testCacheInstance() { $factory = new Horde_Kolab_Storage_Factory(); $cache = new Horde_Cache(new Horde_Cache_Storage_Mock()); $this->assertInstanceOf( 'Horde_Kolab_Storage_Cache', $factory->createCache($cache) ); } public function testCacheFilebased() { $factory = new Horde_Kolab_Storage_Factory(); $this->assertInstanceOf( 'Horde_Kolab_Storage_Cache', $factory->createCache(array()) ); } public function testHistory() { $factory = new Horde_Kolab_Storage_Factory(); $this->assertInstanceOf( 'Horde_History', $factory->createHistory('test') ); } public function testHistoryInject() { $history = new Horde_History_Mock('test'); $factory = new Horde_Kolab_Storage_Factory( array('history' => $history) ); $this->assertSame( $history, $factory->createHistory('test') ); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/ObjectTest.php0000664000175000017500000006733712207101545023646 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Tests the Kolab mime message parser. * * Copyright 2012-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_ObjectTest extends PHPUnit_Framework_TestCase { public function setUp() { $this->folder = $this->getMock('Horde_Kolab_Storage_Folder'); $this->driver = $this->getMock('Horde_Kolab_Storage_Driver'); } /** * @expectedException Horde_Kolab_Storage_Data_Exception */ public function testInvalidInitialStructure() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $object->load('1', $this->folder, $data, new stdClass); } public function testObjectType() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $this->assertEquals('event', $object->getType()); } public function testObjectTypeDeviatesFromFolderType() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $headers->expects($this->once()) ->method('getValue') ->with('X-Kolab-Type') ->will($this->returnValue('application/x-vnd.kolab.note')); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.note') ); $this->assertEquals('note', $object->getType()); } public function testMissingKolabPart() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $headers->expects($this->once()) ->method('getValue') ->with('X-Kolab-Type') ->will($this->returnValue('application/x-vnd.kolab.note')); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.task') ); $this->assertEquals( Horde_Kolab_Storage_Object::TYPE_INVALID, $object->getType() ); $this->assertContains( Horde_Kolab_Storage_Object::ERROR_MISSING_KOLAB_PART, array_keys($object->getParseErrors()) ); $this->assertTrue($object->hasParseErrors()); } public function testObjectRetainsHeadersIfLoaded() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $headers->expects($this->once()) ->method('getValue') ->with('X-Kolab-Type') ->will($this->returnValue('application/x-vnd.kolab.note')); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.note') ); $this->assertSame($headers, $object->getHeaders()); } public function testObjectFetchesHeadersOnRequest() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $this->assertSame($headers, $object->getHeaders()); } public function testObjectRetainsContentIfLoaded() { $data_string = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data_string); $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchBodypart') ->with('INBOX/Calendar', '1', '2') ->will($this->returnValue($content)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $this->assertSame($content, $object->getContent()); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testGetDriverThrowsExceptionIfUnset() { $object = new Horde_Kolab_Storage_Object(); $object->create( $this->getMock('Horde_Kolab_Storage_Folder'), $this->getMock('Horde_Kolab_Storage_Object_Writer'), 'event' ); } public function testSetContent() { $object = new Horde_Kolab_Storage_Object(); $object->setContent('A'); $this->assertEquals('A', $object->getContent()); } public function testSetData() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array('a' => 'A')); $this->assertEquals('A', $object['a']); } private function getMultipartMimeMessage($mime_type) { $envelope = new Horde_Mime_Part(); $envelope->setType('multipart/mixed'); $foo = new Horde_Mime_Part(); $foo->setType('foo/bar'); $envelope->addPart($foo); $kolab = new Horde_Mime_Part(); $kolab->setType($mime_type); $envelope->addPart($kolab); $envelope->buildMimeIds(); return $envelope; } public function testOffsetPresent() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array('a' => 'A')); $this->assertTrue(isset($object['a'])); } public function testOffsetMissing() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array('a' => 'A')); $this->assertFalse(isset($object['b'])); } public function testOffsetWithoutData() { $object = new Horde_Kolab_Storage_Object(); $this->assertFalse(isset($object['b'])); } public function testOffsetGet() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array('a' => 'A')); $this->assertEquals('A', $object['a']); } public function testOffsetSet() { $object = new Horde_Kolab_Storage_Object(); $object['a'] = 'A'; $this->assertEquals(array('a' => 'A'), $object->getData()); } public function testOffsetUnset() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array('a' => 'A', 'b' => 'B')); unset($object['b']); unset($object['uid']); $this->assertEquals(array('a' => 'A'), $object->getData()); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testUnserializeInvalidData() { $object = new Horde_Kolab_Storage_Object(); $object->unserialize(serialize('A')); } public function testSerializeUnserializeRetainsData() { $data = array('a' => 'a'); $object = new Horde_Kolab_Storage_Object(); $object->setData($data); $new_object = new Horde_Kolab_Storage_Object(); $new_object->unserialize($object->serialize()); $result = $new_object->getData(); $this->assertEquals($data['a'], $result['a']); } public function testSerializeUnserializeRetainsErrors() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $headers->expects($this->once()) ->method('getValue') ->with('X-Kolab-Type') ->will($this->returnValue('application/x-vnd.kolab.note')); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.task') ); $new_object = new Horde_Kolab_Storage_Object(); $new_object->unserialize($object->serialize()); $this->assertContains( Horde_Kolab_Storage_Object::ERROR_MISSING_KOLAB_PART, array_keys($new_object->getParseErrors()) ); } public function testSerializeUnserializeRetainsType() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $new_object = new Horde_Kolab_Storage_Object(); $new_object->unserialize($object->serialize()); $this->assertEquals('event', $new_object->getType()); } public function testSerializeUnserializeRetainsBackendIdAndFolder() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $headers = $this->getMock('Horde_Mime_Headers'); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $new_object = new Horde_Kolab_Storage_Object(); $new_object->unserialize($object->serialize()); $new_object->setDriver($this->driver); $this->assertSame($headers, $new_object->getHeaders()); } public function testSerializeUnserializeForgetsContent() { $data_string = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data_string); $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->exactly(2)) ->method('fetchBodypart') ->with('INBOX/Calendar', '1', '2') ->will($this->returnValue($content)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $new_object = new Horde_Kolab_Storage_Object(); $new_object->unserialize($object->serialize()); $new_object->setDriver($this->driver); $this->assertSame($content, $new_object->getContent()); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testFetchingContentsFailsWithMissingFolder() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue(null)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testFetchingContentsFailsWithMissingBackendId() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $object->setDriver($this->driver); $object->load( null, $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testFetchingContentsFailsWithMissingMimeId() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $headers = $this->getMock('Horde_Mime_Headers'); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $object->setDriver($this->driver); $this->driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX/Calendar', '1') ->will($this->returnValue($headers)); $object->load( '1', $this->folder, $data, new Horde_Mime_Part() ); $object->getContent(); } public function testObjectLoadsData() { $data_string = "\n"; $content = fopen('php://temp', 'r+'); fwrite($content, $data_string); $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $data->expects($this->once()) ->method('load'); $headers = $this->getMock('Horde_Mime_Headers'); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $this->driver->expects($this->once()) ->method('fetchBodypart') ->with('INBOX/Calendar', '1', '2') ->will($this->returnValue($content)); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); } public function testMimeEnvelope() { $driver = new Horde_Kolab_Storage_Stub_Driver('user'); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $writer = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $object->setDriver($driver); $object->create($folder, $writer, 'event'); $this->assertContains('MIME-Version: 1.0', $driver->messages['INBOX'][0]); } public function testEnvelope() { setlocale(LC_MESSAGES, 'C'); $driver = new Horde_Kolab_Storage_Stub_Driver('user'); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $writer = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $object->setData(array('uid' => 'UID')); $object->setDriver($driver); $object->create($folder, $writer, 'event'); $this->assertContains('Content-Disposition: attachment; filename="Kolab Groupware Data"', $driver->messages['INBOX'][0]); $this->assertContains('Content-Type: multipart/mixed;', $driver->messages['INBOX'][0]); $this->assertContains('Content-Type: text/plain; name="Kolab Groupware Information"; charset=utf-8', $driver->messages['INBOX'][0]); $this->assertContains('Content-Disposition: inline; filename="Kolab Groupware Information"', $driver->messages['INBOX'][0]); $this->assertContains( "This is a Kolab Groupware object. To view this object you will need an email client that understands the Kolab Groupware format. For a list of such email clients please visit http://www.kolab.org/content/kolab-clients", $driver->messages['INBOX'][0] ); $this->assertContains('User-Agent: Horde_Kolab_Storage ' . Horde_Kolab_Storage::VERSION, $driver->messages['INBOX'][0]); $this->assertContains('Subject: UID', $driver->messages['INBOX'][0]); $this->assertContains('From: user', $driver->messages['INBOX'][0]); $this->assertContains('To: user', $driver->messages['INBOX'][0]); $this->assertContains('X-Kolab-Type: application/x-vnd.kolab.event', $driver->messages['INBOX'][0]); $this->assertContains('Content-Type: application/x-vnd.kolab.event; name=kolab.xml', $driver->messages['INBOX'][0]); $this->assertEquals( array( 0 => 'multipart/mixed', 1 => 'text/plain', 2 => 'application/x-vnd.kolab.event' ), Horde_Mime_Part::parseMessage($driver->messages['INBOX'][0])->contentTypeMap(true) ); } public function testSavedBackendId() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('appendMessage') ->will($this->returnValue(1001)); $driver->expects($this->once()) ->method('fetchHeaders') ->with('INBOX', 1001); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $writer = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $object->setData(array('uid' => 'UID')); $object->setDriver($driver); $object->create($folder, $writer, 'event'); $object->getHeaders(); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testDriverException() { $driver = $this->getMock('Horde_Kolab_Storage_Driver'); $driver->expects($this->once()) ->method('appendMessage') ->will($this->returnValue(false)); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $writer = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $object = new Horde_Kolab_Storage_Object(); $object->setData(array('uid' => 'UID')); $object->setDriver($driver); $object->create($folder, $writer, 'event'); } public function testGetUid() { $object = new Horde_Kolab_Storage_Object(); $this->assertInternalType('string', $object->getUid()); } public function testNewUid() { $object = new Horde_Kolab_Storage_Object(); $uid = $object->getUid(); $data = $object->getData(); $this->assertEquals($uid, $data['uid']); } public function testPresetUid() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array('uid' => 'UID')); $this->assertEquals('UID', $object->getUid()); } public function testSave() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $this->driver->expects($this->once()) ->method('fetchComplete') ->will( $this->returnValue( array( new Horde_Mime_Headers(), $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ) ) ); $this->driver->expects($this->once()) ->method('appendMessage') ->will($this->returnValue(1001)); $this->driver->expects($this->once()) ->method('deleteMessages') ->with('INBOX/Calendar', array(900)); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $object->setDriver($this->driver); $object->load( 900, $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $object->save($data); } /** * @expectedException Horde_Kolab_Storage_Object_Exception */ public function testSaveException() { $data = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $this->driver->expects($this->once()) ->method('fetchComplete') ->will( $this->returnValue( array( new Horde_Mime_Headers(), $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ) ) ); $this->driver->expects($this->once()) ->method('appendMessage') ->will($this->returnValue(false)); $object = new Horde_Kolab_Storage_Object(); $this->folder->expects($this->once()) ->method('getType') ->will($this->returnValue('event')); $this->folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX/Calendar')); $object->setDriver($this->driver); $object->load( '1', $this->folder, $data, $this->getMultipartMimeMessage('application/x-vnd.kolab.event') ); $object->save($data); } public function testKolabPart() { $driver = new Horde_Kolab_Storage_Stub_Driver('user'); $folder = $this->getMock('Horde_Kolab_Storage_Folder'); $folder->expects($this->once()) ->method('getPath') ->will($this->returnValue('INBOX')); $writer = $this->getMock('Horde_Kolab_Storage_Object_Writer'); $writer->expects($this->once()) ->method('save') ->will($this->returnValue('')); $object = new Horde_Kolab_Storage_Object(); $object->setData(array('uid' => 'UID')); $object->setDriver($driver); $object->create($folder, $writer, 'event'); $message = $driver->fetchComplete('INBOX', 0); $this->assertEquals('inline', $message[1]->getPart('2')->getDisposition()); $this->assertEquals( 'xml', $message[1]->getPart('2')->getDispositionParameter('x-kolab-type') ); $this->assertEquals('kolab.xml', $message[1]->getPart('2')->getName()); $this->assertEquals( 'application/x-vnd.kolab.event', $message[1]->getPart('2')->getType() ); $this->assertEquals('', trim($message[1]->getPart('2')->getContents())); } public function testAutomaticUid() { $object = new Horde_Kolab_Storage_Object(); $object->setData(array()); $this->assertEquals(array('uid'), array_keys($object->getData())); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/SynchronizationTest.php0000664000175000017500000001133412207101545025623 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the synchronization handler. * * Copyright 2011-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_SynchronizationTest extends Horde_Kolab_Storage_TestCase { public function testSynchronizeListReturn() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $this->assertNull($synchronization->synchronizeList($list)); } public function testListSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); } public function testListSynchronizationInSession() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getId') ->will($this->returnValue('test')); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); $this->assertTrue($_SESSION['kolab_storage']['synchronization']['list']['test']); } public function testDuplicateListSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $list = $this->getMock( 'Horde_Kolab_Storage_List_Tools', array(), array(), '', false, false ); $list->expects($this->once()) ->method('getListSynchronization') ->will($this->returnValue($this->getMock('Horde_Kolab_Storage_List_Synchronization'))); $synchronization->synchronizeList($list); $synchronization->synchronizeList($list); } public function testSynchronizeDataReturn() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $this->assertNull($synchronization->synchronizeData($data)); } public function testDataSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('synchronize'); $synchronization->synchronizeData($data); } public function testDataSynchronizationInSession() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('getId') ->will($this->returnValue('test')); $synchronization->synchronizeData($data); $this->assertTrue($_SESSION['kolab_storage']['synchronization']['data']['test']); } public function testDuplicateDataSynchronization() { $synchronization = new Horde_Kolab_Storage_Synchronization(); $data = $this->getMock( 'Horde_Kolab_Storage_Data_Base', array(), array(), '', false, false ); $data->expects($this->once()) ->method('synchronize'); $synchronization->synchronizeData($data); $synchronization->synchronizeData($data); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Unit/UncachedTest.php0000664000175000017500000000626312207101545024141 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the basic storage handler. * * Copyright 2010-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Unit_UncachedTest extends Horde_Kolab_Storage_TestCase { public function testConstruction() { $this->createStorage(); } public function testGetList() { $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Tools', $this->createStorage()->getList() ); } public function testSameList() { $base = $this->createStorage(); $this->assertSame($base->getList(), $base->getList()); } public function testGetFolder() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Folder', $this->createStorage($this->getAnnotatedMock())->getFolder('INBOX') ); } public function testGetData() { $this->assertInstanceOf( 'Horde_Kolab_Storage_Data', $this->createStorage($this->getAnnotatedMock())->getData('INBOX') ); } public function testSameData() { $base = $this->createStorage($this->getAnnotatedMock()); $this->assertSame( $base->getData('INBOX'), $base->getData('INBOX') ); } public function testDifferentFolders() { $base = $this->createStorage($this->getAnnotatedMock()); $this->assertNotSame( $base->getData('INBOX'), $base->getData('INBOX/a') ); } public function testGetSystemList() { $params = array('system' => array('' => array('username' => 'system', 'password' => ''))); $this->assertInstanceOf( 'Horde_Kolab_Storage_List_Tools', $this->_getSystemStorage($params)->getSystemList('test') ); } /** * @expectedException Horde_Kolab_Storage_Exception */ public function testNoSystemUser() { $this->assertInstanceOf( 'Horde_Kolab_Storage_List', $this->createStorage()->getSystemList('test') ); } private function _getSystemStorage($params) { $factory = new Horde_Kolab_Storage_Factory( array( 'driver' => 'mock', 'params' => array( 'username' => 'test@example.com', 'host' => 'localhost', 'port' => 143, 'data' => array() ) ) ); return $this->createStorage(null, $factory, $params); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/AllTests.php0000664000175000017500000000013212207101545022370 0ustar janjanrun(); Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/AttachmentTest.php0000664000175000017500000000735612207101545023604 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Test the handling of attachments. * * Copyright 2008-2013 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. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_AttachmentTest extends PHPUnit_Framework_TestCase { /** * Test setup. * * @return NULL */ public function setUp() { $this->markTestIncomplete('Broken test, prepareBasicSetup() doesn\'t exist'); $world = $this->prepareBasicSetup(); $this->storage = $this->authenticate($world['auth'], 'wrobel@example.org', 'none'); $this->folder = $this->prepareNewFolder($this->storage, 'Contacts', 'contact', true); } /** * Test destruction. */ public function tearDown() { if ($this->storage) { $this->storage->clean(); } } /** * Test storing attachments. * * @return NULL */ public function testCacheAttachmentInFile() { $data = new Horde_Kolab_Storage_Data('contact'); $data->setFolder($this->folder); $atc1 = Horde_Util::getTempFile(); $fh = fopen($atc1, 'w'); fwrite($fh, 'test'); fclose($fh); $object = array('uid' => '1', 'full-name' => 'User Name', 'email' => 'user@example.org', 'inline-attachment' => array('test.txt'), '_attachments' => array('test.txt'=> array('type' => 'text/plain', 'path' => $atc1, 'name' => 'test.txt'))); $result = $data->save($object); $this->assertNoError($result); $result = $data->getObject(1); $this->assertNoError($result); $this->assertTrue(isset($result['_attachments']['test.txt'])); // @todo: what introduces the \r? $this->assertEquals("test\r", $data->getAttachment($result['_attachments']['test.txt']['key'])); } /** * Test storing attachments. * * @return NULL */ public function testCacheAttachmentAsContent() { $data = new Horde_Kolab_Storage_Data('contact'); $data->setFolder($this->folder); $object = array('uid' => '1', 'full-name' => 'User Name', 'email' => 'user@example.org', 'inline-attachment' => array('test.txt'), '_attachments' => array('test.txt'=> array('type' => 'text/plain', 'content' => 'test', 'name' => 'test.txt'))); $result = $data->save($object); $this->assertNoError($result); $result = $data->getObject(1); $this->assertNoError($result); $this->assertTrue(isset($result['_attachments']['test.txt'])); $this->assertEquals("test\r", $data->getAttachment($result['_attachments']['test.txt']['key'])); } } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Autoload.php0000664000175000017500000000101412207101545022405 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** Load the basic test definition */ require_once __DIR__ . '/TestCase.php'; /** Load stub definitions */ require_once __DIR__ . '/Stub/DataQuery.php'; require_once __DIR__ . '/Stub/Driver.php'; Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/bootstrap.php0000664000175000017500000000014312207101545022654 0ustar janjan ../../../../lib Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/Scenario.php0000664000175000017500000003015012207101545022403 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Base for PHPUnit scenarios. * * Copyright 2008-2013 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. * * @category Kolab * @package Kolab_Test * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_Scenario extends Horde_Kolab_Server_Integration_Scenario { /** * Handle a "given" step. * * @param array &$world Joined "world" of variables. * @param string $action The description of the step. * @param array $arguments Additional arguments to the step. * * @return mixed The outcome of the step. */ public function runGiven(&$world, $action, $arguments) { switch ($action) { case 'an empty Kolab storage': $world['storage'] = $this->prepareEmptyKolabStorage(); break; case 'a Kolab setup': $result = $this->prepareKolabSetup(); $world['server'] = &$result['server']; $world['storage'] = &$result['storage']; $world['auth'] = &$result['auth']; break; case 'a populated Kolab setup': $result = $this->prepareBasicSetup(); $world['server'] = &$result['server']; $world['storage'] = &$result['storage']; $world['auth'] = &$result['auth']; break; default: return parent::runGiven($world, $action, $arguments); } } /** * Handle a "when" step. * * @param array &$world Joined "world" of variables. * @param string $action The description of the step. * @param array $arguments Additional arguments to the step. * * @return mixed The outcome of the step. */ public function runWhen(&$world, $action, $arguments) { switch($action) { case 'create a Kolab default calendar with name': $folder = $world['storage']->getNewFolder(); $folder->setName($arguments[0]); $world['folder_creation'] = $folder->save(array('type' => 'event', 'default' => true)); $folder->setACL(Auth::getAuth(), 'alrid'); break; case 'allow a group full access to a folder': $folder = $world['storage']->getFolder($arguments[1]); $folder->setACL($arguments[0], 'alrid'); break; case 'retrieving the list of shares for the application': $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($arguments[0], 'kolab'); $world['list'] = $shares->listShares(Auth::getAuth()); break; case 'logging in as a user with a password': $world['login'] = $world['auth']->authenticate($arguments[0], array('password' => $arguments[1])); $world['storage'] = $this->prepareEmptyKolabStorage(); return parent::runWhen($world, $action, $arguments); default: return parent::runWhen($world, $action, $arguments); } } /** * Handle a "then" step. * * @param array &$world Joined "world" of variables. * @param string $action The description of the step. * @param array $arguments Additional arguments to the step. * * @return mixed The outcome of the step. */ public function runThen(&$world, $action, $arguments) { switch($action) { case 'the creation of the folder was successful': $this->assertNoError($world['folder_creation']); break; case 'the list contains a share named': $this->assertNoError($world['list']); $this->assertContains($arguments[0], array_keys($world['list'])); break; default: return parent::runThen($world, $action, $arguments); } } /** * Prepare a Kolab server with some basic entries. * * @return Horde_Kolab_Server The empty server. */ public function &prepareBasicSetup() { $world = &$this->prepareKolabSetup(); $this->addBasicUsersToServer($world['server']); return $world; } /** * Prepare an empty Kolab storage. * * @return Horde_Kolab_Storage_List The empty storage. */ public function prepareEmptyKolabStorage($params = null) { /** Prepare a Kolab test storage */ if (empty($params)) { $params = array('driver' => 'Mock', 'username' => 'test', 'password' => 'test'); } $storage = Horde_Kolab_Storage::singleton('imap', $params); return $storage; } /** * Prepare the browser setup. * * @return NULL */ public function prepareBrowser() { /** Provide a browser setup */ $GLOBALS['browser'] = new Horde_Browser(); } protected function getConfiguration() { $data = <<getConfiguration(); fwrite($fh, "applications['horde'] = array( 'fileroot' => __DIR__ . '/..', 'webroot' => '/', 'initial_page' => 'login.php', 'name' => _("Horde"), 'status' => 'active', 'templates' => __DIR__ . '/../templates', 'provides' => 'horde', ); EOD; fwrite($fh, " 'Mock', 'username' => $username, 'password' => $password); $world['server'] = $this->getKolabMockServer(); $world['storage'] = $this->prepareEmptyKolabStorage($params); //$world['auth'] = $this->prepareKolabAuthDriver(); $this->prepareBasicConfiguration(); if (!defined('HORDE_BASE')) { define('HORDE_BASE', $this->provideHordeBase()); } if (!file_exists(HORDE_BASE . '/config')) { $result = mkdir(HORDE_BASE . '/config', 0755, true); } /* Ensure that we send no heders when the session is started */ ini_set('session.use_cookies', 0); ini_set('session.use_only_cookies', 0); $this->prepareConfiguration(); $this->prepareRegistry(); $this->prepareNotification(); /** Provide the horde registry */ $GLOBALS['registry'] = new Horde_Registry(); $this->prepareFixedConfiguration(); $this->prepareBrowser(); /* Make sure the configuration is correct after initializing the registry */ $this->prepareBasicConfiguration(); return $world; } /** * Fix the read configuration. * * @return NULL */ public function prepareFixedConfiguration() { $GLOBALS['registry']->importConfig('horde'); } /** * Prepare a basic Kolab configuration. * * @return NULL */ public function prepareBasicConfiguration() { /** We need a server name for MIME processing */ $_SERVER['SERVER_NAME'] = $this->provideServerName(); $_SERVER['SERVER_PORT'] = 80; $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; } /** * Create a new folder. * * @param string $name Name of the new folder. * @param string $type Type of the new folder. * @param boolean $default Should the new folder be a default folder? * * @return Kolab_Folder The new folder. */ public function prepareNewFolder(&$storage, $name, $type, $default = false) { $folder = $storage->getNewFolder(); $folder->setName($name); $this->assertNoError($folder->save(array('type' => $type, 'default' => $default))); return $folder; } function provideServerName() { return 'localhost'; } function provideHordeBase() { return Horde::getTempDir() . '/test_config'; } public function authenticate(Horde_Auth_Base $auth, $username = 'test', $password = 'test') { $this->assertTrue($auth->authenticate($username, array('password' => $password))); $params = array('driver' => 'Mock', 'username' => $username, 'password' => $password); return $this->prepareEmptyKolabStorage($params); } } /* Stand-in functions if gettext is not available. */ if (!function_exists('_')) { function _($string) { return $string; } } if (!function_exists('ngettext')) { function ngettext($msgid1, $msgid2, $n) { return $n > 1 ? $msgid2 : $msgid1; } } if (!function_exists('bindtextdomain')) { function bindtextdomain() {} } if (!function_exists('textdomain')) { function textdomain() {} } Horde_Kolab_Storage-2.0.5/test/Horde/Kolab/Storage/TestCase.php0000664000175000017500000005110612207101545022357 0ustar janjan * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ /** * Basic test case. * * Copyright 2010-2013 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license instorageion (LGPL). If you * did not receive this file, see http://www.horde.org/licenses/lgpl21. * * @category Kolab * @package Kolab_Storage * @subpackage UnitTests * @author Gunnar Wrobel * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ class Horde_Kolab_Storage_TestCase extends PHPUnit_Framework_TestCase { public function setUp() { $_SESSION = array(); } public function tearDown() { $_SESSION = array(); } protected function completeFactory($factory = null) { if ($factory === null) { return new Horde_Kolab_Storage_Factory(); } return $factory; } protected function createStorage( $driver = null, $factory = null, $params = array() ) { $factory = $this->completeFactory($factory); if ($driver === null) { $driver = new Horde_Kolab_Storage_Driver_Mock($factory); } return new Horde_Kolab_Storage_Uncached( $driver, new Horde_Kolab_Storage_QuerySet_Uncached($factory), $factory, $this->getMock('Horde_Kolab_Storage_Cache', array(), array(), '', false, false), $this->getMock('Horde_Log_Logger'), $params ); } protected function createCachedStorage($driver = null, $factory = null) { $factory = $this->completeFactory($factory); if ($driver === null) { $driver = new Horde_Kolab_Storage_Driver_Mock( $factory, array('username' => 'test', 'host' => 'localhost', 'port' => 143) ); } $cache = $this->getMockCache(); return new Horde_Kolab_Storage_Cached( $driver, new Horde_Kolab_Storage_QuerySet_Cached($factory, array(), $cache), $factory, $cache, $this->getMock('Horde_Log_Logger') ); } protected function getNullMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, array('username' => 'test', 'host' => 'localhost', 'port' => 143) ); } protected function getNullList($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Base( $this->getNullMock($factory), $factory ); } protected function getNullQuery($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Query_List_Base( $this->getNullMock($factory), new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } protected function getEmptyMock() { return new Horde_Kolab_Storage_Driver_Mock( new Horde_Kolab_Storage_Factory(), $this->getEmptyAccount() ); } protected function getEmptyAccount() { return array( 'username' => 'test@example.com', 'data' => array() ); } protected function getTwoFolderAccount() { return array( 'username' => 'test@example.com', 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/a' => null ) ) ); } protected function getTwoFolderMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getTwoFolderAccount() ); } protected function getTwoFolderList() { $factory = new Horde_Kolab_Storage_Factory(); return new Horde_Kolab_Storage_List_Base( $this->getTwoFolderMock($factory), $factory ); } protected function getAnnotatedAccount() { return array( 'username' => 'test@example.com', 'host' => 'localhost', 'port' => 143, 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/a' => null, 'user/test/Calendar' => array('t' => 'event.default'), 'user/test/Contacts' => array('t' => 'contact.default'), 'user/test/Notes' => array('t' => 'note.default'), 'user/test/Tasks' => array('t' => 'task.default'), ) ) ); } protected function getAnnotatedMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getAnnotatedAccount() ); } protected function getAnnotatedList($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Base( $this->getAnnotatedMock($factory), $factory ); } protected function getAnnotatedQueriableList($factory = null) { $factory = $this->completeFactory($factory); $list = $this->getAnnotatedList($factory); $list->registerQuery( Horde_Kolab_Storage_List::QUERY_BASE, new Horde_Kolab_Storage_List_Query_List_Base( $list, array('factory' => $factory) ) ); return $list; } protected function getCachedAnnotatedQueriableList($factory = null) { $factory = $this->completeFactory($factory); $list = new Horde_Kolab_Storage_List_Decorator_Cache( $this->getAnnotatedList($factory), $this->getMockListCache(), $factory ); $list->registerQuery( Horde_Kolab_Storage_List::QUERY_BASE, new Horde_Kolab_Storage_List_Query_List_Base( $list, array('factory' => $factory) ) ); return $list; } protected function getAnnotatedQuery($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Query_List_Base( $this->getAnnotatedMock($factory), new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } protected function getGermanAnnotatedAccount() { return array( 'username' => 'test@example.com', 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/Test' => null, 'user/test/Kalender' => array('t' => 'event.default'), 'user/test/Kontakte' => array('t' => 'contact.default'), 'user/test/Notizen' => array('t' => 'note.default'), 'user/test/Aufgaben' => array('t' => 'task.default'), ) ) ); } protected function getGermanAnnotatedMock() { return new Horde_Kolab_Storage_Driver_Mock( new Horde_Kolab_Storage_Factory(), $this->getGermanAnnotatedAccount() ); } protected function getNamespaceAccount() { return array( 'username' => 'test@example.com', 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/a' => null, 'user/test/Calendar' => array('t' => 'event.default'), 'user/test/Contacts' => array('t' => 'contact.default'), 'user/test/Notes' => array('t' => 'note.default'), 'user/test/Tasks' => array('t' => 'task.default'), 'user/example/Notes' => array('t' => 'note.default'), 'user/example/Calendar' => array('t' => 'event.default'), 'user/someone/Calendars/Events' => array('t' => 'event.default'), 'user/someone/Calendars/Party' => array('t' => 'event'), 'shared.Calendars/All' => array('t' => 'event'), 'shared.Calendars/Others' => array('t' => 'event'), ) ) ); } protected function getNamespaceMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getNamespaceAccount() ); } protected function getNamespaceList($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Base( $this->getNamespaceMock($factory), $factory ); } protected function getNamespaceQueriableList($factory = null) { $factory = $this->completeFactory($factory); $list = $this->getNamespaceList($factory); $list->registerQuery( Horde_Kolab_Storage_List::QUERY_BASE, new Horde_Kolab_Storage_List_Query_List_Base( $list, array('factory' => $factory) ) ); return $list; } protected function getNamespaceQuery($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Query_List_Base( $this->getNamespaceMock($factory), new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } protected function getForeignDefaultAccount() { return array( 'username' => 'test@example.com', 'data' => $this->getMockData( array( 'user/test' => null, 'user/example/Calendar' => array('t' => 'event.default'), 'user/someone/Calendars/Events' => array('t' => 'event.default'), ) ) ); } protected function getForeignDefaultMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getForeignDefaultAccount() ); } protected function getForeignDefaultList($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Base( $this->getForeignDefaultMock($factory), $factory ); } protected function getForeignDefaultQuery($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Query_List_Base( $this->getForeignDefaultMock($factory), new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } protected function getEventAccount() { return array( 'username' => 'test@example.com', 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/Calendar' => array('t' => 'event'), 'user/test/Events' => array('t' => 'event.default'), 'user/test/Notes' => array('t' => 'note.default'), 'user/someone/Calendar' => array('t' => 'event.default'), 'user/someone/Events' => array('t' => 'event'), 'user/someone/Notes' => array('t' => 'note.default'), ) ) ); } protected function getEventMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getEventAccount() ); } protected function getEventList($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Base( $this->getEventMock($factory), $factory ); } protected function getEventQuery($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Query_List_Base( $this->getEventMock($factory), new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } protected function getDoubleEventAccount() { return array( 'username' => 'test@example.com', 'data' => $this->getMockData( array( 'user/test' => null, 'user/test/Calendar' => array('t' => 'event.default'), 'user/test/Events' => array('t' => 'event.default'), 'user/someone/Calendar' => array('t' => 'event.default'), 'user/someone/Events' => array('t' => 'event.default'), ) ) ); } protected function getDoubleEventMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getDoubleEventAccount() ); } protected function getDoubleEventList($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Base( $this->getDoubleEventMock($factory), $factory ); } protected function getDoubleEventQuery($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_List_Query_List_Base( $this->getDoubleEventMock($factory), new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ); } protected function getDataAccount($additional_folders) { return array( 'username' => 'test@example.com', 'host' => 'localhost', 'port' => 143, 'data' => $this->getMockData( array_merge( array( 'user/test' => null, 'user/test/a' => null, 'user/test/Test' => array('m' => array()), 'user/test/Empty' => array('m' => array()), 'user/test/ÄÖÜ' => array('m' => array()), 'user/test/Pretend' => array('m' => array(1 => array())), 'user/test/Contacts' => array('t' => 'contact.default'), 'user/test/Notes' => array('t' => 'note.default'), 'user/test/OtherNotes' => array('t' => 'note'), 'user/test/Tasks' => array('t' => 'task.default'), ), $additional_folders ) ) ); } protected function getMessageAccount() { return $this->getDataAccount( array( 'user/test/WithDeleted' => array( 'm' => array( 1 => array( 'flags' => Horde_Kolab_Storage_Driver_Mock_Data::FLAG_DELETED ), 4 => array() ), 's' => array( 'uidvalidity' => '12346789', 'uidnext' => 5 ) ), 'user/test/Calendar' => array( 't' => 'event.default', 'm' => array( 1 => $this->getDefaultEventData('.1'), 2 => $this->getDefaultEventData('.2'), 3 => array( 'flags' => Horde_Kolab_Storage_Driver_Mock_Data::FLAG_DELETED ), 4 => $this->getDefaultEventData('.3'), ), 's' => array( 'uidvalidity' => '12346789', 'uidnext' => 5 ) ) ) ); } protected function getMessageMock($factory = null) { $factory = $this->completeFactory($factory); return new Horde_Kolab_Storage_Driver_Mock( $factory, $this->getMessageAccount() ); } protected function getDataStorage( $data, $params = array() ) { $factory = new Horde_Kolab_Storage_Factory( array_merge( array( 'driver' => 'mock', 'params' => $data, 'logger' => $this->getMock('Horde_Log_Logger'), ), $params ) ); return $factory->create(); } protected function getMessageStorage( $params = array() ) { return $this->getDataStorage( $this->getMessageAccount(), $params ); } protected function getCachedQueryForList($driver) { return new Horde_Kolab_Storage_List_Query_List_Cache( new Horde_Kolab_Storage_List_Query_List_Cache_Synchronization( $driver, new Horde_Kolab_Storage_Folder_Types(), new Horde_Kolab_Storage_List_Query_List_Defaults_Bail() ), $this->getMockListCache() ); } protected function getMockDriverList($factory = null) { $factory = $this->completeFactory($factory); $this->mockDriver = $this->getMock('Horde_Kolab_Storage_Driver'); return new Horde_Kolab_Storage_List_Base( $this->mockDriver, new Horde_Kolab_Storage_Factory() ); } protected function getMockLogger() { $this->logHandler = new Horde_Log_Handler_Mock(); return new Horde_Log_Logger($this->logHandler); } protected function getMockCache() { return new Horde_Kolab_Storage_Cache(new Horde_Cache(new Horde_Cache_Storage_Mock())); } protected function getMockListCache() { $cache = new Horde_Kolab_Storage_List_Cache( $this->getMockCache(), array( 'host' => 'localhost', 'port' => '143', 'user' => 'user', ) ); return $cache; } protected function getMockDataCache() { $cache = $this->getMockCache()->getDataCache( array( 'host' => 'localhost', 'port' => '143', 'owner' => 'test', 'prefix' => 'INBOX', 'folder' => 'Calendar', 'type' => 'event', ) ); $cache->setDataId('test'); return $cache; } protected function assertLogCount($count) { $this->assertEquals(count($this->logHandler->events), $count); } protected function assertLogContains($message) { $messages = array(); $found = false; foreach ($this->logHandler->events as $event) { if (strstr($event['message'], $message) !== false) { $found = true; break; } $messages[] = $event['message']; } $this->assertTrue($found, sprintf("Did not find \"%s\" in [\n%s\n]", $message, join("\n", $messages))); } protected function assertLogRegExp($regular_expression) { $found = false; foreach ($this->logHandler->events as $event) { if (preg_match($regular_expression, $event['message'], $matches) !== false) { $found = true; break; } } $this->assertTrue($found); } protected function getMockData($elements) { $elements['format'] = 'brief'; return new Horde_Kolab_Storage_Driver_Mock_Data($elements); } protected function getDefaultEventData($add = '') { return array( 'structure' => __DIR__ . '/fixtures/event.struct', 'parts' => array( '2' => array( 'file' => __DIR__ . '/fixtures/event' . $add . '.xml.qp', ) ) ); } }