From f8d13817174a63dc8452ed60a00b7d336633fa88 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 8 Mar 2009 01:30:11 +0100 Subject: [PATCH 1/2] Corrected redirect targets for some group actions. These redirects can occur when the canonical name differs from the passed name. --- actions/grouplogo.php | 2 +- actions/joingroup.php | 2 +- actions/leavegroup.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/grouplogo.php b/actions/grouplogo.php index 499db4ae8d..fe6127da29 100644 --- a/actions/grouplogo.php +++ b/actions/grouplogo.php @@ -83,7 +83,7 @@ class GrouplogoAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); - common_redirect(common_local_url('editgroup', $args), 301); + common_redirect(common_local_url('grouplogo', $args), 301); return false; } diff --git a/actions/joingroup.php b/actions/joingroup.php index 1888ecdab2..eeea4a37bf 100644 --- a/actions/joingroup.php +++ b/actions/joingroup.php @@ -73,7 +73,7 @@ class JoingroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); - common_redirect(common_local_url('editgroup', $args), 301); + common_redirect(common_local_url('joingroup', $args), 301); return false; } diff --git a/actions/leavegroup.php b/actions/leavegroup.php index c7152e3c0e..1d85aa3d52 100644 --- a/actions/leavegroup.php +++ b/actions/leavegroup.php @@ -73,7 +73,7 @@ class LeavegroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); - common_redirect(common_local_url('editgroup', $args), 301); + common_redirect(common_local_url('leavegroup', $args), 301); return false; } From f9a7ae27b8879569a3f0eff478cbd3b650bdca28 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 8 Mar 2009 01:31:25 +0100 Subject: [PATCH 2/2] Remove leave button from grouplist if current user is admin of that group. --- lib/grouplist.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/grouplist.php b/lib/grouplist.php index 4c448e250d..8f3b0abd87 100644 --- a/lib/grouplist.php +++ b/lib/grouplist.php @@ -164,8 +164,10 @@ class GroupList extends Widget # XXX: special-case for user looking at own # subscriptions page if ($user->isMember($this->group)) { - $lf = new LeaveForm($this->out, $this->group); - $lf->show(); + if (!$user->isAdmin($this->group)) { + $lf = new LeaveForm($this->out, $this->group); + $lf->show(); + } } else { $jf = new JoinForm($this->out, $this->group); $jf->show();