summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_ldap.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-01 21:11:08 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-02 16:46:29 +0200
commit6ac9395fbd8fed837d4f40501e4e6cd089243b96 (patch)
tree09c6bef202e4c9083ee431eeef572b33ffed4a2e /program/lib/Roundcube/rcube_ldap.php
parent6c1c60f3b908aa922a46cbae94a03eb162147b70 (diff)
Use Net_LDAP3
Diffstat (limited to 'program/lib/Roundcube/rcube_ldap.php')
-rw-r--r--program/lib/Roundcube/rcube_ldap.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 5a4b9dd61..7fdcbc806 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -232,8 +232,7 @@ class rcube_ldap extends rcube_addressbook
// initialize ldap wrapper object
$this->ldap = new rcube_ldap_generic($this->prop);
- $this->ldap->set_cache($this->cache);
- $this->ldap->set_debug($this->debug);
+ $this->ldap->config_set(array('cache' => $this->cache, 'debug' => $this->debug));
$this->_connect();
}
@@ -320,8 +319,7 @@ class rcube_ldap extends rcube_addressbook
// we need to use a separate LDAP connection
if (!empty($this->prop['vlv'])) {
$ldap = new rcube_ldap_generic($this->prop);
- $ldap->set_debug($this->debug);
- $ldap->set_cache($this->cache);
+ $ldap->config_set(array('cache' => $this->cache, 'debug' => $this->debug));
if (!$ldap->connect($host)) {
continue;
}
@@ -1066,7 +1064,7 @@ class rcube_ldap extends rcube_addressbook
}
}
- if (!$this->ldap->add($dn, $newentry)) {
+ if (!$this->ldap->add_entry($dn, $newentry)) {
$this->set_error(self::ERROR_SAVING, 'errorsaving');
return false;
}
@@ -1078,7 +1076,7 @@ class rcube_ldap extends rcube_addressbook
'objectClass' => (array) $this->prop['sub_fields'][$xidx],
);
- $this->ldap->add($xdn, $xf);
+ $this->ldap->add_entry($xdn, $xf);
}
$dn = self::dn_encode($dn);
@@ -1221,7 +1219,7 @@ class rcube_ldap extends rcube_addressbook
if (!empty($subdeldata)) {
foreach ($subdeldata as $fld => $val) {
$subdn = $fld.'='.rcube_ldap_generic::quote_string($val).','.$dn;
- if (!$this->ldap->delete($subdn)) {
+ if (!$this->ldap->delete_entry($subdn)) {
return false;
}
}
@@ -1265,7 +1263,7 @@ class rcube_ldap extends rcube_addressbook
$fld => $val,
'objectClass' => (array) $this->prop['sub_fields'][$fld],
);
- $this->ldap->add($subdn, $xf);
+ $this->ldap->add_entry($subdn, $xf);
}
}
@@ -1295,7 +1293,7 @@ class rcube_ldap extends rcube_addressbook
if ($this->sub_filter) {
if ($entries = $this->ldap->list_entries($dn, $this->sub_filter)) {
foreach ($entries as $entry) {
- if (!$this->ldap->delete($entry['dn'])) {
+ if (!$this->ldap->delete_entry($entry['dn'])) {
$this->set_error(self::ERROR_SAVING, 'errorsaving');
return false;
}
@@ -1304,12 +1302,12 @@ class rcube_ldap extends rcube_addressbook
}
// Delete the record.
- if (!$this->ldap->delete($dn)) {
+ if (!$this->ldap->delete_entry($dn)) {
$this->set_error(self::ERROR_SAVING, 'errorsaving');
return false;
}
- // remove contact from all groups where he was member
+ // remove contact from all groups where he was a member
if ($this->groups) {
$dn = self::dn_encode($dn);
$group_ids = $this->get_record_groups($dn);
@@ -1342,7 +1340,7 @@ class rcube_ldap extends rcube_addressbook
if ($with_groups && $this->groups && ($groups = $this->_fetch_groups()) && count($groups)) {
foreach ($groups as $group) {
- $this->ldap->delete($group['dn']);
+ $this->ldap->delete_entry($group['dn']);
}
if ($this->cache) {
@@ -1567,7 +1565,7 @@ class rcube_ldap extends rcube_addressbook
$this->debug = $dbg;
if ($this->ldap) {
- $this->ldap->set_debug($dbg);
+ $this->ldap->config_set('debug', $dbg);
}
}
@@ -1666,7 +1664,7 @@ class rcube_ldap extends rcube_addressbook
}
$ldap = clone $this->ldap;
- $ldap->set_config($this->prop['groups']);
+ $ldap->config_set($this->prop['groups']);
$ldap->set_vlv_page($vlv_page+1, $page_size);
}
@@ -1790,7 +1788,7 @@ class rcube_ldap extends rcube_addressbook
$member_attr => '',
);
- if (!$this->ldap->add($new_dn, $new_entry)) {
+ if (!$this->ldap->add_entry($new_dn, $new_entry)) {
$this->set_error(self::ERROR_SAVING, 'errorsaving');
return false;
}
@@ -1813,7 +1811,7 @@ class rcube_ldap extends rcube_addressbook
$group_cache = $this->_fetch_groups();
$del_dn = $group_cache[$group_id]['dn'];
- if (!$this->ldap->delete($del_dn)) {
+ if (!$this->ldap->delete_entry($del_dn)) {
$this->set_error(self::ERROR_SAVING, 'errorsaving');
return false;
}