X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUsers.php;h=66d8db4987b18d441aac97b4cf4074640f5426e4;hb=1e4bf35253a6f672c57c1430c895049591fb090b;hp=8fc99bbcf9f9f65c9dad2ed232f167e8894f0f94;hpb=7ff01f46c40975098590290918f98893c7f65118;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 8fc99bbcf9..66d8db4987 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -1,9 +1,5 @@ .@gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -77,7 +73,7 @@ class ApiQueryUsers extends ApiQueryBase { } $this->tokenFunctions = [ - 'userrights' => [ 'ApiQueryUsers', 'getUserrightsToken' ], + 'userrights' => [ self::class, 'getUserrightsToken' ], ]; Hooks::run( 'APIQueryUsersTokens', [ &$this->tokenFunctions ] ); @@ -99,7 +95,7 @@ class ApiQueryUsers extends ApiQueryBase { public function execute() { $db = $this->getDB(); - $commentStore = new CommentStore( 'ipb_reason' ); + $commentStore = CommentStore::getStore(); $params = $this->extractRequestParams(); $this->requireMaxOneParameter( $params, 'userids', 'users' ); @@ -172,7 +168,7 @@ class ApiQueryUsers extends ApiQueryBase { } $this->addTables( 'user_groups' ); - $this->addJoinConds( [ 'user_groups' => [ 'INNER JOIN', 'ug_user=user_id' ] ] ); + $this->addJoinConds( [ 'user_groups' => [ 'JOIN', 'ug_user=user_id' ] ] ); $this->addFields( [ 'user_name' ] ); $this->addFields( UserGroupMembership::selectFields() ); $this->addWhere( 'ug_expiry IS NULL OR ug_expiry >= ' . @@ -239,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]['blockreason'] = $commentStore->getComment( $row )->text; + $data[$key]['blockreason'] = $commentStore->getComment( 'ipb_reason', $row ) + ->text; $data[$key]['blockexpiry'] = $row->ipb_expiry; }