Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | */ |
86 | 86 | public function execute() { |
87 | 87 | /* Initialize vars */ |
88 | | - $limit = $prop = $namespace = $titles = $show = $type = $dir = $start = $end = $token = null; |
| 88 | + $limit = $prop = $namespace = $titles = $user = $excludeuser = $show = $type = $dir = $start = $end = $token = null; |
89 | 89 | |
90 | 90 | /* Get the parameters of the request. */ |
91 | 91 | extract($this->extractRequestParams()); |
— | — | @@ -154,8 +154,15 @@ |
155 | 155 | // Don't throw log entries out the window here |
156 | 156 | $this->addWhereIf('page_is_redirect = 0 OR page_is_redirect IS NULL', isset ($show['!redirect'])); |
157 | 157 | } |
| 158 | + |
| 159 | + if(!is_null($user) && !is_null($excludeuser)) |
| 160 | + $this->dieUsage('user and excludeuser cannot be used together', 'badparams'); |
| 161 | + if(!is_null($user)) |
| 162 | + $this->addWhereFld('rc_user_text', $user); |
| 163 | + if(!is_null($excludeuser)) |
| 164 | + $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($excludeuser)); |
158 | 165 | |
159 | | - /* Add the fields we're concerned with to out query. */ |
| 166 | + /* Add the fields we're concerned with to our query. */ |
160 | 167 | $this->addFields(array ( |
161 | 168 | 'rc_timestamp', |
162 | 169 | 'rc_namespace', |
— | — | @@ -397,6 +404,12 @@ |
398 | 405 | 'titles' => array( |
399 | 406 | ApiBase :: PARAM_ISMULTI => true |
400 | 407 | ), |
| 408 | + 'user' => array( |
| 409 | + ApiBase :: PARAM_TYPE => 'user' |
| 410 | + ), |
| 411 | + 'excludeuser' => array( |
| 412 | + ApiBase :: PARAM_TYPE => 'user' |
| 413 | + ), |
401 | 414 | 'prop' => array ( |
402 | 415 | ApiBase :: PARAM_ISMULTI => true, |
403 | 416 | ApiBase :: PARAM_DFLT => 'title|timestamp|ids', |
— | — | @@ -457,6 +470,8 @@ |
458 | 471 | 'dir' => 'In which direction to enumerate.', |
459 | 472 | 'namespace' => 'Filter log entries to only this namespace(s)', |
460 | 473 | 'titles' => 'Filter log entries to only these page titles', |
| 474 | + 'user' => 'Only list changes by this user', |
| 475 | + 'excludeuser' => 'Don\'t list changes by this user', |
461 | 476 | 'prop' => 'Include additional pieces of information', |
462 | 477 | 'token' => 'Which tokens to obtain for each change', |
463 | 478 | 'show' => array ( |
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | if (!$wgUser->isLoggedIn()) |
61 | 61 | $this->dieUsage('You must be logged-in to have a watchlist', 'notloggedin'); |
62 | 62 | |
63 | | - $allrev = $start = $end = $namespace = $dir = $limit = $prop = $show = null; |
| 63 | + $allrev = $start = $end = $namespace = $user = $excludeuser = $dir = $limit = $prop = $show = null; |
64 | 64 | extract($this->extractRequestParams()); |
65 | 65 | |
66 | 66 | if (!is_null($prop) && is_null($resultPageSet)) { |
— | — | @@ -162,6 +162,13 @@ |
163 | 163 | $this->addWhereIf('rc_patrolled = 0', isset($show['!patrolled'])); |
164 | 164 | $this->addWhereIf('rc_patrolled != 0', isset($show['patrolled'])); |
165 | 165 | } |
| 166 | + |
| 167 | + if(!is_null($user) && !is_null($excludeuser)) |
| 168 | + $this->dieUsage('user and excludeuser cannot be used together', 'badparams'); |
| 169 | + if(!is_null($user)) |
| 170 | + $this->addWhereFld('rc_user_text', $user); |
| 171 | + if(!is_null($excludeuser)) |
| 172 | + $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($excludeuser)); |
166 | 173 | |
167 | 174 | |
168 | 175 | # This is an index optimization for mysql, as done in the Special:Watchlist page |
— | — | @@ -264,6 +271,12 @@ |
265 | 272 | ApiBase :: PARAM_ISMULTI => true, |
266 | 273 | ApiBase :: PARAM_TYPE => 'namespace' |
267 | 274 | ), |
| 275 | + 'user' => array( |
| 276 | + ApiBase :: PARAM_TYPE => 'user', |
| 277 | + ), |
| 278 | + 'excludeuser' => array( |
| 279 | + ApiBase :: PARAM_TYPE => 'user', |
| 280 | + ), |
268 | 281 | 'dir' => array ( |
269 | 282 | ApiBase :: PARAM_DFLT => 'older', |
270 | 283 | ApiBase :: PARAM_TYPE => array ( |
— | — | @@ -314,6 +327,8 @@ |
315 | 328 | 'start' => 'The timestamp to start enumerating from.', |
316 | 329 | 'end' => 'The timestamp to end enumerating.', |
317 | 330 | 'namespace' => 'Filter changes to only the given namespace(s).', |
| 331 | + 'user' => 'Only list changes by this user', |
| 332 | + 'excludeuser' => 'Don\'t list changes by this user', |
318 | 333 | 'dir' => 'In which direction to enumerate pages.', |
319 | 334 | 'limit' => 'How many total results to return per request.', |
320 | 335 | 'prop' => 'Which additional items to get (non-generator mode only).', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -530,7 +530,10 @@ |
531 | 531 | * (bug 16647) list=allcategories, prop=categories don't return "hidden" |
532 | 532 | property for hidden categories |
533 | 533 | * New siprop parameter of 'extensions' to list all installed extensions |
534 | | -* (bug 16672) Include canonical namespace name in meta=siteinfo&siprop=namespaces. |
| 534 | +* (bug 16672) Include canonical namespace name in |
| 535 | + meta=siteinfo&siprop=namespaces. |
| 536 | +* (bug 16527) Added user and excludeuser parameters to list=watchlist and |
| 537 | + list=recentchanges |
535 | 538 | |
536 | 539 | === Languages updated in 1.14 === |
537 | 540 | |