]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apigroupmembership.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / actions / apigroupmembership.php
index 99ac965fa18d2c5aa9de82cf91ef317a3be8e025..86ae091162fe1781b0a134391b12fef229469455 100644 (file)
@@ -35,8 +35,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiprivateauth.php';
-
 /**
  * List 20 newest members of the group specified by name or ID.
  *
@@ -61,11 +59,16 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
         $this->group    = $this->getTargetGroup($this->arg('id'));
+        if (empty($this->group)) {
+            // TRANS: Client error displayed trying to show group membership on a non-existing group.
+            $this->clientError(_('Group not found.'), 404);
+        }
+
         $this->profiles = $this->getProfiles();
 
         return true;
@@ -76,19 +79,11 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
      *
      * Show the members of the group
      *
-     * @param array $args $_REQUEST data (unused)
-     *
      * @return void
      */
-    function handle($args)
+    protected function handle()
     {
-        parent::handle($args);
-
-        if (empty($this->group)) {
-            // TRANS: Client error displayed trying to show group membership on a non-existing group.
-            $this->clientError(_('Group not found.'), 404, $this->format);
-            return false;
-        }
+        parent::handle();
 
         // XXX: RSS and Atom
 
@@ -100,13 +95,8 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
             $this->showJsonUsers($this->profiles);
             break;
         default:
-            $this->clientError(
-                // TRANS: Client error displayed trying to execute an unknown API method showing group membership.
-                _('API method not found.'),
-                404,
-                $this->format
-            );
-            break;
+            // TRANS: Client error displayed when coming across a non-supported API method.
+            $this->clientError(_('API method not found.'), 404);
         }
     }
 
@@ -140,7 +130,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
      *
      * @return boolean true
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }