Web.pm - use LoadByGecos after user autocreation #351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was experiencing an edge case in my RT 5.0.3 installation after reconfiguring my setup to use WebRemote authentication with ExternalInfo. I am using the
WebRemoteUserGecos
option, and the LDAP source in use byExternalInfo
yields different values forName
andGecos
.I was finding that after authenticating a new user, RT would display the "You are not allowed to log in" error message to the user, and was writing these log messages:
All the user had to do was reload the page to be authenticated properly, but this indicated to me that something was wrong with substituting the Gecos field with the Name field between creating the account and logging in.
I believe what is happening here is that after the new user is created and all of the values are set, then this line attempts to load a user by Name, but is still passing in the REMOTE_USER variable which is Gecos. I changed the line to follow the pattern on line 742 and this seems to have solved the issue.
I would suggest reviewing the few lines of code above my change to ensure this is still correct when
WebRemoteUserGecos
is in use. I am not knowledgeable enough with Perl to say either way, but I recognize that this mapsUser
to$user
even though$user
may be aGecos
value.