Index: trunk/extensions/AjaxShowEditors/Response.php |
— | — | @@ -14,21 +14,15 @@ |
15 | 15 | * @author Tim Starling |
16 | 16 | */ |
17 | 17 | function wfAjaxShowEditors( $articleId, $username ) { |
18 | | - global $wgOut; |
19 | | - |
20 | 18 | $articleId = intval( $articleId ); |
21 | 19 | |
22 | 20 | // Validate request |
23 | 21 | $title = Title::newFromID( $articleId ); |
24 | 22 | if ( !( $title ) ) { return wfMsg( 'ajax-se-pagedoesnotexist' ); } |
25 | 23 | |
26 | | - $user = User::newFromSession() ; |
27 | | - if ( !$user ) { return wfMsg( 'ajax-se-userinvalid' ); } |
| 24 | + if ( User::idFromName( $username ) === null ) { return wfMsg( 'ajax-se-usernotfound' ); } |
28 | 25 | |
29 | | - $username = $user->getName(); |
30 | | - if ( !( $user->isLoggedIn() or User::isIP( $username ) ) ) { return wfMsg( 'ajax-se-usernotfound' ); } |
31 | 26 | |
32 | | - |
33 | 27 | // When did the user started editing ? |
34 | 28 | $dbr = wfGetDB( DB_SLAVE ); |
35 | 29 | $userStarted = $dbr->selectField( 'editings', |