(bug 11562) API: Added a user_registration parameter/field to the list=allusers query...
authorDaniel Cannon <amidaniel@users.mediawiki.org>
Fri, 26 Oct 2007 03:48:58 +0000 (03:48 +0000)
committerDaniel Cannon <amidaniel@users.mediawiki.org>
Fri, 26 Oct 2007 03:48:58 +0000 (03:48 +0000)
RELEASE-NOTES
includes/api/ApiQueryAllUsers.php

index 2a96932..816a06a 100644 (file)
@@ -142,6 +142,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * Add apprtype and apprlevel parameters to filter list=allpages by protection types and levels
 * Add apdir parameter to enable listing all pages from Z to A
 * (bug 11721) Use a different title for results than for the help page.
+* (bug 11562) Added a user_registration parameter/field to the list=allusers query.
 
 === Languages updated in 1.12 ===
 
index 1a60983..7d55491 100644 (file)
@@ -48,8 +48,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $prop = array_flip($prop);
                        $fld_editcount = isset($prop['editcount']);
                        $fld_groups = isset($prop['groups']);
+                       $fld_registration = isset($prop['registration']);
                } else {
-                       $fld_editcount = $fld_groups = false;
+                       $fld_editcount = $fld_groups = $fld_registration = false;
                }
 
                $limit = $params['limit'];
@@ -80,6 +81,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                } else {
                        $sqlLimit = $limit+1;
                }
+               
+               if ($fld_registration)
+                       $this->addFields('user_registration');
 
                $this->addOption('LIMIT', $sqlLimit);
                $this->addTables($tables);
@@ -129,6 +133,8 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                $lastUserData = array( 'name' => $lastUser );
                                if ($fld_editcount)
                                        $lastUserData['editcount'] = intval($row->user_editcount);
+                               if ($fld_registration)
+                                       $lastUserData['registration'] = wfTimestamp(TS_ISO_8601, $row->user_registration);
                                        
                        }
                        
@@ -164,6 +170,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                ApiBase :: PARAM_TYPE => array (
                                        'editcount',
                                        'groups',
+                                       'registration',
                                )
                        ),
                        'limit' => array (