]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix edit group prepare, check for admin
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 21 Jan 2009 15:20:13 +0000 (10:20 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 21 Jan 2009 15:20:13 +0000 (10:20 -0500)
actions/editgroup.php

index e0d4c0d036868965944470002c12facee644db4d..82b78cc5c7ac596b75fcb9ef48b1f663fa9b5b48 100644 (file)
@@ -72,9 +72,7 @@ class EditgroupAction extends Action
             return false;
         }
 
-        return true;
-
-        $nickname_arg = $this->arg('nickname');
+        $nickname_arg = $this->trimmed('nickname');
         $nickname = common_canonical_nickname($nickname_arg);
 
         // Permanent redirect on non-canonical nickname
@@ -97,6 +95,13 @@ class EditgroupAction extends Action
             return false;
         }
 
+        $cur = common_current_user();
+
+        if (!$cur->isAdmin($group)) {
+            $this->clientError(_('You must be an admin to edit the group'), 403);
+            return false;
+        }
+
         return true;
     }