summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-01-17 11:27:23 (GMT)
committerAleksander Machniak <alec@alec.pl>2014-01-17 11:28:30 (GMT)
commit0cac630e64fa6b4c77578d3b57015eeabd2e0d7b (patch)
tree79cfe9c0308a129231993044e478073b0b1401fd
parent62f17678edda693f0d7cdd929911f118e5c6b0a5 (diff)
downloadkolab-wap-0cac630e64fa6b4c77578d3b57015eeabd2e0d7b.tar.gz
Fix deleting domain alias (Bug #2778)
-rw-r--r--lib/ext/Net/LDAP3.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/ext/Net/LDAP3.php b/lib/ext/Net/LDAP3.php
index 9a4ecb2..e10faf8 100644
--- a/lib/ext/Net/LDAP3.php
+++ b/lib/ext/Net/LDAP3.php
@@ -1253,7 +1253,7 @@ class Net_LDAP3
$_sort2 = false;
}
- if (!($new_attrs[$attr] === $old_attr_value) && !($_sort1 === $_sort2)) {
+ if ($new_attrs[$attr] !== $old_attr_value && $_sort1 !== $_sort2) {
$this->_debug("Attribute $attr changed from " . var_export($old_attr_value, true) . " to " . var_export($new_attrs[$attr], true));
if ($attr === $rdn_attr) {
$this->_debug("This attribute is the RDN attribute. Let's see if it is multi-valued, and if the original still exists in the new value.");
@@ -1275,14 +1275,13 @@ class Net_LDAP3
$this->_debug("Adding to delete attribute $attr values:" . implode(', ', $_attr_to_remove));
- $mod_array['delete'][$attr] = $_attr_to_remove;
+ $mod_array['del'][$attr] = $_attr_to_remove;
if (strtolower($new_attrs[$attr]) !== strtolower($rdn_attr_value)) {
$this->_debug("new attrs is not the same as the old rdn value, issuing a rename");
$mod_array['rename']['dn'] = $subject_dn;
$mod_array['rename']['new_rdn'] = $rdn_attr . '=' . $new_attrs[$attr][0];
}
-
} else {
$this->_debug("new attrs is not the same as any of the old rdn value, issuing a full rename");
$mod_array['rename']['dn'] = $subject_dn;
@@ -1291,13 +1290,13 @@ class Net_LDAP3
} else {
// TODO: See if the rdn attr. value is still in $new_attrs[$attr]
if (in_array($old_attrs[$attr][0], $new_attrs[$attr])) {
- $this->_debug("Simply replacing attr $attr as rnd attr value is preserved.");
+ $this->_debug("Simply replacing attr $attr as rdn attr value is preserved.");
$mod_array['replace'][$attr] = $new_attrs[$attr];
} else {
// TODO: This fails.
$mod_array['rename']['dn'] = $subject_dn;
$mod_array['rename']['new_rdn'] = $rdn_attr . '=' . $new_attrs[$attr][0];
- $mod_array['delete'][$attr] = $old_attrs[$attr][0];
+ $mod_array['del'][$attr] = $old_attrs[$attr][0];
}
}
} else {
@@ -2229,7 +2228,6 @@ class Net_LDAP3
}
}
-
if (is_array($attributes['add']) && !empty($attributes['add'])) {
$this->_debug("LDAP: C: Mod-Add $subject_dn: " . json_encode($attributes['add']));