r71838 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71837‎ | r71838 | r71839 >
Date:01:18, 28 August 2010
Author:reedy
Status:ok
Tags:
Comment:
Describe user property in ApiQueryAllimages

Add userid to ApiQueryProtectedTitles

bug 19195
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryProtectedTitles.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -200,6 +200,7 @@
201201 'Which properties to get',
202202 ' timestamp - Adds the timestamp when the image was upload',
203203 ' user - Adds the username of the last uploader',
 204+ ' userid - Adds the user id of the last uploader',
204205 ' comment - Adds the comment of the last upload',
205206 ' url - Adds the URL of the image and its description page',
206207 ' size - Adds the size of the image in bytes and its height and width',
Index: trunk/phase3/includes/api/ApiQueryProtectedTitles.php
@@ -55,7 +55,7 @@
5656 $this->addFields( array( 'pt_namespace', 'pt_title', 'pt_timestamp' ) );
5757
5858 $prop = array_flip( $params['prop'] );
59 - $this->addFieldsIf( 'pt_user', isset( $prop['user'] ) );
 59+ $this->addFieldsIf( 'pt_user', isset( $prop['user'] ) || isset( $prop['userid'] ) );
6060 $this->addFieldsIf( 'pt_reason', isset( $prop['comment'] ) || isset( $prop['parsedcomment'] ) );
6161 $this->addFieldsIf( 'pt_expiry', isset( $prop['expiry'] ) );
6262 $this->addFieldsIf( 'pt_create_perm', isset( $prop['level'] ) );
@@ -96,6 +96,10 @@
9797 $vals['user'] = $row->user_name;
9898 }
9999
 100+ if ( isset( $prop['user'] ) ) {
 101+ $vals['userid'] = $row->pt_user;
 102+ }
 103+
100104 if ( isset( $prop['comment'] ) ) {
101105 $vals['comment'] = $row->pt_reason;
102106 }
@@ -177,6 +181,7 @@
178182 ApiBase::PARAM_TYPE => array(
179183 'timestamp',
180184 'user',
 185+ 'userid',
181186 'comment',
182187 'parsedcomment',
183188 'expiry',
@@ -197,6 +202,7 @@
198203 'Which properties to get',
199204 ' timestamp - Adds the timestamp of when protection was added',
200205 ' user - Adds the user to add the protection',
 206+ ' userid - Adds the user id to add the protection',
201207 ' comment - Adds the comment for the protection',
202208 ' parsedcomment - Adds the parsed comment for the protection',
203209 ' expiry - Adds the timestamp of when the protection will be lifted',

Status & tagging log