summaryrefslogtreecommitdiff
path: root/actions/showgroup.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-03-08 17:22:23 -0500
committerCraig Andrews <candrews@integralblue.com>2010-03-08 17:22:23 -0500
commit714d920faea302b55857cc3bec4e9e6160ea136a (patch)
treecffa5ee7a3261ad24b272cb3ced16a6c1dcafad1 /actions/showgroup.php
parentc187bf55974347f7ddb4f28714af57861dce8f08 (diff)
parent51a245f18c1e4a830c5eb94f3e60c6b4b3e560ee (diff)
Merge branch '0.9.x' into 1.0.x
Conflicts: classes/statusnet.ini db/statusnet.sql lib/jabber.php lib/xmppmanager.php
Diffstat (limited to 'actions/showgroup.php')
-rw-r--r--actions/showgroup.php33
1 files changed, 21 insertions, 12 deletions
diff --git a/actions/showgroup.php b/actions/showgroup.php
index eb1238902..5704b13d1 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -122,9 +122,9 @@ class ShowgroupAction extends GroupDesignAction
return false;
}
- $this->group = User_group::staticGet('nickname', $nickname);
+ $local = Local_group::staticGet('nickname', $nickname);
- if (!$this->group) {
+ if (!$local) {
$alias = Group_alias::staticGet('alias', $nickname);
if ($alias) {
$args = array('id' => $alias->group_id);
@@ -134,11 +134,19 @@ class ShowgroupAction extends GroupDesignAction
common_redirect(common_local_url('groupbyid', $args), 301);
return false;
} else {
+ common_log(LOG_NOTICE, "Couldn't find local group for nickname '$nickname'");
$this->clientError(_('No such group.'), 404);
return false;
}
}
+ $this->group = User_group::staticGet('id', $local->group_id);
+
+ if (!$this->group) {
+ $this->clientError(_('No such group.'), 404);
+ return false;
+ }
+
common_set_returnto($this->selfUrl());
return true;
@@ -293,19 +301,20 @@ class ShowgroupAction extends GroupDesignAction
$this->element('h2', null, _('Group actions'));
$this->elementStart('ul');
$this->elementStart('li', 'entity_subscribe');
- $cur = common_current_user();
- if ($cur) {
- if ($cur->isMember($this->group)) {
- $lf = new LeaveForm($this, $this->group);
- $lf->show();
- } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
- $jf = new JoinForm($this, $this->group);
- $jf->show();
+ if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
+ $cur = common_current_user();
+ if ($cur) {
+ if ($cur->isMember($this->group)) {
+ $lf = new LeaveForm($this, $this->group);
+ $lf->show();
+ } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
+ $jf = new JoinForm($this, $this->group);
+ $jf->show();
+ }
}
+ Event::handle('EndGroupSubscribe', array($this, $this->group));
}
-
$this->elementEnd('li');
-
$this->elementEnd('ul');
$this->elementEnd('div');
}