www/admin

Bogomil Shopov shopov at kolabsys.com
Mon Apr 18 13:29:06 CEST 2011


 www/admin/user/user.php |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 6af61f8c3c46aa032a1f0bb7ff70e939ca4f0454
Author: Bogomil Shopov <shopov at kolabsys.com>
Date:   Mon Apr 18 14:28:22 2011 +0300

    Fixing the UID bug. See : https://bugzilla.kolabsys.com/show_bug.cgi?id=75

diff --git a/www/admin/user/user.php b/www/admin/user/user.php
index 7c00de3..f99d6e1 100644
--- a/www/admin/user/user.php
+++ b/www/admin/user/user.php
@@ -2,6 +2,7 @@
 /*
  (c) 2004-2006 Klaraelvdalens Datakonsult AB
  (c) 2004 Martin Konold erfrakon <martin.konold at erfrakon.de>
+ (c) 2010 Bogomil Shopov <shopov at kolabsys.com>
  This program is Free Software under the GNU General Public License (>=v2).
  Read the file COPYING that comes with this packages for details.
 */
@@ -662,6 +663,9 @@ switch( $action ) {
 	   
        if ($action == "save") {
 		 if (!$errors) {
+		 	//we need unmodified uid for renaming.
+		 	$newid="uid=".$ldap->dn_escape($ldap_object['uid']);
+			
 		   if (!empty($ldap_object['cn'])) $newdn = "cn=".$ldap->dn_escape($ldap_object['cn']).",".$domain_dn;
 		   else $newdn = $dn;
 		   if (strcmp($dn,$newdn) != 0) {
@@ -674,7 +678,7 @@ 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];
+			   //$ldap_object['uid'] = $oldattrs['uid'][0];
 			   $ldap_object['mail'] = $oldattrs['mail'][0];
 			   unset( $oldattrs['count'] );
 			   foreach( $oldattrs as $k => $v ) {





More information about the commits mailing list