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

// check
	if (!$_POST['mb_id'] && !$_POST['open']){
		msg('올바른 URL로 접근하여 주십시오');
	}

// data
	// set data
	if ($_POST['open'] !== 'false'){
		$mb_open = 'N';
		$message = "편지함 트리를 닫았습니다.";
	} else {
		$mb_open = 'Y';
		$message = "편지함 트리를 열었습니다.";
	}

	db_update($TB['MAIL_BOX'], array('mb_open' => $mb_open), 'm_no = ? AND mb_id = ?', array($AUTH['auth_m_no'], $_POST['mb_id']));

	echo response_json(array(
		'success' => true,
		'message' => $message,
	));

	exit;


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