From 183bdea42db704a6c1b25b8f03059302b0a3fb02 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 4 Oct 2011 22:35:56 -0400 Subject: Fixes #3841 not displaying leave group button to group owners --- mod/groups/lib/groups.php | 10 ++++++---- 1 file 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()}"; -- cgit v1.2.3