'attributes' => array('dn'), // List of attributes to read from the server
'attributes' => array('dn'), // List of attributes to read from the server
'vlv' => false, // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
'vlv' => false, // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
'sort' => array('cn'), // Sort attributes of the VLV index
'config_root_dn' => 'cn=config', // Root DN to read config (e.g. vlv indexes) from
'numsub_filter' => '(objectClass=organizationalUnit)', // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting
'numsub_filter' => '(objectClass=organizationalUnit)', // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting
'sizelimit' => '0', // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
'sizelimit' => '0', // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
'timelimit' => '0', // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
'timelimit' => '0', // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
@ -62,6 +62,7 @@ class rcube_ldap_generic
public $vlv_active = false;
public $vlv_active = false;
/** private properties */
/** private properties */
protected $cache = null;
protected $config = array();
protected $config = array();
protected $attributes = array('dn');
protected $attributes = array('dn');
protected $entries = null;
protected $entries = null;
@ -69,6 +70,7 @@ class rcube_ldap_generic
protected $debug = false;
protected $debug = false;
protected $list_page = 1;
protected $list_page = 1;
protected $page_size = 10;
protected $page_size = 10;
protected $vlv_config = null;
/**
/**
@ -114,6 +116,15 @@ class rcube_ldap_generic
$this->config[$opt] = $value;
$this->config[$opt] = $value;
}
}
/**
* Enable caching by passing an instance of rcube_cache to be used by this object
*
* @param object rcube_cache Instance or False to disable caching
*/
public function set_cache($cache_engine)
{
$this->cache = $cache_engine;
}
/**
/**
* Set properties for VLV-based paging
* Set properties for VLV-based paging
@ -350,7 +361,6 @@ class rcube_ldap_generic
* @param string $scope The LDAP scope (list|sub|base)
* @param string $scope The LDAP scope (list|sub|base)
* @param array $attrs List of entry attributes to read
* @param array $attrs List of entry attributes to read
* @param array $prop Hash array with query configuration properties:
* @param array $prop Hash array with query configuration properties:
* - vlv: true if VLV index should be used
* - sort: array of sort attributes (has to be in sync with the VLV index)
* - sort: array of sort attributes (has to be in sync with the VLV index)
* - search: search string used for VLV controls
* - search: search string used for VLV controls
* @param boolean $count_only Set to true if only entry count is requested
* @param boolean $count_only Set to true if only entry count is requested