Index: trunk/extensions/CentralAuth/CentralAuthPlugin.php |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | * central password or settings. |
10 | 10 | */ |
11 | 11 | class CentralAuthPlugin extends AuthPlugin { |
| 12 | + private $passwords = array(); // Password of the user. Stored because of the AuthPlugin limitations. |
12 | 13 | |
13 | 14 | /** |
14 | 15 | * Check whether there exists a user account with the given name. |
— | — | @@ -75,6 +76,9 @@ |
76 | 77 | return false; |
77 | 78 | } |
78 | 79 | } |
| 80 | + if( $passwordMatch ) { |
| 81 | + $this->passwords[$username] = $password; |
| 82 | + } |
79 | 83 | |
80 | 84 | return $passwordMatch; |
81 | 85 | } |
— | — | @@ -111,6 +115,9 @@ |
112 | 116 | if ( $central->exists() && $central->isAttached() ) { |
113 | 117 | $user->setEmail( $central->getEmail() ); |
114 | 118 | $user->mEmailAuthenticated = $central->getEmailAuthenticationTimestamp(); |
| 119 | + if( isset( $this->passwords[$user->getName()] ) ) { |
| 120 | + $user->setPassword( $this->passwords[$user->getName()] ); |
| 121 | + } |
115 | 122 | $user->saveSettings(); |
116 | 123 | } |
117 | 124 | return true; |