aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/lib
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-04 22:35:56 -0400
committercash <cash.costello@gmail.com>2011-10-04 22:35:56 -0400
commit183bdea42db704a6c1b25b8f03059302b0a3fb02 (patch)
treedbce79eab6d153e932f2076fa45ecef4070fd056 /mod/groups/lib
parentb4e997377b0d571eb7565fe75b7bd26aa28a33e9 (diff)
downloadelgg-183bdea42db704a6c1b25b8f03059302b0a3fb02.tar.gz
elgg-183bdea42db704a6c1b25b8f03059302b0a3fb02.tar.bz2
Fixes #3841 not displaying leave group button to group owners
Diffstat (limited to 'mod/groups/lib')
-rw-r--r--mod/groups/lib/groups.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 460eab656..4e2b045a6 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -431,10 +431,12 @@ function groups_register_profile_buttons($group) {
// group members
if ($group->isMember($user)) {
- // leave
- $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}";
- $url = elgg_add_action_tokens_to_url($url);
- $actions[$url] = 'groups:leave';
+ if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) {
+ // leave
+ $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}";
+ $url = elgg_add_action_tokens_to_url($url);
+ $actions[$url] = 'groups:leave';
+ }
} elseif (elgg_is_logged_in()) {
// join - admins can always join.
$url = elgg_get_site_url() . "action/groups/join?group_guid={$group->getGUID()}";