X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigrouplist.php;h=dd2a68c66e9089fde8f63cc02c526ca05ad8dd4f;hb=a21a17263956808e074fb62551300c5d6297387b;hp=c529c1e408f29276909dcc0ef1aa20d1ef100116;hpb=7021dd9341635090207a39ea8f74558e243c874f;p=quix0rs-gnu-social.git diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php index c529c1e408..dd2a68c66e 100644 --- a/actions/apigrouplist.php +++ b/actions/apigrouplist.php @@ -66,7 +66,13 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::prepare($args); - $this->user = $this->getTargetUser($id); + $this->user = $this->getTargetUser(null); + + if (empty($this->user)) { + $this->clientError(_('No such user.'), 404, $this->format); + return false; + } + $this->groups = $this->getGroups(); return true; @@ -86,21 +92,16 @@ class ApiGroupListAction extends ApiBareAuthAction { parent::handle($args); - if (empty($this->user)) { - $this->clientError(_('No such user!'), 404, $this->format); - return; - } - $sitename = common_config('site', 'name'); $title = sprintf(_("%s's groups"), $this->user->nickname); - $taguribase = common_config('integration', 'taguri'); + $taguribase = TagURI::base(); $id = "tag:$taguribase:Groups"; $link = common_local_url( 'usergroups', array('nickname' => $this->user->nickname) ); $subtitle = sprintf( - _("Groups %s is a member of on %s."), + _("Groups %1\$s is a member of on %2\$s."), $this->user->nickname, $sitename ); @@ -129,7 +130,7 @@ class ApiGroupListAction extends ApiBareAuthAction break; default: $this->clientError( - _('API method not found!'), + _('API method not found.'), 404, $this->format ); @@ -152,8 +153,7 @@ class ApiGroupListAction extends ApiBareAuthAction ($this->page - 1) * $this->count, $this->count, $this->since_id, - $this->max_id, - $this->since + $this->max_id ); while ($group->fetch()) {