Index: trunk/phase3/includes/api/ApiQueryBlocks.php |
— | — | @@ -36,7 +36,10 @@ |
37 | 37 | */ |
38 | 38 | class ApiQueryBlocks extends ApiQueryBase { |
39 | 39 | |
40 | | - var $users; |
| 40 | + /** |
| 41 | + * @var Array |
| 42 | + */ |
| 43 | + protected $usernames; |
41 | 44 | |
42 | 45 | public function __construct( $query, $moduleName ) { |
43 | 46 | parent::__construct( $query, $moduleName, 'bk' ); |
— | — | @@ -53,7 +56,9 @@ |
54 | 57 | $prop = array_flip( $params['prop'] ); |
55 | 58 | $fld_id = isset( $prop['id'] ); |
56 | 59 | $fld_user = isset( $prop['user'] ); |
| 60 | + $fld_userid = isset( $prop['userid'] ); |
57 | 61 | $fld_by = isset( $prop['by'] ); |
| 62 | + $fld_byid = isset( $prop['byid'] ); |
58 | 63 | $fld_timestamp = isset( $prop['timestamp'] ); |
59 | 64 | $fld_expiry = isset( $prop['expiry'] ); |
60 | 65 | $fld_reason = isset( $prop['reason'] ); |
— | — | @@ -68,12 +73,15 @@ |
69 | 74 | if ( $fld_id ) { |
70 | 75 | $this->addFields( 'ipb_id' ); |
71 | 76 | } |
72 | | - if ( $fld_user ) { |
| 77 | + if ( $fld_user || $fld_userid ) { |
73 | 78 | $this->addFields( array( 'ipb_address', 'ipb_user' ) ); |
74 | 79 | } |
75 | 80 | if ( $fld_by ) { |
76 | 81 | $this->addFields( 'ipb_by_text' ); |
77 | 82 | } |
| 83 | + if ( $fld_byid ) { |
| 84 | + $this->addFields( 'ipb_by' ); |
| 85 | + } |
78 | 86 | if ( $fld_timestamp ) { |
79 | 87 | $this->addFields( 'ipb_timestamp' ); |
80 | 88 | } |
— | — | @@ -149,9 +157,15 @@ |
150 | 158 | if ( $fld_user && !$row->ipb_auto ) { |
151 | 159 | $block['user'] = $row->ipb_address; |
152 | 160 | } |
| 161 | + if ( $fld_userid && !$row->ipb_auto ) { |
| 162 | + $block['userid'] = $row->ipb_user; |
| 163 | + } |
153 | 164 | if ( $fld_by ) { |
154 | 165 | $block['by'] = $row->ipb_by_text; |
155 | 166 | } |
| 167 | + if ( $fld_byid ) { |
| 168 | + $block['byid'] = $row->ipb_by; |
| 169 | + } |
156 | 170 | if ( $fld_timestamp ) { |
157 | 171 | $block['timestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp ); |
158 | 172 | } |
— | — | @@ -246,7 +260,9 @@ |
247 | 261 | ApiBase::PARAM_TYPE => array( |
248 | 262 | 'id', |
249 | 263 | 'user', |
| 264 | + 'userid', |
250 | 265 | 'by', |
| 266 | + 'byid', |
251 | 267 | 'timestamp', |
252 | 268 | 'expiry', |
253 | 269 | 'reason', |
— | — | @@ -272,7 +288,9 @@ |
273 | 289 | 'Which properties to get', |
274 | 290 | ' id - Adds the ID of the block', |
275 | 291 | ' user - Adds the username of the blocked user', |
276 | | - ' by - Adds the username of the blocking admin', |
| 292 | + ' userid - Adds the user ID of the blocked user', |
| 293 | + ' by - Adds the username of the blocking user', |
| 294 | + ' byid - Adds the user ID of the blocking user', |
277 | 295 | ' timestamp - Adds the timestamp of when the block was given', |
278 | 296 | ' expiry - Adds the timestamp of when the block expires', |
279 | 297 | ' reason - Adds the reason given for the block', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -178,6 +178,7 @@ |
179 | 179 | prop=info&inprop=displaytitle |
180 | 180 | * (bug 27554) Update api information text to reflect change in bug 26125 |
181 | 181 | * (bug 27611) list=blocks: Use ipb_by_text instead of join with user table |
| 182 | +* (bug 27616) Add userid of blocked user and blocker to list=blocks |
182 | 183 | |
183 | 184 | === Languages updated in 1.18 === |
184 | 185 | |