private $_params;
/**
+ * Memory cache for the namespace of this driver.
+ *
+ * @var Horde_Kolab_Storage_Folder_Namespace
+ */
+ protected $_namespace;
+
+ /**
* Constructor.
*
* @param Horde_Kolab_Storage_Factory $factory A factory for helper objects.
*/
public function getNamespace()
{
- if (isset($this->_params['namespaces'])) {
- return $factory->createNamespace(
- 'config', $this->_params['namespaces']
- );
+ if ($this->_namespace === null) {
+ if (isset($this->_params['namespaces'])) {
+ $this->_namespace = $this->_factory->createNamespace(
+ 'config', $this->_params['namespaces']
+ );
+ } else {
+ $this->_namespace = $this->_factory->createNamespace('fixed');
+ }
}
- return $this->_factory->createNamespace('fixed');
+ return $this->_namespace;
}
}
\ No newline at end of file
if ($this->_imap->queryCapability('ACL') === true) {
if ($folder->getOwner() == $this->getAuth()) {
try {
- return $this->_getAcl($folder->getName());
+ return $this->_getAcl($folder->getPath());
} catch (Exception $e) {
- return array($this->getAuth() => $this->_getMyAcl($folder->getName()));
+ return array($this->getAuth() => $this->_getMyAcl($folder->getPath()));
}
} else {
- $acl = $this->_getMyAcl($folder->getName());
+ $acl = $this->_getMyAcl($folder->getPath());
if (strpos($acl, 'a')) {
try {
- return $this->_getAcl($folder->getName());
+ return $this->_getAcl($folder->getPath());
} catch (Exception $e) {
}
}
*/
public function getNamespace()
{
- if ($this->_imap->queryCapability('NAMESPACE') === true) {
+ if ($this->_namespace === null
+ && $this->_imap->queryCapability('NAMESPACE') === true) {
$c = array();
$configuration = $this->getParam('namespaces', array());
foreach ($this->_imap->getNamespaces() as $namespace) {
}
$c[] = $namespace;
}
- return $this->getFactory()->createNamespace('imap', $c);
+ $this->_namespace = $this->getFactory()->createNamespace('imap', $c);
}
return parent::getNamespace();
}