* (bug 16647) list=allcategories, prop=categories don't return "hidden"
property for hidden categories
* New siprop parameter of 'extensions' to list all installed extensions
-* (bug 16672) Include canonical namespace name in meta=siteinfo&siprop=namespaces.
+* (bug 16672) Include canonical namespace name in
+ meta=siteinfo&siprop=namespaces.
+* (bug 16527) Added user and excludeuser parameters to list=watchlist and
+ list=recentchanges
=== Languages updated in 1.14 ===
*/
public function execute() {
/* Initialize vars */
- $limit = $prop = $namespace = $titles = $show = $type = $dir = $start = $end = $token = null;
+ $limit = $prop = $namespace = $titles = $user = $excludeuser = $show = $type = $dir = $start = $end = $token = null;
/* Get the parameters of the request. */
extract($this->extractRequestParams());
// Don't throw log entries out the window here
$this->addWhereIf('page_is_redirect = 0 OR page_is_redirect IS NULL', isset ($show['!redirect']));
}
-
- /* Add the fields we're concerned with to out query. */
+
+ if(!is_null($user) && !is_null($excludeuser))
+ $this->dieUsage('user and excludeuser cannot be used together', 'badparams');
+ if(!is_null($user))
+ $this->addWhereFld('rc_user_text', $user);
+ if(!is_null($excludeuser))
+ $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($excludeuser));
+
+ /* Add the fields we're concerned with to our query. */
$this->addFields(array (
'rc_timestamp',
'rc_namespace',
'titles' => array(
ApiBase :: PARAM_ISMULTI => true
),
+ 'user' => array(
+ ApiBase :: PARAM_TYPE => 'user'
+ ),
+ 'excludeuser' => array(
+ ApiBase :: PARAM_TYPE => 'user'
+ ),
'prop' => array (
ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_DFLT => 'title|timestamp|ids',
'dir' => 'In which direction to enumerate.',
'namespace' => 'Filter log entries to only this namespace(s)',
'titles' => 'Filter log entries to only these page titles',
+ 'user' => 'Only list changes by this user',
+ 'excludeuser' => 'Don\'t list changes by this user',
'prop' => 'Include additional pieces of information',
'token' => 'Which tokens to obtain for each change',
'show' => array (
if (!$wgUser->isLoggedIn())
$this->dieUsage('You must be logged-in to have a watchlist', 'notloggedin');
- $allrev = $start = $end = $namespace = $dir = $limit = $prop = $show = null;
+ $allrev = $start = $end = $namespace = $user = $excludeuser = $dir = $limit = $prop = $show = null;
extract($this->extractRequestParams());
if (!is_null($prop) && is_null($resultPageSet)) {
$this->addWhereIf('rc_patrolled = 0', isset($show['!patrolled']));
$this->addWhereIf('rc_patrolled != 0', isset($show['patrolled']));
}
+
+ if(!is_null($user) && !is_null($excludeuser))
+ $this->dieUsage('user and excludeuser cannot be used together', 'badparams');
+ if(!is_null($user))
+ $this->addWhereFld('rc_user_text', $user);
+ if(!is_null($excludeuser))
+ $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($excludeuser));
# This is an index optimization for mysql, as done in the Special:Watchlist page
ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => 'namespace'
),
+ 'user' => array(
+ ApiBase :: PARAM_TYPE => 'user',
+ ),
+ 'excludeuser' => array(
+ ApiBase :: PARAM_TYPE => 'user',
+ ),
'dir' => array (
ApiBase :: PARAM_DFLT => 'older',
ApiBase :: PARAM_TYPE => array (
'start' => 'The timestamp to start enumerating from.',
'end' => 'The timestamp to end enumerating.',
'namespace' => 'Filter changes to only the given namespace(s).',
+ 'user' => 'Only list changes by this user',
+ 'excludeuser' => 'Don\'t list changes by this user',
'dir' => 'In which direction to enumerate pages.',
'limit' => 'How many total results to return per request.',
'prop' => 'Which additional items to get (non-generator mode only).',