Ryan Lane has submitted this change and it was merged.

Change subject: (bug 49003) Fixed password change for lowercase username
......................................................................


(bug 49003) Fixed password change for lowercase username

Mediawiki munges the username. When using lowercase usernames the
username provided should be converted back to lowercase before
comparing it with the username retrieved from LDAP or else it will
always fail.

Change-Id: Ic034502d2a87c32541872d01b7d7b5e9ccb2e101
---
M LdapAuthentication.php
1 file changed, 8 insertions(+), 7 deletions(-)

Approvals:
  Ryan Lane: Verified; Looks good to me, approved
  Peterbruin: Looks good to me, but someone else must approve
  jenkins-bot: Checked



diff --git a/LdapAuthentication.php b/LdapAuthentication.php
index 084fe2d..9cc7741 100644
--- a/LdapAuthentication.php
+++ b/LdapAuthentication.php
@@ -620,6 +620,14 @@
                        return false;
                }
 
+               // Mediawiki munges the username before authenticate is called,
+               // this can mess with authentication, group pulling/restriction,
+               // preference pulling, etc. Let's allow the admin to use
+               // a lowercased username if needed.
+               if ( $this->getConf( 'LowerCaseUsername') ) {
+                       $username = strtolower( $username );
+               }
+
                // If the user is using auto authentication, we need to ensure
                // that he/she isn't trying to fool us by sending a username 
other
                // than the one the web server got from the auto-authentication 
method.
@@ -639,13 +647,6 @@
                }
 
                if ( $this->connect() ) {
-                       // Mediawiki munges the username before authenticate is 
called,
-                       // this can mess with authentication, group 
pulling/restriction,
-                       // preference pulling, etc. Let's allow the admin to use
-                       // a lowercased username if needed.
-                       if ( $this->getConf( 'LowerCaseUsername') ) {
-                               $username = strtolower( $username );
-                       }
 
                        $this->userdn = $this->getSearchString( $username );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/66195
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic034502d2a87c32541872d01b7d7b5e9ccb2e101
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/LdapAuthentication
Gerrit-Branch: master
Gerrit-Owner: Peterbruin <[email protected]>
Gerrit-Reviewer: DamianZaremba <[email protected]>
Gerrit-Reviewer: Guillaume Beaudoin <[email protected]>
Gerrit-Reviewer: No-L <[email protected]>
Gerrit-Reviewer: Peterbruin <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to