View Issue Details

IDProjectCategoryView StatusLast Update
0012835mantisbtldappublic2011-04-20 05:27
ReporterLibra Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version1.2.4 
Summary0012835: Removal of Real Name in some cases (using LDAP login method)
Description

After upgrading version from 1.1.x to 1.2.4 discovered one unpleasant feature - if you going to edit form for user, whose account was deleted on the LDAP server, user Real Name will be cleared (this happens because Mantis try automatically update information from the LDAP, which was not in previous versions).

I think it's not quite correct behavior of the system - the user can be deleted on the LDAP server (i.e. can't no longer login into the Mantis), but the story of his action in Mantis should be preserved.

Steps To Reproduce
  1. Login to Mantis as Admin
  2. Go to "Manage" and select "Manage Users"
  3. Select any user whose account has been deleted from LDAP (in my case it's all disabled users)
  4. In the "Edit User" form Real Name will be cleared
TagsNo tags attached.
Attached Files
ldap_api.diff (510 bytes)   
--- D:/Work/Mantis/Patches/Test/ldap_api.php.orig	Sat Feb 26 17:41:25 2011
+++ D:/Work/Mantis/Patches/Test/ldap_api.php	Fri Mar 04 01:36:39 2011
@@ -146,8 +146,8 @@
 
 	$t_ldap_realname_field	= config_get( 'ldap_realname_field' );
 	$t_realname = ldap_get_field_from_username( $p_username, $t_ldap_realname_field );
-	if ( $t_realname === null ) {
-		return '';
+    if ( $t_realname === null ) {
+		return user_get_field(user_get_id_by_name($p_username), 'realname');
 	}
 
 	return $t_realname;
ldap_api.diff (510 bytes)   

Activities

Libra

Libra

2011-03-03 18:00

reporter   ~0028363

To resolve this issue fairly when editing a user to keep its current name, rather than deleting it - created a small patch that solves this problem.

dregad

dregad

2011-04-20 02:53

developer   ~0028679

I think this is duplicate of 0011351.

Libra

Libra

2011-04-20 05:27

reporter   ~0028682

I think that this is not the same. In my case the account missing in the LDAP server, so the function ldap_get_field_from_username always returns null value.