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


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

// data
	$_POST['m_cfg_new_mail_box_db'] = implode('|',$_POST['m_cfg_new_mail_box']);

	// 갱신
	$sql = "
		UPDATE
			" .	$TB['MEMBER']	. "
		SET
			m_cfg_new_mail_box = '" . $_POST['m_cfg_new_mail_box_db'] . "',
			m_cfg_new_cnt = '" . $_POST['m_cfg_new_cnt'] . "',
			m_cfg_week_diray_cnt = '" . $_POST['m_cfg_week_diray_cnt'] . "',
			m_cfg_from_name = '" . $_POST['m_cfg_from_name'] . "',
			m_cfg_mail_list_cnt = '" . $_POST['m_cfg_mail_list_cnt'] . "'
		WHERE
			m_no = '" . $AUTH['auth_m_no'] . "'
		";
	db_query($sql);

	// [2013-01-28] 보낸사람 선택기능 (앨리어스 도메인/주소 연동)
	if (is_array($_POST['alias_name']) && sizeof($_POST['alias_name']) > 0)
	{
		foreach ($_POST['alias_name'] as $key=>$val)
		{
			$q = "UPDATE " . $TB['MEMBER'] . " SET m_cfg_from_name = '" . $val . "', m_cfg_from_addr = '" . $_POST['alias_isuse'][$key] ."' WHERE d_no='" . $G['DINFO']['d_no'] . "' AND m_usertype='A' AND m_name='" . $AUTH['auth_m_id'] . "' AND m_id='" . addslashes($key) . "'";
			db_query($q);
		}	// foreach()
	}	// if()

// end
	#msg("수정되었습니다.", 0);
	movepage('default_config.php');

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