API: Getting a list of all user preferences is easy, so let's just do that

This commit is contained in:
Roan Kattouw 2007-11-03 16:08:43 +00:00
parent b4f578f764
commit 4876b25765
2 changed files with 7 additions and 14 deletions

View file

@ -158,6 +158,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
* (bug 11562) Added a user_registration parameter/field to the list=allusers query.
* (bug 11588) Preserve document structure for empty dataset in backlinks query.
* Allow staying logged in through lg* parameters instead of cookies
* Outputting list of all user preferences rather than having to request them by name
=== Languages updated in 1.12 ===

View file

@ -70,13 +70,8 @@ class ApiQueryUserInfo extends ApiQueryBase {
$vals['rights'] = $wgUser->getRights();
$result->setIndexedTagName($vals['rights'], 'r'); // even if empty
}
}
if (!empty($params['option'])) {
foreach( $params['option'] as $option ) {
if (empty($option))
$this->dieUsage('Empty value is not allowed for the option parameter', 'option');
$vals['options'][$option] = $wgUser->getOption($option);
if (isset($prop['options'])) {
$vals['options'] = (is_null($wgUser->mOptions) ? User::getDefaultOptions() : $wgUser->mOptions);
}
}
@ -93,11 +88,8 @@ class ApiQueryUserInfo extends ApiQueryBase {
'hasmsg',
'groups',
'rights',
)),
'option' => array (
ApiBase :: PARAM_DFLT => NULL,
ApiBase :: PARAM_ISMULTI => true,
),
'options'
))
);
}
@ -109,8 +101,8 @@ class ApiQueryUserInfo extends ApiQueryBase {
' hasmsg - adds a tag "message" if user has pending messages',
' groups - lists all the groups the current user belongs to',
' rights - lists of all rights the current user has',
),
'option' => 'A list of user preference options to get',
' options - lists all preferences the current user has set'
)
);
}