diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 200d76289a94980aa22079a57b0da1b0b4564990..234fc2ded13bf77ad21dc7f572a71e3a05fede22 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -588,7 +588,8 @@ class LDAP if ($this->reconnect) { $this->connect(); } - $r = ldap_rename($this->cid, $source, $dest_rdn, $parent, FALSE); + /* We have to pass TRUE as deleteoldrdn in case the attribute is single-valued */ + $r = ldap_rename($this->cid, $source, $dest_rdn, $parent, TRUE); $this->error = ldap_error($this->cid); /* Check if destination dn exists, if not the diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index 471662414793b2fcfd63159b190d602724881a40..2fc769a088549df91a70e14ba095a819c97dc946 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -576,6 +576,8 @@ class simplePlugin * \param string $src_dn the source DN. * * \param string $dst_dn the destination DN. + * + * \return TRUE on success, error string on failure */ function move($src_dn, $dst_dn) { @@ -595,7 +597,7 @@ class simplePlugin "FROM: $src_dn -- TO: $dst_dn", array(), $ldap->get_error()); @DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, "Rename failed FROM: $src_dn -- TO: $dst_dn", 'Ldap Protocol v3 implementation error. Error:'.$ldap->get_error()); - return FALSE; + return $ldap->get_error(); } /* Update userinfo if necessary */ diff --git a/include/simpleplugin/class_simpleTabs.inc b/include/simpleplugin/class_simpleTabs.inc index 54f6246036c9ac650aadf5695cd75b2f4a6a8ee0..bfe432fd5fbcd61d2e37b05392b204aa98c07d37 100644 --- a/include/simpleplugin/class_simpleTabs.inc +++ b/include/simpleplugin/class_simpleTabs.inc @@ -394,10 +394,11 @@ class simpleTabs /* use the new one */ $this->dn = $new_dn; } else { - if ($baseobject->move($this->dn, $new_dn)) { + if (($error = $baseobject->move($this->dn, $new_dn)) === TRUE) { $this->dn = $new_dn; } else { - $errors[] = sprintf(_('Move from "%s" to "%s" failed'), $this->dn, $new_dn); + $errors[] = sprintf(_('Move from "%s" to "%s" failed: %s'), $this->dn, $new_dn, $error); + return $errors; } } }