aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-27 17:00:23 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-27 17:00:23 +0000
commitd33b1210925eb4077b582e0c17875103c09772c2 (patch)
tree3af0f44a1f4434f18162c8a3d478613fa60ef291 /mod/groups/actions
parentc3fc445ccbc590ec930fe56e5756b88bddb13259 (diff)
downloadelgg-d33b1210925eb4077b582e0c17875103c09772c2.tar.gz
elgg-d33b1210925eb4077b582e0c17875103c09772c2.tar.bz2
Removing WSOD errors in groups
git-svn-id: https://code.elgg.org/elgg/trunk@2317 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/actions')
-rw-r--r--mod/groups/actions/leave.php14
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"));