<%@include file="include/header.jsp"%>
<%
//-----------------------------------------------
// Set permission for this page.
permission.addAdmin();

//Check permission.
if(!checkPermission()){
	return;
}

// Create data access object.
PolicyProxyDao proxyDao = new PolicyProxyDao(paramInt("opId"));
PolicyApplicationDao appConDao = new PolicyApplicationDao(paramInt("opId"));

// Global.
PolicyProxyData proxyData = proxyDao.selectOne();
PolicyApplicationData appConData = appConDao.selectOne();
%>
<!-- view -->
<fieldset>
<legend>PROXY FILTER</legend>

<table class="view">
	<tr>
		<td width="200">Enable Proxy</td>
		<td>
		<input type="checkbox" class="no-border" name="enableProxy"
			<%if(proxyData.enableProxy){out.print("checked");}%>>
			</td>
	</tr>

	<tr>
		<td>Block IP host</td>
		<td><input type="checkbox" class="no-border" name="blockIpHost"
			<%if(proxyData.blockIpHost){out.print("checked");}%>></td>
	</tr>

	<tr>
		<td>Block Other Browser</td>
		<td>
		<input type="checkbox" class="no-border" name="blockOtherBrowser"
			<%if(proxyData.blockOtherBrowser){out.print("checked");}%>>
			</td>
	</tr>

	<tr>
		<td>IE Proxy Bypass</td>
		<td>
			<textarea name="ieProxyBypass" cols="80" rows="2"><%= proxyData.ieProxyBypass%></textarea>
		</td>
	</tr>

	<tr>
		<td>Query Cache TTL</td>
		<td><input type="text" name="cacheTtl" value="<%= proxyData.cacheTtl%>" size="2"> seconds, 60 ~ 3600</td>
	</tr>

</table>
</fieldset>
<!-- /view -->

<!-- view -->
<fieldset>
<legend>APPLICATION CONTROL</legend>
<table class="view">

	<tr>
		<td width="200">Enable Control</td>
		<td>
		<input type="checkbox" class="no-border" name="enableControl"
			<%if(appConData.enableControl){out.print("checked");}%>>
			</td>
	</tr>

	<tr>
		<td>Block UltraSurf</td>
		<td><input type="checkbox" class="no-border" name="blockUltrasurf"
			<%if(appConData.blockUltrasurf){out.print("checked");}%>></td>
	</tr>

	<tr>
		<td>Block Tor</td>
		<td><input type="checkbox" class="no-border" name="blockTor"
			<%if(appConData.blockTor){out.print("checked");}%>></td>
	</tr>

	<tr>
		<td>Blocked Process Name</td>
		<td>
			<textarea name="pname" cols="80" rows="4"><%= appConData.pname%></textarea>
		</td>
	</tr>

	<tr>
		<td>Excluded Keywords</td>
		<td>
			<textarea name="exclude" cols="80" rows="2"><%= appConData.exclude%></textarea>
		</td>
	</tr>

	<tr>
		<td>Execution Interval</td>
		<td><input type="text" name="executionInterval" size="4" maxlength="4"
			value="<%= appConData.executionInterval%>"> seconds, 15 ~ 300</td>
	</tr>

</table>
</fieldset>
<!-- /view -->

<%@include file="include/footer.jsp"%>
