From ad83998f10952c3841b4b999b5a340ca26d329f7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 7 Mar 2009 17:16:52 -0800 Subject: [PATCH 1/4] Revert "Remove leave button from grouplist if current user is admin of that group." People shouldn't be forced to be part of a group, even if they are the admin. If a group has no admin, we need to figure out what to do with it, but it's wrong to force anyone to be part of a group. This reverts commit f9a7ae27b8879569a3f0eff478cbd3b650bdca28. --- lib/grouplist.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/grouplist.php b/lib/grouplist.php index 8e2637fec9..1b85474998 100644 --- a/lib/grouplist.php +++ b/lib/grouplist.php @@ -164,10 +164,8 @@ class GroupList extends Widget # XXX: special-case for user looking at own # subscriptions page if ($user->isMember($this->group)) { - if (!$user->isAdmin($this->group)) { - $lf = new LeaveForm($this->out, $this->group); - $lf->show(); - } + $lf = new LeaveForm($this->out, $this->group); + $lf->show(); } else { $jf = new JoinForm($this->out, $this->group); $jf->show(); From 7d7d78b7f7a5065a866468c2e8b5bd536f56611a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 7 Mar 2009 17:43:59 -0800 Subject: [PATCH 2/4] you can _so_ leave a group if you're its admin --- actions/leavegroup.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/actions/leavegroup.php b/actions/leavegroup.php index 1d85aa3d52..eb30d0e505 100644 --- a/actions/leavegroup.php +++ b/actions/leavegroup.php @@ -96,12 +96,6 @@ class LeavegroupAction extends Action return false; } - if ($cur->isAdmin($this->group)) { - $this->clientError(_('You may not leave a group while you are its administrator.'), 403); - return false; - - } - return true; } From bea3fca1899dddda8d1c52c16a761dd23c9ce8b8 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sat, 7 Mar 2009 23:04:30 +0100 Subject: [PATCH 3/4] Fix bug in dupe checking on notice post when there is no notice in cache. --- classes/Notice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Notice.php b/classes/Notice.php index eac90ce95b..ac4db944f2 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -234,7 +234,7 @@ class Notice extends Memcached_DataObject $notice->content = $content; $notice->whereAdd('now() - created < ' . common_config('notice', 'dupelimit')); $cnt = $notice->count(); - return ($cnt > 0); + return ($cnt == 0); } static function checkEditThrottle($profile_id) { From f66775658c0f231c8bcf9ea310fc8ac0dbf19bfd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 7 Mar 2009 17:47:43 -0800 Subject: [PATCH 4/4] trying to kill the can't-leave-a-group bug --- actions/showgroup.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/actions/showgroup.php b/actions/showgroup.php index c20941a35e..b6022840bf 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -275,10 +275,8 @@ class ShowgroupAction extends Action $cur = common_current_user(); if ($cur) { if ($cur->isMember($this->group)) { - if (!$cur->isAdmin($this->group)) { - $lf = new LeaveForm($this, $this->group); - $lf->show(); - } + $lf = new LeaveForm($this, $this->group); + $lf->show(); } else { $jf = new JoinForm($this, $this->group); $jf->show();