]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3841 not displaying leave group button to group owners
authorcash <cash.costello@gmail.com>
Wed, 5 Oct 2011 02:35:56 +0000 (22:35 -0400)
committercash <cash.costello@gmail.com>
Wed, 5 Oct 2011 02:35:56 +0000 (22:35 -0400)
mod/groups/lib/groups.php

index 460eab65624540de42333ac9f3468527da0accd0..4e2b045a6de1a181fafeecb359796272cc63cdca 100644 (file)
@@ -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()}";