Page MenuHomePhorge

LDAPResources.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

LDAPResources.php

<?php
/**
* CardDAV Directory class providing read-only access
* to an LDAP-based resources address book.
*/
namespace Kolab\CardDAV;
use \rcube;
use Sabre\CardDAV;
class LDAPResources extends LDAPDirectory
{
const DIRECTORY_NAME = 'ldap-resources';
/**
* Default constructor
*/
function __construct($config, $principalUri, $carddavBackend = null)
{
$this->config = $config;
$this->principalUri = $principalUri;
$this->addressBookInfo = array(
'id' => self::DIRECTORY_NAME,
'uri' => self::DIRECTORY_NAME,
'{DAV:}displayname' => $config['name'] ?: "LDAP Resources",
'{urn:ietf:params:xml:ns:carddav}supported-address-data' => new CardDAV\Xml\Property\SupportedAddressData(),
'principaluri' => $principalUri,
);
// used for vcard serialization
$this->carddavBackend = $carddavBackend ?: new ContactsBackend();
$this->carddavBackend->ldap_resources = $this;
// initialize cache. We need a different address space from GAL
// so don't mix our caches
$rcube = rcube::get_instance();
if ($rcube->config->get('kolabdav_res_cache')) {
$this->cache = $rcube->get_cache_shared('kolabdav_res');
// expunge cache every now and then
if (rand(0,10) === 0) {
$this->cache->expunge();
}
}
}
/**
* Returns the name of the node.
*
* This is used to generate the url.
*
* @return string
*/
function getName()
{
return self::DIRECTORY_NAME;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Apr 4, 1:37 AM (1 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7a/12/f1d19c062276a94e0ae40cfddd96
Default Alt Text
LDAPResources.php (1 KB)

Event Timeline