<?
require_once('include/global.php');
require_once('include/mail_lib.php');
require_once('include/mail_spam_lib.php');
require_once('include/file.php');
require_once('conf.inc.php');

page_loading_view("스팸으로 처리하고 있습니다.");

// check
	// 편지읽기에서 접근시
	if (!$_POST && $_GET)
		$_POST = $_GET;

	if (!$_POST['mf_no'] && !$_POST['cmf'])
		msg('올바른 URL로 접근하여 주십시오');

// data
	$mf_no = array();
	if (getarraycount($_POST['cmf']) > 0)
	{
		$mf_no = $_POST['cmf'];
	} else
	{
		$mf_no[] = $_POST['mf_no'];
	}	// if()

	$errorMsg = mail_spam_report($mf_no, $_POST['mail_report_select'], $_POST['mail_spam_reject']);

// end
	if ($errorMsg)
	{
		page_loading_view_hidden();
		error($errorMsg, 'FILE', false);
		$_time = 3;
	} else
	{
		$_time = 0;
	}	// if()
	if ($_POST['type'] !== 'json') {
		movepage(
			'mail_list.php?mb_id=' . $_POST['mb_id'] . '&' . get_qs('mb_id', 'mf_no', 'sel_mail_box', 'sel_mail_box_2', 'mail_report_select', 'mail_spam_reject', 'page'),
			$_time
		);
	} else {
		echo response_json(array(
			'error' => str_replace('\n', '  ', $errorMsg),
		));
		exit;
	}

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