]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/approvegroup.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / actions / approvegroup.php
index db64e0596273c414b0815ebfbfc671dc707c076c..b532a9b95541837273fdc41ff4ef540e703c55cd 100644 (file)
@@ -50,14 +50,13 @@ class ApprovegroupAction extends Action
     /**
      * Prepare to run
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
         if (!common_logged_in()) {
             // TRANS: Client error displayed when trying to leave a group while not logged in.
             $this->clientError(_('You must be logged in to leave a group.'));
-            return false;
         }
 
         $nickname_arg = $this->trimmed('nickname');
@@ -72,7 +71,6 @@ class ApprovegroupAction extends Action
             if ($nickname_arg != $nickname) {
                 $args = array('nickname' => $nickname);
                 common_redirect(common_local_url('leavegroup', $args), 301);
-                return false;
             }
 
             $local = Local_group::getKV('nickname', $nickname);
@@ -80,27 +78,23 @@ class ApprovegroupAction extends Action
             if (!$local) {
                 // TRANS: Client error displayed when trying to leave a non-local group.
                 $this->clientError(_('No such group.'), 404);
-                return false;
             }
 
             $this->group = User_group::getKV('id', $local->group_id);
         } else {
             // TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
             $this->clientError(_('No nickname or ID.'), 404);
-            return false;
         }
 
         if (!$this->group) {
             // TRANS: Client error displayed when trying to leave a non-existing group.
             $this->clientError(_('No such group.'), 404);
-            return false;
         }
 
         $cur = common_current_user();
         if (empty($cur)) {
             // TRANS: Client error displayed trying to approve group membership while not logged in.
             $this->clientError(_('Must be logged in.'), 403);
-            return false;
         }
         if ($this->arg('profile_id')) {
             if ($cur->isAdmin($this->group)) {
@@ -108,12 +102,10 @@ class ApprovegroupAction extends Action
             } else {
                 // TRANS: Client error displayed trying to approve group membership while not a group administrator.
                 $this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
-                return false;
             }
         } else {
             // TRANS: Client error displayed trying to approve group membership without specifying a profile to approve.
             $this->clientError(_('Must specify a profile.'));
-            return false;
         }
 
         $this->request = Group_join_queue::pkeyGet(array('profile_id' => $this->profile->id,
@@ -147,7 +139,7 @@ class ApprovegroupAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
@@ -186,9 +178,7 @@ class ApprovegroupAction extends Action
             $this->elementEnd('body');
             $this->endHTML();
         } else {
-            common_redirect(common_local_url('groupmembers', array('nickname' =>
-                                                                   $this->group->nickname)),
-                            303);
+            common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303);
         }
     }
 }