X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllUsers.php;h=dda8c72950ec0f236a41de65d56c4628cd96e1ff;hb=48523016ef0d4a3d15e7417dfb3048d34cac69f7;hp=01cb15af69057aae3d8c290595cff39f78d5a73e;hpb=c87a63935a2595f6c24f0a3af94cd29d2b82f80a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 01cb15af69..dda8c72950 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -154,9 +154,9 @@ class ApiQueryAllUsers extends ApiQueryBase { $this->addFields( 'COUNT(*) AS recentedits' ); - $this->addWhere( "rc_log_type IS NULL OR rc_log_type != 'newusers'" ); + $this->addWhere( 'rc_log_type IS NULL OR rc_log_type != ' . $db->addQuotes( 'newusers' ) ); $timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 ); - $this->addWhere( "rc_timestamp >= {$db->addQuotes( $timestamp )}" ); + $this->addWhere( 'rc_timestamp >= ' . $db->addQuotes( $timestamp ) ); $this->addOption( 'GROUP BY', $userFieldToSort ); } @@ -361,7 +361,7 @@ class ApiQueryAllUsers extends ApiQueryBase { 'dir' => 'Direction to sort in', 'group' => 'Limit users to given group name(s)', 'excludegroup' => 'Exclude users in given group name(s)', - 'rights' => 'Limit users to given right(s)', + 'rights' => 'Limit users to given right(s) (does not include rights granted by implicit or auto-promoted groups like *, user, or autoconfirmed)', 'prop' => array( 'What pieces of information to include.', ' blockinfo - Adds the information about a current block on the user', @@ -377,6 +377,48 @@ class ApiQueryAllUsers extends ApiQueryBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'userid' => 'integer', + 'name' => 'string', + 'recenteditcount' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ) + ), + 'blockinfo' => array( + 'blockid' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ), + 'blockedby' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'blockedbyid' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ), + 'blockedreason' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'blockedexpiry' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'hidden' => 'boolean' + ), + 'editcount' => array( + 'editcount' => 'integer' + ), + 'registration' => array( + 'registration' => 'string' + ) + ); + } + public function getDescription() { return 'Enumerate all registered users'; }