From: Roan Kattouw Date: Sat, 3 Nov 2007 16:08:43 +0000 (+0000) Subject: API: Getting a list of all user preferences is easy, so let's just do that X-Git-Tag: 1.31.0-rc.0~51021 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=4876b2576510f92c0a1de9903be87424bd5b546f;p=lhc%2Fweb%2Fwiklou.git API: Getting a list of all user preferences is easy, so let's just do that --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b9024b8193..5142a491d3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index a5b723fea2..b653c47411 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -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' + ) ); }