From efdb743f60b9df2f5a151cd56ba3c45007cdedc8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen <acydburn@phpbb.com> Date: Sat, 2 Feb 2008 15:19:55 +0000 Subject: Users allowed to resign only from open and freely open groups - #19355 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8368 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_groups.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index a4fc818343..d6e7a30176 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -127,6 +127,18 @@ class ucp_groups } list(, $row) = each($row); + $sql = 'SELECT group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); + $group_type = (int) $db->sql_fetchfield('group_type'); + $db->sql_freeresult($result); + + if ($group_type != GROUP_OPEN && $group_type != GROUP_FREE) + { + trigger_error($user->lang['CANNOT_RESIGN_GROUP'] . $return_page); + } + if (confirm_box(true)) { group_user_del($group_id, $user->data['user_id']); -- cgit v1.2.1