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

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

// Create data access object.
ConfigDao dao = new ConfigDao();

// Action.
String actionFlag = paramString("actionFlag");
if(!demoFlag && actionFlag.equals("backup")){
	String filename = dao.backup();
	if(isNotEmpty(filename)){
		response.sendRedirect("download.jsp?filename=" + filename);
		return;
	}
}
%>
<%@include file="include/action_info.jsp"%>

<!-- view -->
<form action="<%= getPageName()%>" method="post">
<input type="hidden" name="actionFlag" value="backup">

<fieldset>
<legend>BACKUP</legend>
<table width="100%" class="view">

	<tr>
		<td>
By clicking the button below, you will download a zip file containing the backup for your configuration. When you restore your configuration<br>
from the backup file, stop NxFilter and copy and overwrite 'config.h2.db' into '/nxfilter/db' directory.
		</td>
	</tr>

	<tr>
		<td><input type="button" value="CREATE BACKUP"
			onclick="javascript:this.form.submit()"></td>
	</tr>

</table>
</fieldset>

</form>
<!-- /view -->

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