<? if ( !defined("_INCLUDED_GLOBAL") ) die("Access Denied");		// [Security]Allow_url_fopen = On ?>
<?

	/*
		-. 도메인관리 등록/수정 폼 데이타 지정.

		ex)
			$view = setform_sdomain($row);

	*/
	function setform_sdomain($row)
	{
		global $G, $G_SYS;

		// default
		if ($row['d_quota'] < 1)
			$row['d_quota'] = $G_SYS[MAIL_DOMAIN_DEFAULT_SIZE];
		if ($row['d_quota_mbr_default'] < 1)
			$row['d_quota_mbr_default'] = $G_SYS[MAIL_DEFAULT_SIZE];
		if ($row['d_quota_mbr_count'] < 1)
			$row['d_quota_mbr_count'] = $G_SYS[MBR_DEFAULT_COUNT];
		if ($row['d_quota_board'] < 1)
			$row['d_quota_board'] = $G_SYS[BOARD_QUOTA_DEFAULT];

		if ($row['d_site_name'] == '')
			$row['d_site_name'] = $G_SYS[SITE_NAME];
		if ($row['d_site_owner'] == '')
			$row['d_site_owner'] = $G_SYS[SITE_OWNER];
		if ($row['d_site_title'] == '')
			$row['d_site_title'] = $G_SYS[SITE_TITLE];
		if ($row['d_site_license'] == '')
			$row['d_site_license'] = $G_SYS[SITE_LICENSE];

		if ($row['d_webhard_isuse'] == '')
			$row['d_webhard_isuse'] = 'N';

		//$view['d_name'] = input_value($row['d_name'], 1);
		$view['d_name'] = $row['d_name'];
		$view['d_is_use'] = select_list_value($row['d_is_use'], array_values($G[ISUSE]), array_keys($G[ISUSE]), NULL, 0, 1);
		$view['d_quota'] = input_value($row['d_quota']/1024, 1);
		$view['d_quota_mbr_default'] = input_value($row['d_quota_mbr_default']/1024, 1);
		$view['d_quota_mbr_count'] = input_value($row['d_quota_mbr_count'], 1);
		$view['d_quota_board'] = input_value($row['d_quota_board']/1024, 1);
		$view['d_memo'] = htmlspecialchars_fix($row['d_memo']);
		$view['d_saveday'] = select_list_value($row['d_saveday'], array_values($G_SYS['MB_SAVEDAY']), array_keys($G_SYS['MB_SAVEDAY']), NULL, 0, 1);

		// [2006-08-04] 웹사이트 설정
		$view['d_site_name'] = input_value($row['d_site_name'], 1);
		$view['d_site_owner'] = input_value($row['d_site_owner'], 1);
		$view['d_site_title'] = input_value($row['d_site_title'], 1);
		$view['d_site_license'] = htmlspecialchars_fix($row['d_site_license']);
		$view['d_site_top_notice'] = htmlspecialchars_fix($row['d_site_top_notice']);
		$view['d_site_bottom_notice'] = htmlspecialchars_fix($row['d_site_bottom_notice']);

		if ($row['d_site_logo1_w'] == 0)
			$row['d_site_logo1_w'] = '';
		if ($row['d_site_logo1_h'] == 0)
			$row['d_site_logo1_h'] = '';
		if ($row['d_site_logo2_w'] == 0)
			$row['d_site_logo2_w'] = '';
		if ($row['d_site_logo2_h'] == 0)
			$row['d_site_logo2_h'] = '';
		$view['d_site_logo1_w'] = input_value($row['d_site_logo1_w'], 1);
		$view['d_site_logo1_h'] = input_value($row['d_site_logo1_h'], 1);
		$view['d_site_logo2_w'] = input_value($row['d_site_logo2_w'], 1);
		$view['d_site_logo2_h'] = input_value($row['d_site_logo2_h'], 1);

		// [2006-06-02]스킨선택
		$dirs = nskinopendir('main');
		$view['d_skin_main'] = select_list_value($row['d_skin_main'], $dirs, $dirs, NULL, 0, 1);
		$dirs = nskinopendir('webmail');
		$view['d_skin_webmail'] = select_list_value($row['d_skin_webmail'], $dirs, $dirs, NULL, 0, 1);
		$dirs = nskinopendir('member');
		$view['d_skin_member'] = select_list_value($row['d_skin_member'], $dirs, $dirs, NULL, 0, 1);
		$dirs = nskinopendir('board');
		$view['d_skin_board'] = select_list_value($row['d_skin_board'], $dirs, $dirs, NULL, 0, 1);
		$dirs = nskinopendir('webhard');
		$view['d_skin_webhard'] = select_list_value($row['d_skin_webhard'], $dirs, $dirs, NULL, 0, 1);

		$isallow = array(
								"Y" => "<font color=blue><b>사용가능</b></font>",
								"N" => "<font color=red><b>사용불가</b></font>"
								);

		$view['d_mbrgrp_isuse'] = radio_value("d_mbrgrp_isuse", $row['d_mbrgrp_isuse'], array_values($G[ISUSE]), array_keys($G[ISUSE]), 0, 0, 1);

		// [2006-07-07] 공용주소록, 공용일정
		$view['d_shareaddr_isuse'] = radio_value("d_shareaddr_isuse", $row['d_shareaddr_isuse'], array_values($G[ISUSE]), array_keys($G[ISUSE]), 0, 0, 1);
		$view['d_shareaddr_reg'] = radio_value("d_shareaddr_reg", $row['d_shareaddr_reg'], array('사용자 + 관리자', '관리자 전용'), array('U', 'A'), 0, 0, 1);
		$view['d_sharediary_isuse'] = radio_value("d_sharediary_isuse", $row['d_sharediary_isuse'], array_values($G[ISUSE]), array_keys($G[ISUSE]), 0, 0, 1);
		$view['d_sharediary_reg'] = radio_value("d_sharediary_reg", $row['d_sharediary_reg'], array('사용자 + 관리자', '관리자 전용'), array('U', 'A'), 0, 0, 1);
	
		// [2007-02-22] 서비스 설정
		$view['d_svc_smtp'] = radio_value("d_svc_smtp", $row['d_svc_smtp'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_svc_pop3'] = radio_value("d_svc_pop3", $row['d_svc_pop3'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_svc_forward'] = radio_value("d_svc_forward", $row['d_svc_forward'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_svc_external_pop3'] =  radio_value("d_svc_external_pop3", $row['d_svc_external_pop3'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_svc_mailing_list'] =  radio_value("d_svc_mailing_list", $row['d_svc_mailing_list'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_svc_2fa'] = radio_value("d_svc_2fa", $row['d_svc_2fa'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);

		// [2007-12-28] 대용량첨부, 웹하드
		$view['d_bigfile_isuse'] = radio_value("d_bigfile_isuse", $row['d_bigfile_isuse'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_bigfile_quota'] = input_value($row['d_bigfile_quota']/1024, 1);
		$view['d_bigfile_quota_default'] = input_value($row['d_bigfile_quota_default']/1024, 1);
		$view['d_webhard_isuse'] = radio_value("d_webhard_isuse", $row['d_webhard_isuse'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_webhard_quota'] = input_value($row['d_webhard_quota']/1024, 1);
		$view['d_webhard_quota_default'] = input_value($row['d_webhard_quota_default']/1024, 1);

		// [2025-08-25] 웹메일 주소
		$view['d_webmail_url'] = input_value($row['d_webmail_url'], 1);

		// [2025-08-27] 스킨 변경 권한
		$view['d_skin_limit_level'] = select_list_value($row['d_skin_limit_level'], array($G['LEVEL_NAME'][$G['LEVEL']['admin']], $G['LEVEL_NAME'][$G['LEVEL']['serveradmin']]), array($G['LEVEL']['admin'], $G['LEVEL']['serveradmin']), NULL, 0, 1);

		// [2025-08-28] 메인화면 이번주 생일 표시
		$view['d_skin_birthday'] = radio_value("d_skin_birthday", $row['d_skin_birthday'], array_values($G[ISUSE]), array_keys($G[ISUSE]), 0, 0, 1);

		// [2025-08-28] 기본 일정관리
		$view['d_sharediary_target'] = radio_value("d_sharediary_target", $row['d_sharediary_target'], array('공용일정','개인일정'), array('1', '0'), 0, 0, 1);

		// [2025-08-28] 로그인 및 회원 설정
		$view['d_login_signup'] = radio_value("d_login_signup", $row['d_login_signup'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_login_account_recovery'] = radio_value("d_login_account_recovery", $row['d_login_account_recovery'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_login_account_delete'] = radio_value("d_login_account_delete", $row['d_login_account_delete'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);
		$view['d_login_profile_edit'] = radio_value("d_login_profile_edit", $row['d_login_profile_edit'], array_values($isallow), array_keys($isallow), 0, 0, 1, NULL, false);

		return $view;
	}	// function()


?>