class Horde_Group_Ldap extends Horde_Group
{
/**
- * LDAP object.
- *
- * @var Horde_Ldap
- */
- protected $_ldap;
-
- /**
* Local copy of the global $conf['group']['params'] array. Simply
* for coding convenience.
*
/* Generate LDAP search filter. */
$this->_filter = Horde_Ldap_Filter::build(isset($this->_params['search']) ? $this->_params['search'] : $this->_params);
-
- /* Connect to server. */
- $this->_ldap = new Horde_Ldap($this->_params);
}
/**
protected function _nextGid()
{
try {
- $search = $this->_ldap->search($this->_params['basedn'], $this->_filter, array('attributes' => array('gidnumber')));
+ $search = $this->_params['ldap']->search($this->_params['basedn'], $this->_filter, array('attributes' => array('gidnumber')));
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}
}
try {
- $entry = $this->_ldap->getEntry($dn);
+ $entry = $this->_params['ldap']->getEntry($dn);
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}
$dn = $group->get('dn');
$entry = Horde_Ldap_Entry::createFresh($dn, $group->toAttributes());
try {
- $this->_ldap->add($entry);
+ $this->_params['ldap']->add($entry);
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}
$force = false)
{
try {
- $this->_ldap->delete($group->getId(), $force);
+ $this->_params['ldap']->delete($group->getId(), $force);
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}
}
try {
- $search = $this->_ldap->search(
+ $search = $this->_params['ldap']->search(
$this->_params['basedn'],
Horde_Ldap_Filter::create($this->_params['gid'], 'equals', $group),
array('attributes' => array($this->_params['gid'])));
$this->_listCache = array();
try {
- $search = $this->_ldap->search($this->_params['basedn'], $this->_filter, array($this->_params['gid']));
+ $search = $this->_params['ldap']->search($this->_params['basedn'], $this->_filter, array($this->_params['gid']));
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}
}
try {
- $search = $this->_ldap->search($dn, $this->_filter);
+ $search = $this->_params['ldap']->search($dn, $this->_filter);
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}
// Perform search
try {
- $search = $this->_ldap->search($this->_params['basedn'], $filter);
+ $search = $this->_params['ldap']->search($this->_params['basedn'], $filter);
} catch (Horde_Ldap_Exception $e) {
throw new Horde_Group_Exception($e);
}