]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Proper definition of $args array in NewgroupAction->prepare
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 1 Sep 2013 17:28:57 +0000 (19:28 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 1 Sep 2013 17:44:09 +0000 (19:44 +0200)
Also, there is no need to do 'return' after throwing a ClientError
Exception. And we'll use the Action->clientError for logging benefits
until the error handling is properly done all the way to backend.

actions/newgroup.php

index 0845f4d6d9116d6e4209cd963d2906b9b19368e9..d78683f705b77963810c709607249f1cacd9d223 100644 (file)
@@ -54,20 +54,19 @@ class NewgroupAction extends FormAction
     /**
      * Prepare to run
      */
-    protected function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
         if (!common_logged_in()) {
             // TRANS: Client error displayed trying to create a group while not logged in.
-            $this->clientError(_('You must be logged in to create a group.'));
-            return false;
+            $this->clientError(_('You must be logged in to create a group.'), 403);
         }
 
         // $this->scoped is the current user profile
         if (!$this->scoped->hasRight(Right::CREATEGROUP)) {
             // TRANS: Client exception thrown when a user tries to create a group while banned.
-            throw new ClientException(_('You are not allowed to create groups on this site.'), 403);
+            $this->clientError(_('You are not allowed to create groups on this site.'), 403);
         }
 
         return true;