Changeset View
Changeset View
Standalone View
Standalone View
lib/Kolab/CardDAV/UserAddressBooks.php
Context not available. | |||||
{ | { | ||||
// pseudo-singleton instance | // pseudo-singleton instance | ||||
private $ldap_directory; | private $ldap_directory; | ||||
private $ldap_resources; | |||||
/** | /** | ||||
* Returns a list of addressbooks | * Returns a list of addressbooks | ||||
Context not available. | |||||
$objs[] = $this->getLDAPDirectory(); | $objs[] = $this->getLDAPDirectory(); | ||||
} | } | ||||
if (rcube::get_instance()->config->get('kolabdav_ldap_resources')) { | |||||
$objs[] = $this->getLDAPResources(); | |||||
} | |||||
return $objs; | return $objs; | ||||
} | } | ||||
Context not available. | |||||
if ($name == LDAPDirectory::DIRECTORY_NAME) { | if ($name == LDAPDirectory::DIRECTORY_NAME) { | ||||
return $this->getLDAPDirectory(); | return $this->getLDAPDirectory(); | ||||
} | } | ||||
if ($name == LDAPResources::DIRECTORY_NAME) { | |||||
return $this->getLDAPResources(); | |||||
} | |||||
if ($addressbook = $this->carddavBackend->getAddressBookByName($name)) { | if ($addressbook = $this->carddavBackend->getAddressBookByName($name)) { | ||||
$addressbook['principaluri'] = $this->principalUri; | $addressbook['principaluri'] = $this->principalUri; | ||||
Context not available. | |||||
return $this->ldap_directory; | return $this->ldap_directory; | ||||
} | } | ||||
/** | |||||
* Getter for the singleton instance of the LDAP resources | |||||
*/ | |||||
private function getLDAPResources() | |||||
{ | |||||
if (!$this->ldap_resources) { | |||||
$rcube = rcube::get_instance(); | |||||
$config = $rcube->config->get('kolabdav_ldap_resources'); | |||||
$config['debug'] = $rcube->config->get('ldap_debug'); | |||||
$this->ldap_resources = new LDAPResources($config, $this->principalUri, $this->carddavBackend); | |||||
} | |||||
return $this->ldap_resources; | |||||
} | |||||
/** | /** | ||||
* Returns the list of properties | * Returns the list of properties | ||||
Context not available. |