* API: (bug 17355) Added auwitheditsonly parameter to list=allusers

* Use consistent code style
This commit is contained in:
Roan Kattouw 2009-02-04 19:10:14 +00:00
parent ed5a6072af
commit b677d0191d
2 changed files with 11 additions and 5 deletions

View file

@ -159,6 +159,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* (bug 17317) Added watch parameter to action=protect
* (bug 17007) Added export and exportnowrap parameters to action=query
* (bug 17326) BREAKING CHANGE: Changed output format for iiprop=metadata
* (bug 17355) Added auwitheditsonly parameter to list=allusers
=== Languages updated in 1.15 ===

View file

@ -57,11 +57,11 @@ class ApiQueryAllUsers extends ApiQueryBase {
$limit = $params['limit'];
$this->addTables('user', 'u1');
if( !is_null( $params['from'] ) )
$this->addWhere( 'u1.user_name >= ' . $db->addQuotes( $this->keyToTitle( $params['from'] ) ) );
if (!is_null($params['from']))
$this->addWhere('u1.user_name >= ' . $db->addQuotes($this->keyToTitle($params['from'])));
if( isset( $params['prefix'] ) )
$this->addWhere( 'u1.user_name LIKE "' . $db->escapeLike( $this->keyToTitle( $params['prefix'] ) ) . '%"' );
if (!is_null($params['prefix']))
$this->addWhere('u1.user_name LIKE "' . $db->escapeLike($this->keyToTitle( $params['prefix'])) . '%"');
if (!is_null($params['group'])) {
// Filter only users that belong to a given group
@ -70,6 +70,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
$this->addWhereFld('ug1.ug_group', $params['group']);
}
if ($params['witheditsonly'])
$this->addWhere('user_editcount > 0');
if ($fld_groups) {
// Show the groups the given users belong to
// request more than needed to avoid not getting all rows that belong to one user
@ -192,7 +195,8 @@ class ApiQueryAllUsers extends ApiQueryBase {
ApiBase :: PARAM_MIN => 1,
ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
)
),
'witheditsonly' => false,
);
}
@ -205,6 +209,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
'What pieces of information to include.',
'`groups` property uses more server resources and may return fewer results than the limit.'),
'limit' => 'How many total user names to return.',
'witheditsonly' => 'Only list users who have made edits',
);
}