Branch 'kolab-webadmin-3.1' - lib/ext

Aleksander Machniak machniak at kolabsys.com
Fri Jan 17 12:28:37 CET 2014


 lib/ext/Net/LDAP3.php |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 0cac630e64fa6b4c77578d3b57015eeabd2e0d7b
Author: Aleksander Machniak <alec at alec.pl>
Date:   Fri Jan 17 12:27:23 2014 +0100

    Fix deleting domain alias (Bug #2778)

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']));
 




More information about the commits mailing list