Trigger reload at end of page

This commit is contained in:
Scott Ullrich 2006-03-11 05:41:30 +00:00
parent 4ca53d18bd
commit a6318c60cc

View File

@ -573,20 +573,140 @@ include("head.inc");
<script language="JavaScript" type="text/javascript">
<!--
enable_change(false);
//enable_altfirmwareurl(false);
//enable_altpkgconfigurl(false);
//-->
</script>
<?php include("fend.inc"); ?>
</body>
</html>
<?php
if ($_POST) {
if (!$input_errors) {
if($_POST['disablefilter'] == "yes") {
$config['system']['disablefilter'] = "enabled";
} else {
unset($config['system']['disablefilter']);
}
if($_POST['enablesshd'] == "yes") {
$config['system']['enablesshd'] = "enabled";
touch("{$g['tmp_path']}/start_sshd");
} else {
unset($config['system']['enablesshd']);
mwexec("/usr/bin/killall sshd");
}
$oldsshport = $config['system']['ssh']['port'];
$config['system']['ssh']['port'] = $_POST['sshport'];
if($_POST['polling_enable'] == "yes") {
$config['system']['polling'] = true;
setup_polling();
} else {
unset($config['system']['polling']);
setup_polling();
}
if($_POST['sharednet'] == "yes") {
$config['system']['sharednet'] = true;
system_disable_arp_wrong_if();
} else {
unset($config['system']['sharednet']);
system_enable_arp_wrong_if();
}
if($_POST['rfc959workaround'] == "yes")
$config['system']['rfc959workaround'] = "enabled";
else
unset($config['system']['rfc959workaround']);
if($_POST['ipv6nat_enable'] == "yes") {
$config['diag']['ipv6nat']['enable'] = true;
$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
} else {
unset($config['diag']['ipv6nat']['enable']);
unset($config['diag']['ipv6nat']['ipaddr']);
}
$oldcert = $config['system']['webgui']['certificate'];
$oldkey = $config['system']['webgui']['private-key'];
$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
if($_POST['disableconsolemenu'] == "yes") {
$config['system']['disableconsolemenu'] = true;
auto_login(true);
} else {
unset($config['system']['disableconsolemenu']);
auto_login(false);
}
unset($config['system']['webgui']['expanddiags']);
$config['system']['optimization'] = $_POST['optimization'];
if($_POST['disablefirmwarecheck'] == "yes")
$config['system']['disablefirmwarecheck'] = true;
else
unset($config['system']['disablefirmwarecheck']);
if ($_POST['enableserial'] == "yes")
$config['system']['enableserial'] = true;
else
unset($config['system']['enableserial']);
if($_POST['harddiskstandby'] <> "") {
$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
system_set_harddisk_standby();
} else
unset($config['system']['harddiskstandby']);
if ($_POST['noantilockout'] == "yes")
$config['system']['webgui']['noantilockout'] = true;
else
unset($config['system']['webgui']['noantilockout']);
/* Firewall and ALTQ options */
$config['system']['maximumstates'] = $_POST['maximumstates'];
if($_POST['enablesshd'] == "yes") {
$config['system']['enablesshd'] = $_POST['enablesshd'];
} else {
unset($config['system']['enablesshd']);
}
if($_POST['disablenatreflection'] == "yes") {
$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
} else {
unset($config['system']['disablenatreflection']);
}
$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;
/* pfSense themes */
$config['theme'] = $_POST['theme'];
write_config();
$retval = 0;
config_lock();
$retval = filter_configure();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message($retval);
else
$savemsg = $retval;
$retval |= interfaces_optional_configure();
config_unlock();
setup_serial_port();
setup_filter_bridge();
}
}
if (($config['system']['webgui']['certificate'] != $oldcert)
|| ($config['system']['webgui']['private-key'] != $oldkey)) {
touch("/tmp/restart_webgui");
}
?>
</body>
</html>
?>