]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/leavegroup.php
Cosmetic changes to common_redirect, clientError, serverError
[quix0rs-gnu-social.git] / actions / leavegroup.php
index d92dd37de56b693c27033d0a1fe9a131251bbb01..e0e2c278904249edc54b640909e4296f09b7f9de 100644 (file)
@@ -57,7 +57,6 @@ class LeavegroupAction extends Action
         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 LeavegroupAction 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,20 +78,17 @@ class LeavegroupAction 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();
@@ -101,7 +96,6 @@ class LeavegroupAction extends Action
         if (!$cur->isMember($this->group)) {
             // TRANS: Client error displayed when trying to join a group while already a member.
             $this->clientError(_('You are not a member of that group.'), 403);
-            return false;
         }
 
         return true;
@@ -147,9 +141,7 @@ class LeavegroupAction 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);
         }
     }
 }