<?
require_once('include/global.php');
require_once('include/admin_lib.php');
//require_once('sadmin_conf.inc.php');

// check
	if ($_POST['chk'])
	{
		//
	} else if ($_GET['d_no'] && ($_GET['m_id'] || $_GET['m_id'] === '') && $_GET['ip_ipaddr'] && $_GET['ip_netmask'])
	{
		$_POST['chk'] = array();
		$_POST['chk'][] = $_GET['d_no'].'|'.$_GET['m_id'].'|'.$_GET['ip_ipaddr'].'|'.$_GET['ip_netmask'];
	} else 
	{
		msg('올바른 URL로 접근하여 주십시오');
	}	// if()


	if ($_GET['isadmin'])
	{
		auth_limit('admin');
		$_GET['d_no'] = $G['DINFO']['d_no'];
	} else 
	{
		auth_limit('serveradmin');
	}	// if()

// data
	for ($i=0; $i<sizeof($_POST['chk']); $i++)
	{
		$ex = explode('|', $_POST['chk'][$i]);

		if ($_GET['isadmin'])
		{
			$q_where = " AND d_no='" . $_GET['d_no'] . "' and m_id='". $ex[1] . "'";
		} else 
		{
			$q_where = " AND d_no='" . $ex[0] . "' and m_id='". $ex[1] . "'";
		}	// if()

		$sql = "
			DELETE
			FROM
				" . $TB['WEB_ALLOW_IP'] . "
			WHERE
				m_id='" . $ex[1] . "'
				AND ip_ipaddr='" . $ex[2]  . "'
				AND ip_netmask='" . $ex[3]  . "'
				".$q_where;
		db_query($sql);
	}	// for()

// end
	//msg("삭제되었습니다.", 0);
	movepage('admin_web_allow_ip_list.php?' . get_qs('d_no', 'm_id', 'ip_ipaddr', 'ip_netmask'));


require_once('include/global_end.php');
?>