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

mail_server_check_limit();		// 메일서버가 동작중인지 확인

// check
	if (!$_GET['m_no'])
		msg('올바른 URL로 접근하여 주십시오');

	$q_where = " AND m_usertype='A' ";
	if ($_GET['isadmin'])
	{
		auth_limit('admin');
		$_GET['d_no'] = $G['DINFO']['d_no'];
		$q_where .= " AND d_no='" . $_GET['d_no'] . "'";
	} else 
	{
		auth_limit('serveradmin');
	}	// if()

// get
	$q = "SELECT m_id, d_no FROM " . $TB['MEMBER'] . " WHERE m_no='" . $_GET['m_no'] . "'".$q_where;
	$mbr = db_get_row($q);
	if (!$mbr)
		msg("존재하지 않는 앨리어스 주소입니다.");


// data
	// 메일엔진 - 앨리어스 주소 계정 삭제
		if (!$_GET['isadmin'])
		{
			$sql = "SELECT d_name FROM ".$TB['DOMAIN']." WHERE d_no='". $mbr['d_no'] . "' AND d_is_use='Y' ";
			$G_SYS['MAIL_DOMAIN'] = db_get_one($sql);
		}	// if()

		mbr_alias_del($mbr['m_id']);


	// 앨리어스 주소정보
		$sql = "
			DELETE
			FROM
				" . $TB['MEMBER'] . "
			WHERE
				m_no='" . $_GET['m_no'] . "'
				$q_where
			";
		db_query($sql);

// end
	msg("삭제되었습니다.", 0);
	movepage('admin_alias_list.php?' . get_qs('m_no', 'd_no'));


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