<?php

include('header.php');
include ('permissions.inc.php');
$acl=checkacl("admin", $dbconn);
if ($acl=="Y") {
	
	if ($op=="save") {
		$query="update inprotect_settings set nessus_plugins_url='$plugins_url', nessus_plugins_file='$plugins_file', nessus_install_url='$nessus_url', nessus_install_file='$nessus_file', mailfrom='$mailfrom', inprotect_url='$inprotect_url', inprotect_path='$inprotect_path', nessus_plugins_md5='$plugins_md5'";
		$result=$dbconn->execute($query);

	}
	

	//Display Inprotect Settings
	$query="select * from inprotect_settings limit 1";
	$result=$dbconn->execute($query);
	list($plugins_url, $plugins_file, $plugins_md5, $nessus_url, $nessus_file, $mailfrom, $inprotect_url, $inprotect_path)=$result->fields;
	echo "
	<form method=\"post\" action=\"webconfig.php?op=save\">
	<table border=0>
	<tr><td>Nessus Download URL</td>
	<td><input type=\"text\" name=\"nessus_url\" value=\"$nessus_url\"></td></tr>
	<tr><td>Nessus FileName</td>
        <td><input type=\"text\" name=\"nessus_file\" value=\"$nessus_file\"></td></tr>
	<tr><td>Plugins Download URL</td>
        <td><input type=\"text\" name=\"plugins_url\" value=\"$plugins_url\"></td></tr>
	<tr><td>Plugins FileName</td>
        <td><input type=\"text\" name=\"plugins_file\" value=\"$plugins_file\"></td></tr>
	<tr><td>Plugins MD5</td>
        <td><input type=\"text\" name=\"plugins_md5\" value=\"$plugins_md5\"></td></tr>	
	<tr><td>Mail From Address</td>
        <td><input type=\"text\" name=\"mailfrom\" value=\"$mailfrom\"></td></tr>
	<tr><td>Inprotect URL</td>
        <td><input type=\"text\" name=\"inprotect_url\" value=\"$inprotect_url\"></td></tr>
	<tr><td>Inprotect Webroot</td>
        <td><input type=\"text\" name=\"inprotect_path\" value=\"$inprotect_path\"></td></tr>
	</table>
	<input type=\"submit\" name=\"submit\" value=\"Save\">
	</form>";
}
else {
	echo "Access denied!!!";

}




include('footer.php');

?>
