summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/admin/user/user.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/www/admin/user/user.php b/www/admin/user/user.php
index 7ba9d27..7d757f2 100644
--- a/www/admin/user/user.php
+++ b/www/admin/user/user.php
@@ -662,6 +662,9 @@ switch( $action ) {
if ($action == "save") {
if (!$errors) {
+ // We need the unmodified uid rdn for renaming
+ $new_uid = "uid=" . $ldap->dn_escape($ldap_object['uid']);
+
if (!empty($ldap_object['uid'])) $newdn = "uid=".$ldap->dn_escape($ldap_object['uid']).",".$domain_dn;
else $newdn = $dn;
if (strcmp($dn,$newdn) != 0) {
@@ -674,7 +677,10 @@ switch( $action ) {
if (($result=ldap_read($ldap->connection,$dn,"(objectclass=*)")) &&
($entry=ldap_first_entry($ldap->connection,$result)) &&
($oldattrs=ldap_get_attributes($ldap->connection,$entry))) {
- $ldap_object['uid'] = $oldattrs['uid'][0];
+
+ // This is no longer necessary.
+ //$ldap_object['uid'] = $oldattrs['uid'][0];
+
$ldap_object['mail'] = $oldattrs['mail'][0];
unset( $oldattrs['count'] );
foreach( $oldattrs as $k => $v ) {