From: Daniel Cannon Date: Fri, 26 Oct 2007 03:48:58 +0000 (+0000) Subject: (bug 11562) API: Added a user_registration parameter/field to the list=allusers query... X-Git-Tag: 1.31.0-rc.0~51081 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=3a5199af840338155411791083473d0318d693c3;p=lhc%2Fweb%2Fwiklou.git (bug 11562) API: Added a user_registration parameter/field to the list=allusers query. Patch by Bryan Tong Minh . --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2a96932be8..816a06ab3a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 1a609837d1..7d554919d0 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -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 (