Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -461,10 +461,19 @@ |
462 | 462 | return false; |
463 | 463 | } |
464 | 464 | |
465 | | - // Give other extensions a chance to stop auto creation, |
466 | | - // but they cannot change $userName, because CentralAuth |
467 | | - // expects user names on all wikis are the same. |
468 | | - if ( !wfRunHooks( 'CentralAuthAutoCreate', array( $user, $userName ) ) ) { |
| 465 | + // Give other extensions a chance to stop auto creation, but they cannot |
| 466 | + // change $userName, because CentralAuth expects user names on all wikis |
| 467 | + // are the same. |
| 468 | + // |
| 469 | + // * $user (and usually $wgUser) is the half-created User object and |
| 470 | + // should not be accessed in any way since calling any User methods |
| 471 | + // in its half-initialised state will give incorrect results. |
| 472 | + // |
| 473 | + // * $userName is the new user name |
| 474 | + // |
| 475 | + // * $anon is an anonymous user object which can be safely used for |
| 476 | + // permissions checks. |
| 477 | + if ( !wfRunHooks( 'CentralAuthAutoCreate', array( $user, $userName, $anon ) ) ) { |
469 | 478 | wfDebug( __METHOD__ . ": denied by other extensions\n" ); |
470 | 479 | return false; |
471 | 480 | } |