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?
inconsistent username treatment
Moderators: Developer, Contributor
Re: inconsistent username treatment
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.
Re: inconsistent username treatment
I just found what looks like an update to the plugin, will try that and see if it clears up these bugs.
Re: inconsistent username treatment
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...
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...
Re: inconsistent username treatment
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
new
I also had to add this at the top:
original
Code: Select all
<td><?php echo string_display_line( $v_realname ) ?></td> <!-- original code -->
Code: Select all
<td><?php echo string_display_line( user_get_realname( $v_id ) ) ?></td> <!-- new code -->
Code: Select all
require_api( 'user_api.php' );
Re: inconsistent username treatment
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.
I am not sure if the current behavior is intended to prevent performance issues / stressing the LDAP server.