X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiusershow.php;h=fbd4d605988604e03c23e9505165aca8d19e1874;hb=20ca5027ccb30f094bc87189ef19ecdb59156137;hp=6c8fad49ba9f5caac1ea15fb73867606a0f4d056;hpb=5e1a9ad04d4e10ee44881a26ea72c9a80f748188;p=quix0rs-gnu-social.git diff --git a/actions/apiusershow.php b/actions/apiusershow.php index 6c8fad49ba..fbd4d60598 100644 --- a/actions/apiusershow.php +++ b/actions/apiusershow.php @@ -49,7 +49,6 @@ require_once INSTALLDIR . '/lib/apiprivateauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ApiUserShowAction extends ApiPrivateAuthAction { /** @@ -60,7 +59,6 @@ class ApiUserShowAction extends ApiPrivateAuthAction * @return boolean success flag * */ - function prepare($args) { parent::prepare($args); @@ -87,17 +85,18 @@ class ApiUserShowAction extends ApiPrivateAuthAction * * @return void */ - function handle($args) { parent::handle($args); if (empty($this->user)) { - $this->clientError(_('Not found.'), 404, $this->format); + // TRANS: Client error displayed when requesting user information for a non-existing user. + $this->clientError(_('User not found.'), 404, $this->format); return; } if (!in_array($this->format, array('xml', 'json'))) { + // TRANS: Client error displayed when trying to handle an unknown API method. $this->clientError(_('API method not found.'), $code = 404); return; } @@ -105,6 +104,7 @@ class ApiUserShowAction extends ApiPrivateAuthAction $profile = $this->user->getProfile(); if (empty($profile)) { + // TRANS: Client error displayed when requesting user information for a user without a profile. $this->clientError(_('User has no profile.')); return; } @@ -113,14 +113,13 @@ class ApiUserShowAction extends ApiPrivateAuthAction if ($this->format == 'xml') { $this->initDocument('xml'); - $this->showTwitterXmlUser($twitter_user); + $this->showTwitterXmlUser($twitter_user, 'user', true); $this->endDocument('xml'); } elseif ($this->format == 'json') { $this->initDocument('json'); $this->showJsonObjects($twitter_user); $this->endDocument('json'); } - } /** @@ -132,10 +131,8 @@ class ApiUserShowAction extends ApiPrivateAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) { return true; } - }