From: hickert Date: Wed, 31 Aug 2005 12:42:22 +0000 (+0000) Subject: Added fix for X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=930ba8251fc0c3b776d1dce8088943f888e863e3;p=gosa.git Added fix for Trying to overwrite cn=****,ou=people,...,dc=de, which already exists. View file comments for description. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1270 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/users/tabs_user.inc b/plugins/admin/users/tabs_user.inc index 451d9f973..f19f5b856 100644 --- a/plugins/admin/users/tabs_user.inc +++ b/plugins/admin/users/tabs_user.inc @@ -84,7 +84,20 @@ class usertabs extends tabs $new_dn= "cn=".$baseobject->givenName." ".$baseobject->sn.','. get_people_ou().$baseobject->base; } - + + /* Hickert: 31.08.2005 + * fixed error = Trying to overwrite cn=*** which already exists. + * If you changed one of the "Name" / "Givenname" attributes to lower or upper case, like "test" to "Test", (in DNMODE=cn) + * the old_dn and new dn were different. cn=test ... cn=Test ... + * The following code decided to move the entry from old_dn to new_dn. (Because they differ) + * But the ldap functions are not case sensitive and so the function plugin::move() quits with + * an error, because source and destination dn are both the same (for ldap, but not for php). + * This fix allow you to change the givenname or name attributes. + */ + if(strtolower($this->dn)==strtolower($new_dn)){ + $this->dn=$new_dn; + } + if ($this->dn != $new_dn){ /* Write entry on new 'dn' */ @@ -99,6 +112,7 @@ class usertabs extends tabs $this->dn= $new_dn; } } + print_a($this); return tabs::save(); }