{=var-set:default_username=root=}
{=var-set:default_password=ni=}
{=include-block:Y_Blocks.txt;management_check_top=}
{=include-block:Y_Blocks.txt;head=}
<script src="/Y_Baselib.js"></script>
<script>
function form_init()
{
	obj_set_radio_value('authenticate', "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}");
	obj_set_radio_value('threading', "{=ini-get:/var/tuxbox/config/nhttpd.conf;webserver.threading;false=}");
	obj_set_radio_value('mod_sendfile_sendAll', "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;false=}");
	obj_set_radio_value('Tuxbox_DisplayLogos', "{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;true=}"); // MARTII

	do_check_input_LogosURL()
}
function do_submit()
{
	if(document.f.authpassword.value.length < 2)
		alert("{=L:set.nhttpd.check_password=}");
	else
	if(document.f.port.value == "")
		alert("{=L:set.nhttpd.check_port=}");
	else{
		show_waitbox(true);
		yhttpd_cache_clear("");
		document.f.submit();
	}
}
function do_check_input_LogosURL()
{
	if(document.getElementById('Tuxbox_DisplayLogos').checked == true)
		document.f.Tuxbox_LogosURL.readOnly = false;
	else
		document.f.Tuxbox_LogosURL.readOnly = true;
}
</script>
{=include-block:Y_Blocks.txt;head_close=}
<body onload="form_init()">
{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=}
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:menu={=L:set.nhttpd.webserver=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
	<form name="f" class="y_form" action="/y/cgi">
		<table border="0" width="100%">
			<tr><td colspan="2" class="y_form_header">{=L:set.nhttpd.authentication=}</td></tr>
			<tr>
				<td>{=L:user=}</td>
				<td><input type="text" name="authuser" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.username;{=var-get:default_username=}~open=}" title="{=L:user=}"/></td>
			</tr>
			<tr>
				<td>{=L:password=}</td>
				<td><input type="password" name="authpassword" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.password;{=var-get:default_password=}~cache=}" title="{=L:password=}"/></td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.client_without_authentication=}</td>
				<td><input type="text" name="noauthclient" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.no_auth_client~cache=}" title="{=L:set.nhttpd.client_without_authentication_desc=}"/></td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.authentication=}</td>
				<td>
					<input type="radio" name="authenticate" value="false" />{=L:off=}&nbsp;
					<input type="radio" name="authenticate" value="true" />{=L:on=}
				</td>
			</tr>
			<tr><td colspan="2" class="y_form_header">{=L:general=}</td></tr>
			<tr>
				<td>{=L:language=}</td>
				<td colspan="3">	<select name="language" title="{=L:language=}">
					{=func:get_languages_as_dropdown=}
				</select></td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.port=}</td>
				<td><input type="text" name="port" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80~cache=}" title="{=L:set.nhttpd.port=}"/>&nbsp;{=L:set.nhttpd.active_after_boot=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.host=}</td>
				<td><input type="text" name="host" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.host;0.0.0.0~cache=}" title="{=L:set.nhttpd.host_desc=}"/>&nbsp;{=L:set.nhttpd.active_after_boot=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.threading=}</td>
				<td>
					<input type="radio" name="threading" value="false" />{=L:off=}&nbsp;
					<input type="radio" name="threading" value="true" />{=L:on=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.alternate_web_folder=}</td>
				<td>
					<input type="text" name="override_directory" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory~cache=}" title="{=L:set.nhttpd.alternate_web_folder=}"/>&nbsp;{=L:set.nhttpd.active_after_boot=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.hosted_folder=}</td>
				<td>
					<input type="text" name="hosted_directory" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.hosted_directory~cache=}" title="Root of hosted Web. Enter mount directory."/>&nbsp;{=L:set.nhttpd.active_after_boot=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.allowed_file_extensions=}</td>
				<td><input type="text" name="mod_sendfile_mime_types" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types~cache=}"/></td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.allow_all_file_extensions=}</td>
				<td>
					<input type="radio" name="mod_sendfile_sendAll" value="false" />{=L:off=}&nbsp;
					<input type="radio" name="mod_sendfile_sendAll" value="true" />{=L:on=}
				</td>
			</tr>
			<tr><td colspan="2" class="y_form_header">{=L:logos=}</td></tr>
			<tr>
				<td>{=L:set.nhttpd.display_logos=}</td>
				<td>
					<input type="radio" name="Tuxbox_DisplayLogos" value="false" onClick="do_check_input_LogosURL()" />{=L:off=}&nbsp;
					<input type="radio" name="Tuxbox_DisplayLogos" value="true" onClick="do_check_input_LogosURL()" id="Tuxbox_DisplayLogos" />{=L:on=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.url_of_logos=}</td>
				<td><input type="text" name="Tuxbox_LogosURL" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL~cache=}" title="{=L:set.nhttpd.url_of_logos_desc=}"/></td>
			</tr>
			<tr><td colspan="2" class="y_form_header">{=L:set.nhttpd.server=}</td></tr>
			<tr>
				<td>{=L:set.nhttpd.cache=}</td>
				<td><a href="/y/cache-info" target="_blank"><u>{=L:set.nhttpd.cache_info=}</u>&nbsp;</a><button type="button" ytype="clear" name="clearcache" onclick="javascript:yhttpd_cache_clear('');">{=L:set.nhttpd.clear_cache=}</button></td>
			</tr>
			<tr>
				<td>{=L:set.nhttpd.server_configuration=}</td>
				<td><a href="/y/server-config" target="_blank"><u>{=L:set.nhttpd.server_configuration=}</u></a></td>
			</tr>
		</table>
		<br/>
		<input type="hidden" name="tmpl" value="/Y_Refresh.yhtm"/>
		<input type="hidden" name="execute" value="include-block:Y_Blocks.txt;nhttpd_save_settings;nix"/>
		<button type="button" ytype="save" title="{=L:save_values_desc=}" onclick="do_submit()">{=L:save=}</button>
	</form>
	</div>
</div>
</body>
</html>
{=include-block:Y_Blocks.txt;management_check_bottom=}
