Checking permissions for $wgUser while doing an edit with another user is not a good...
[lhc/web/wiklou.git] / includes / api / ApiQueryDeletedrevs.php
index d7fb530..45bebf4 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /**
- * Created on Jul 2, 2007
- *
  * API for MediaWiki 1.8+
  *
+ * Created on Jul 2, 2007
+ *
  * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@home.nl
  *
  * This program is free software; you can redistribute it and/or modify
@@ -21,6 +20,8 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -51,6 +52,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                $prop = array_flip( $params['prop'] );
                $fld_revid = isset( $prop['revid'] );
                $fld_user = isset( $prop['user'] );
+               $fld_userid = isset( $prop['userid'] );
                $fld_comment = isset( $prop['comment'] );
                $fld_parsedcomment = isset ( $prop['parsedcomment'] );
                $fld_minor = isset( $prop['minor'] );
@@ -86,6 +88,9 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                if ( $fld_user ) {
                        $this->addFields( 'ar_user_text' );
                }
+               if ( $fld_userid ) {
+                       $this->addFields( 'ar_user' );
+               }
                if ( $fld_comment || $fld_parsedcomment ) {
                        $this->addFields( 'ar_comment' );
                }
@@ -113,7 +118,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
 
                if ( $limit == 'max' ) {
                        $limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;
-                       $this->getResult()->addValue( 'limits', $this->getModuleName(), $limit );
+                       $this->getResult()->setParsedLimit( $this->getModuleName(), $limit );
                }
 
                $this->validateLimit( 'limit', $limit, 1, $userMax, $botMax );
@@ -201,6 +206,9 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        if ( $fld_user ) {
                                $rev['user'] = $row->ar_user_text;
                        }
+                       if ( $fld_userid ) {
+                               $rev['userid'] = $row->ar_user;
+                       }
                        if ( $fld_comment ) {
                                $rev['comment'] = $row->ar_comment;
                        }
@@ -289,6 +297,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                                ApiBase::PARAM_TYPE => array(
                                        'revid',
                                        'user',
+                                       'userid',
                                        'comment',
                                        'parsedcomment',
                                        'minor',
@@ -309,8 +318,9 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        'limit' => 'The maximum amount of revisions to list',
                        'prop' => array(
                                'Which properties to get',
-                               ' revid          - Adds the revision id of the deleted revision',
-                               ' user           - Adds user who made the revision',
+                               ' revid          - Adds the revision ID of the deleted revision',
+                               ' user           - Adds the user who made the revision',
+                               ' userid         - Adds the user ID whom made the revision',
                                ' comment        - Adds the comment of the revision',
                                ' parsedcomment  - Adds the parsed comment of the revision',
                                ' minor          - Tags if the revision is minor',
@@ -357,7 +367,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        'List the first 50 deleted revisions in the main namespace (mode 3):',
                        '  api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50',
                        'List the first 50 deleted pages in the Talk namespace (mode 3):',
-                       '  api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=1&drunique',
+                       '  api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=1&drunique=',
                );
        }