summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-14 15:47:39 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-14 15:47:39 -0700
commit1c87532912b63effc047da2913e55a6551d8f629 (patch)
treecaafcfed82f352f28c237e98e4c55c07628e1c2a /actions
parentd3a0c524cce9be65b8e45280168cf3584a60f81c (diff)
The rest of the things necessary to make group block work
Link to the group block form. Hide join button if the current user is blocked.
Diffstat (limited to 'actions')
-rw-r--r--actions/groupmembers.php2
-rw-r--r--actions/joingroup.php5
-rw-r--r--actions/showgroup.php2
3 files changed, 7 insertions, 2 deletions
diff --git a/actions/groupmembers.php b/actions/groupmembers.php
index 079dad9e9..150b60a54 100644
--- a/actions/groupmembers.php
+++ b/actions/groupmembers.php
@@ -180,7 +180,7 @@ class GroupMemberListItem extends ProfileListItem
$user = common_current_user();
if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group)) {
- $bf = new GroupBlockForm($this->out, $this->profile,
+ $bf = new GroupBlockForm($this->out, $this->profile, $this->group,
array('action' => 'groupmembers',
'nickname' => $this->group->nickname));
$bf->show();
diff --git a/actions/joingroup.php b/actions/joingroup.php
index a5d82ddc7..0e4f96eaf 100644
--- a/actions/joingroup.php
+++ b/actions/joingroup.php
@@ -96,6 +96,11 @@ class JoingroupAction extends Action
return false;
}
+ if (Group_block::isBlocked($this->group, $cur->getProfile())) {
+ $this->clientError(_('You have been blocked from that group by the admin.'), 403);
+ return false;
+ }
+
return true;
}
diff --git a/actions/showgroup.php b/actions/showgroup.php
index 3ce45adc6..537f09278 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -283,7 +283,7 @@ class ShowgroupAction extends Action
if ($cur->isMember($this->group)) {
$lf = new LeaveForm($this, $this->group);
$lf->show();
- } else {
+ } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
$jf = new JoinForm($this, $this->group);
$jf->show();
}