diff options
Diffstat (limited to 'mod/groups/actions/leave.php')
-rw-r--r-- | mod/groups/actions/leave.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mod/groups/actions/leave.php b/mod/groups/actions/leave.php index e28b1bb97..33ba398ba 100644 --- a/mod/groups/actions/leave.php +++ b/mod/groups/actions/leave.php @@ -25,11 +25,15 @@ $group = get_entity($group_guid); if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) - { - if ($group->leave($user)) - system_message(elgg_echo("groups:left")); - else - register_error(elgg_echo("groups:cantleave")); + {
+ if ($group->getOwner() != $_SESSION['guid']) { + if ($group->leave($user)) + system_message(elgg_echo("groups:left")); + else + register_error(elgg_echo("groups:cantleave"));
+ } else {
+ register_error(elgg_echo("groups:cantleave"));
+ } } else register_error(elgg_echo("groups:cantleave")); |