diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-01-22 08:01:40 +0000 |
---|---|---|
committer | Robin Millette <millette@plantard.controlezvous.ca> | 2009-01-22 08:01:40 +0000 |
commit | e272adb321fb72043ac7f9a16848ef9386e56571 (patch) | |
tree | b6d5c3196597af65d2a86b80389d0510d7514658 /actions/editgroup.php | |
parent | c20d0612bf51cff523f55b12095e7213be94355e (diff) |
fixed a few bugs and logic problems in groups
Diffstat (limited to 'actions/editgroup.php')
-rw-r--r-- | actions/editgroup.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/actions/editgroup.php b/actions/editgroup.php index 82b78cc5c..98ebcb87a 100644 --- a/actions/editgroup.php +++ b/actions/editgroup.php @@ -88,7 +88,12 @@ class EditgroupAction extends Action return false; } - $this->group = User_group::staticGet('nickname', $nickname); + $groupid = $this->trimmed('groupid'); + if ($groupid) { + $this->group = User_group::staticGet('id', $groupid); + } else { + $this->group = User_group::staticGet('nickname', $nickname); + } if (!$this->group) { $this->clientError(_('No such group'), 404); @@ -97,7 +102,7 @@ class EditgroupAction extends Action $cur = common_current_user(); - if (!$cur->isAdmin($group)) { + if (!$cur->isAdmin($this->group)) { $this->clientError(_('You must be an admin to edit the group'), 403); return false; } @@ -155,6 +160,13 @@ class EditgroupAction extends Action function trySave() { + $cur = common_current_user(); + if (!$cur->isAdmin($this->group)) { + $this->clientError(_('You must be an admin to edit the group'), 403); + return; + } + + $nickname = common_canonical_nickname($this->trimmed('nickname')); $fullname = $this->trimmed('fullname'); $homepage = $this->trimmed('homepage'); @@ -222,4 +234,5 @@ class EditgroupAction extends Action $group != false && $group->id != $this->group->id); } -}
\ No newline at end of file +} + |