inconsistent username treatment

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mushu
Posts: 360
Joined: 04 Jan 2017, 17:41

inconsistent username treatment

Post by mushu »

mantis 2.26.1 using the LDAP authentication plugin to auto log in.

Under Users tab, click on a letter then a user and in the Edit User section the Real Name field is populated correctly. But in the Users tab if you click on a letter, that same user has an empty Real Name column entry. What can cause this?
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: inconsistent username treatment

Post by atrol »

Works well in standard MantisBT.
I recommend to contact the author of the 3rd party plugin you are using,
Please use Search before posting and read the Manual
mushu
Posts: 360
Joined: 04 Jan 2017, 17:41

Re: inconsistent username treatment

Post by mushu »

I posted a note for him. I could understand the plugin causing user impersonation issues, but not in displaying account name issues in mantis because displaying the username doesn't involve the act of logging in, and it does show in one screen just not the other, and the plugin does not interfere with any screen data in mantis, but impersonating does (depending on how mantis implemented that action.) The plugin itself is literally like a dozen lines of code total.
mushu
Posts: 360
Joined: 04 Jan 2017, 17:41

Re: inconsistent username treatment

Post by mushu »

I just found what looks like an update to the plugin, will try that and see if it clears up these bugs.
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: inconsistent username treatment

Post by atrol »

Shot in the dark: Does this happen for all users, or just users that do no longer exist in LDAP?
Please use Search before posting and read the Manual
mushu
Posts: 360
Joined: 04 Jan 2017, 17:41

Re: inconsistent username treatment

Post by mushu »

It seems to be random. One of the developers shows no username in the main manage users screen but in the edit screen it appears just fine.

I believe that the code for those two pages is not the same. In the MANAGE_USER_EDIT_PAGE.PHP code there is a check for if LDAP is being used or not, and if so it calls "user_get_realname( $t_user_id )" but that is missing in the main MANAGE_USER_PAGE.PHP code.

Which doesn't really answer the question, of course, since it appears to be random. I have tried switching the LDAP server in our config file (thinking that perhaps the global catalog hasn't replicated properly) and that didn't change anything. So I'm at a loss for now...
mushu
Posts: 360
Joined: 04 Jan 2017, 17:41

Re: inconsistent username treatment

Post by mushu »

Just for info, I changed the code in manage_user_page.php file to this around line 418 and the usernames worked properly after that. I think that file needs to have the LDAP test added like it is in the user edit page code.

original

Code: Select all

<td><?php echo string_display_line( $v_realname ) ?></td> <!-- original code -->
new

Code: Select all

<td><?php echo string_display_line( user_get_realname( $v_id ) ) ?></td> <!-- new code -->
I also had to add this at the top:

Code: Select all

require_api( 'user_api.php' );
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: inconsistent username treatment

Post by atrol »

That's exactly what I saw in source code / why I asked.
I am not sure if the current behavior is intended to prevent performance issues / stressing the LDAP server.
Please use Search before posting and read the Manual
Post Reply