Index: trunk/extensions/UserDailyContribs/api/ApiUserDailyContribs.php |
— | — | @@ -14,6 +14,10 @@ |
15 | 15 | $this->dieUsage( 'Invalid username', 'bad_user' ); |
16 | 16 | } |
17 | 17 | |
| 18 | + global $wgAuth; |
| 19 | + if ( !$wgAuth->userExists( $userName ) ) { |
| 20 | + $this->dieUsage( 'Specified user does not exist', 'bad_user' ); |
| 21 | + } |
18 | 22 | $now = time(); |
19 | 23 | $result->addValue( $this->getModuleName() , |
20 | 24 | 'id', $user->getId() ); |
— | — | @@ -53,7 +57,8 @@ |
54 | 58 | |
55 | 59 | public function getPossibleErrors() { |
56 | 60 | 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' ), |
58 | 63 | ) ); |
59 | 64 | } |
60 | 65 | |