r99007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99006‎ | r99007 | r99008 >
Date:14:25, 5 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Actually do a user existence check
Modified paths:
  • /trunk/extensions/UserDailyContribs/api/ApiUserDailyContribs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UserDailyContribs/api/ApiUserDailyContribs.php
@@ -14,6 +14,10 @@
1515 $this->dieUsage( 'Invalid username', 'bad_user' );
1616 }
1717
 18+ global $wgAuth;
 19+ if ( !$wgAuth->userExists( $userName ) ) {
 20+ $this->dieUsage( 'Specified user does not exist', 'bad_user' );
 21+ }
1822 $now = time();
1923 $result->addValue( $this->getModuleName() ,
2024 'id', $user->getId() );
@@ -53,7 +57,8 @@
5458
5559 public function getPossibleErrors() {
5660 return array_merge( parent::getPossibleErrors(), array(
57 - array( 'code' => 'bad_user', 'info' => 'Invalid username' )
 61+ array( 'code' => 'bad_user', 'info' => 'Invalid username' ),
 62+ array( 'code' => 'bad_user', 'info' => 'Specified user does not exist' ),
5863 ) );
5964 }
6065

Status & tagging log