Index: trunk/phase3/includes/User.php |
— | — | @@ -1394,11 +1394,23 @@ |
1395 | 1395 | $wgMinimalPasswordLength ) ); |
1396 | 1396 | } |
1397 | 1397 | } |
1398 | | - |
| 1398 | + |
1399 | 1399 | if( !$wgAuth->setPassword( $this, $str ) ) { |
1400 | 1400 | throw new PasswordError( wfMsg( 'externaldberror' ) ); |
1401 | 1401 | } |
1402 | 1402 | |
| 1403 | + $this->setInternalPassword( $str ); |
| 1404 | + |
| 1405 | + return true; |
| 1406 | + } |
| 1407 | + |
| 1408 | + /** |
| 1409 | + * Set the password and reset the random token no matter |
| 1410 | + * what. |
| 1411 | + * |
| 1412 | + * @param string $str |
| 1413 | + */ |
| 1414 | + function setInternalPassword( $str ) { |
1403 | 1415 | $this->load(); |
1404 | 1416 | $this->setToken(); |
1405 | 1417 | |
— | — | @@ -1410,10 +1422,7 @@ |
1411 | 1423 | } |
1412 | 1424 | $this->mNewpassword = ''; |
1413 | 1425 | $this->mNewpassTime = null; |
1414 | | - |
1415 | | - return true; |
1416 | 1426 | } |
1417 | | - |
1418 | 1427 | /** |
1419 | 1428 | * Set the random token (used for persistent authentication) |
1420 | 1429 | * Called from loadDefaults() among other places. |
Index: trunk/phase3/includes/SpecialUserlogin.php |
— | — | @@ -301,13 +301,18 @@ |
302 | 302 | * @private |
303 | 303 | */ |
304 | 304 | function initUser( $u ) { |
| 305 | + global $wgAuth; |
| 306 | + |
305 | 307 | $u->addToDatabase(); |
306 | | - $u->setPassword( $this->mPassword ); |
| 308 | + |
| 309 | + if ( $wgAuth->allowPasswordChange() ) { |
| 310 | + $u->setPassword( $this->mPassword ); |
| 311 | + } |
| 312 | + |
307 | 313 | $u->setEmail( $this->mEmail ); |
308 | 314 | $u->setRealName( $this->mRealName ); |
309 | 315 | $u->setToken(); |
310 | 316 | |
311 | | - global $wgAuth; |
312 | 317 | $wgAuth->initUser( $u ); |
313 | 318 | |
314 | 319 | $u->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -261,8 +261,8 @@ |
262 | 262 | * Link from Special:log/protect to change protection form |
263 | 263 | * Fix fallback implementation of mb_strlen so it works and isn't insanely |
264 | 264 | slow for large strings, since it's used for page edit lengths |
| 265 | +* (bug 8815) Setting password in initUser() breaks LdapAuthentication plugin |
265 | 266 | |
266 | | - |
267 | 267 | == Languages updated == |
268 | 268 | |
269 | 269 | * Arabic (ar) |