r27153 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r27152‎ | r27153 | r27154 >
Date:16:08, 3 November 2007
Author:catrope
Status:old
Tags:
Comment:
API: Getting a list of all user preferences is easy, so let's just do that
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUserInfo.php
@@ -70,13 +70,8 @@
7171 $vals['rights'] = $wgUser->getRights();
7272 $result->setIndexedTagName($vals['rights'], 'r'); // even if empty
7373 }
74 - }
75 -
76 - if (!empty($params['option'])) {
77 - foreach( $params['option'] as $option ) {
78 - if (empty($option))
79 - $this->dieUsage('Empty value is not allowed for the option parameter', 'option');
80 - $vals['options'][$option] = $wgUser->getOption($option);
 74+ if (isset($prop['options'])) {
 75+ $vals['options'] = (is_null($wgUser->mOptions) ? User::getDefaultOptions() : $wgUser->mOptions);
8176 }
8277 }
8378
@@ -93,11 +88,8 @@
9489 'hasmsg',
9590 'groups',
9691 'rights',
97 - )),
98 - 'option' => array (
99 - ApiBase :: PARAM_DFLT => NULL,
100 - ApiBase :: PARAM_ISMULTI => true,
101 - ),
 92+ 'options'
 93+ ))
10294 );
10395 }
10496
@@ -109,8 +101,8 @@
110102 ' hasmsg - adds a tag "message" if user has pending messages',
111103 ' groups - lists all the groups the current user belongs to',
112104 ' rights - lists of all rights the current user has',
113 - ),
114 - 'option' => 'A list of user preference options to get',
 105+ ' options - lists all preferences the current user has set'
 106+ )
115107 );
116108 }
117109
Index: trunk/phase3/RELEASE-NOTES
@@ -158,6 +158,7 @@
159159 * (bug 11562) Added a user_registration parameter/field to the list=allusers query.
160160 * (bug 11588) Preserve document structure for empty dataset in backlinks query.
161161 * Allow staying logged in through lg* parameters instead of cookies
 162+* Outputting list of all user preferences rather than having to request them by name
162163
163164 === Languages updated in 1.12 ===
164165

Status & tagging log