r35880 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35879‎ | r35880 | r35881 >
Date:20:29, 4 June 2008
Author:vasilievvv
Status:old
Tags:
Comment:
* Change user local password to a global one on login and account autocreation. Fixes bug:
** (bug 14330) Password on automatic created accounts does not work after SUL deletion
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthPlugin.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthPlugin.php
@@ -8,6 +8,7 @@
99 * central password or settings.
1010 */
1111 class CentralAuthPlugin extends AuthPlugin {
 12+ private $passwords = array(); // Password of the user. Stored because of the AuthPlugin limitations.
1213
1314 /**
1415 * Check whether there exists a user account with the given name.
@@ -75,6 +76,9 @@
7677 return false;
7778 }
7879 }
 80+ if( $passwordMatch ) {
 81+ $this->passwords[$username] = $password;
 82+ }
7983
8084 return $passwordMatch;
8185 }
@@ -111,6 +115,9 @@
112116 if ( $central->exists() && $central->isAttached() ) {
113117 $user->setEmail( $central->getEmail() );
114118 $user->mEmailAuthenticated = $central->getEmailAuthenticationTimestamp();
 119+ if( isset( $this->passwords[$user->getName()] ) ) {
 120+ $user->setPassword( $this->passwords[$user->getName()] );
 121+ }
115122 $user->saveSettings();
116123 }
117124 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r35884Revert r35880 for the moment:...brion21:01, 4 June 2008
r35923* Changed password hash format, see wikitech-l...tstarling12:58, 5 June 2008

Status & tagging log