<?php
/********************************************************/
/* NSN Groups                                           */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright  2000-2005 by NukeScripts Network         */
/********************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}

list($phpBB) = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `phpBB` FROM `".TABLE_NSNGR_GROUPS."` WHERE `gid`='$gid'"));
$GLOBALS['db']->sql_query("DELETE FROM `".TABLE_NSNGR_USERS."` WHERE `gid`='$gid' AND `uid`='$uid'");
$GLOBALS['db']->sql_query("OPTIMIZE TABLE ".TABLE_NSNGR_USERS."");
$GLOBALS['db']->sql_query("DELETE FROM `".$prefix."_bbuser_group` WHERE `group_id`='$phpBB' AND `user_id`='$uid'");
$GLOBALS['db']->sql_query("OPTIMIZE TABLE `".$prefix."_bbuser_group`");
redirect_url("".$admin_file.".php?op=NSNGroupsUsersView&gid=$gid");