dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Do not pass unused parameter"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryUsers.php
diff --git
a/includes/api/ApiQueryUsers.php
b/includes/api/ApiQueryUsers.php
index
fbf1f9e
..
824c4d5
100644
(file)
--- a/
includes/api/ApiQueryUsers.php
+++ b/
includes/api/ApiQueryUsers.php
@@
-1,9
+1,5
@@
<?php
/**
<?php
/**
- *
- *
- * Created on July 30, 2007
- *
* Copyright © 2007 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
* Copyright © 2007 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
@@
-77,7
+73,7
@@
class ApiQueryUsers extends ApiQueryBase {
}
$this->tokenFunctions = [
}
$this->tokenFunctions = [
- 'userrights' => [
'ApiQueryUsers'
, 'getUserrightsToken' ],
+ 'userrights' => [
self::class
, 'getUserrightsToken' ],
];
Hooks::run( 'APIQueryUsersTokens', [ &$this->tokenFunctions ] );
];
Hooks::run( 'APIQueryUsersTokens', [ &$this->tokenFunctions ] );
@@
-99,7
+95,7
@@
class ApiQueryUsers extends ApiQueryBase {
public function execute() {
$db = $this->getDB();
public function execute() {
$db = $this->getDB();
- $commentStore =
new CommentStore( 'ipb_reason'
);
+ $commentStore =
CommentStore::getStore(
);
$params = $this->extractRequestParams();
$this->requireMaxOneParameter( $params, 'userids', 'users' );
$params = $this->extractRequestParams();
$this->requireMaxOneParameter( $params, 'userids', 'users' );
@@
-144,8
+140,10
@@
class ApiQueryUsers extends ApiQueryBase {
$result = $this->getResult();
if ( count( $parameters ) ) {
$result = $this->getResult();
if ( count( $parameters ) ) {
- $this->addTables( 'user' );
- $this->addFields( User::selectFields() );
+ $userQuery = User::getQueryInfo();
+ $this->addTables( $userQuery['tables'] );
+ $this->addFields( $userQuery['fields'] );
+ $this->addJoinConds( $userQuery['joins'] );
if ( $useNames ) {
$this->addWhereFld( 'user_name', $goodNames );
} else {
if ( $useNames ) {
$this->addWhereFld( 'user_name', $goodNames );
} else {
@@
-237,7
+235,8
@@
class ApiQueryUsers extends ApiQueryBase {
$data[$key]['blockedby'] = $row->ipb_by_text;
$data[$key]['blockedbyid'] = (int)$row->ipb_by;
$data[$key]['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
$data[$key]['blockedby'] = $row->ipb_by_text;
$data[$key]['blockedbyid'] = (int)$row->ipb_by;
$data[$key]['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
- $data[$key]['blockreason'] = $commentStore->getComment( $row )->text;
+ $data[$key]['blockreason'] = $commentStore->getComment( 'ipb_reason', $row )
+ ->text;
$data[$key]['blockexpiry'] = $row->ipb_expiry;
}
$data[$key]['blockexpiry'] = $row->ipb_expiry;
}