X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fapilistusers.php;h=cf3a86553869d3ce52944174e5cbeade7759282d;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=e4451c7c41f96da2398146f718ca23fcaacd2ef9;hpb=ad86eb78d3dc395b438d1543a36eca509f53e9d4;p=quix0rs-gnu-social.git diff --git a/lib/apilistusers.php b/lib/apilistusers.php index e4451c7c41..cf3a865538 100644 --- a/lib/apilistusers.php +++ b/lib/apilistusers.php @@ -29,8 +29,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apibareauth.php'; - class ApiListUsersAction extends ApiBareAuthAction { var $list = null; @@ -42,7 +40,7 @@ class ApiListUsersAction extends ApiBareAuthAction var $prev_cursor = 0; var $users = null; - function prepare($args) + protected function prepare(array $args=array()) { // delete list member if method is DELETE or if method is POST and an argument // _method is set to DELETE @@ -54,8 +52,8 @@ class ApiListUsersAction extends ApiBareAuthAction $this->create = (!$this->delete && $_SERVER['REQUEST_METHOD'] == 'POST'); - if($this->arg('id')) { - $this->user = $this->getTargetUser($this->arg('id')); + if ($this->arg('id')) { + $this->target = $this->getTargetProfile($this->arg('id')); } parent::prepare($args); @@ -63,8 +61,8 @@ class ApiListUsersAction extends ApiBareAuthAction $this->list = $this->getTargetList($this->arg('user'), $this->arg('list_id')); if (empty($this->list)) { - $this->clientError(_('Not found'), 404, $this->format); - return false; + // TRANS: Client error displayed when referring to a non-existing list. + $this->clientError(_('List not found.'), 404, $this->format); } if(!$this->create && !$this->delete) { @@ -79,9 +77,9 @@ class ApiListUsersAction extends ApiBareAuthAction $this->create || $this->delete; } - function handle($args) + protected function handle() { - parent::handle($args); + parent::handle(); if($this->delete) { return $this->handleDelete(); @@ -144,6 +142,7 @@ class ApiListUsersAction extends ApiBareAuthAction break; default: $this->clientError( + // TRANS: Client error displayed when coming across a non-supported API method. _('API method not found.'), 404, $this->format @@ -164,7 +163,7 @@ class ApiListUsersAction extends ApiBareAuthAction { } - function isReadOnly($args) + function isReadOnly(array $args=array()) { return false; } @@ -185,7 +184,6 @@ class ApiListUsersAction extends ApiBareAuthAction * * @return string etag */ - function etag() { if (!empty($this->list)) { @@ -203,5 +201,4 @@ class ApiListUsersAction extends ApiBareAuthAction return null; } - }