API: Getting a list of all user preferences is easy, so let's just do that
authorRoan Kattouw <catrope@users.mediawiki.org>
Sat, 3 Nov 2007 16:08:43 +0000 (16:08 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sat, 3 Nov 2007 16:08:43 +0000 (16:08 +0000)
RELEASE-NOTES
includes/api/ApiQueryUserInfo.php

index b9024b8..5142a49 100644 (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 ===
 
index a5b723f..b653c47 100644 (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'
+                       )
                );
        }