* Copyright (C) 2008 Shrew Soft Inc. * Copyright (C) 2003-2004 Manuel Kasper * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ require_once("guiconfig.inc"); require_once("filter.inc"); require_once("system.inc"); if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig = array(); $pconfig['ipv6allow'] = isset($config['system']['ipv6allow']); $pconfig['disablefilter'] = !empty($config['system']['disablefilter']); $pconfig['optimization'] = isset($config['system']['optimization']) ? $config['system']['optimization'] : "normal"; $pconfig['state-policy'] = isset($config['system']['state-policy']) ; $pconfig['rulesetoptimization'] = isset($config['system']['rulesetoptimization']) ? $config['system']['rulesetoptimization'] : "basic"; $pconfig['maximumstates'] = isset($config['system']['maximumstates']) ? $config['system']['maximumstates'] : null; $pconfig['maximumfrags'] = isset($config['system']['maximumfrags']) ? $config['system']['maximumfrags'] : null; $pconfig['adaptivestart'] = isset($config['system']['adaptivestart']) ? $config['system']['adaptivestart'] : null; $pconfig['adaptiveend'] = isset($config['system']['adaptiveend']) ? $config['system']['adaptiveend'] : null; $pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']); $pconfig['aliasesresolveinterval'] = isset($config['system']['aliasesresolveinterval']) ? $config['system']['aliasesresolveinterval'] : null; $pconfig['checkaliasesurlcert'] = isset($config['system']['checkaliasesurlcert']); $pconfig['maximumtableentries'] = !empty($config['system']['maximumtableentries']) ? $config['system']['maximumtableentries'] : null ; $pconfig['disablereplyto'] = isset($config['system']['disablereplyto']); $pconfig['bogonsinterval'] = !empty($config['system']['bogons']['interval']) ? $config['system']['bogons']['interval'] : null; $pconfig['schedule_states'] = isset($config['system']['schedule_states']); $pconfig['kill_states'] = !empty($config['system']['kill_states']); $pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']); $pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']); $pconfig['pf_share_forward'] = isset($config['system']['pf_share_forward']); $pconfig['pf_disable_force_gw'] = isset($config['system']['pf_disable_force_gw']); $pconfig['srctrack'] = !empty($config['system']['srctrack']) ? $config['system']['srctrack'] : null; $pconfig['natreflection'] = empty($config['system']['disablenatreflection']); $pconfig['enablebinatreflection'] = !empty($config['system']['enablebinatreflection']); $pconfig['enablenatreflectionhelper'] = isset($config['system']['enablenatreflectionhelper']) ? $config['system']['enablenatreflectionhelper'] : null; $pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']); $pconfig['ip_change_kill_states'] = isset($config['system']['ip_change_kill_states']); } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { $pconfig = $_POST; $input_errors = array(); /* input validation */ if ((empty($pconfig['adaptivestart']) && !empty($pconfig['adaptiveend'])) || (!empty($pconfig['adaptivestart']) && empty($pconfig['adaptiveend']))) { $input_errors[] = gettext("The Firewall Adaptive values must be set together."); } if (!empty($pconfig['adaptivestart']) && !is_numericint($pconfig['adaptivestart'])) { $input_errors[] = gettext("The Firewall Adaptive Start value must be an integer."); } if (!empty($pconfig['adaptiveend']) && !is_numericint($pconfig['adaptiveend'])) { $input_errors[] = gettext("The Firewall Adaptive End value must be an integer."); } if (!empty($pconfig['maximumstates']) && !is_numericint($pconfig['maximumstates'])) { $input_errors[] = gettext("The Firewall Maximum States value must be an integer."); } if (!empty($pconfig['maximumfrags']) && !is_numericint($pconfig['maximumfrags'])) { $input_errors[] = gettext("The Firewall Maximum Frags value must be an integer."); } if (!empty($pconfig['aliasesresolveinterval']) && !is_numericint($pconfig['aliasesresolveinterval'])) { $input_errors[] = gettext("The Aliases Hostname Resolve Interval value must be an integer."); } if (!empty($pconfig['maximumtableentries']) && !is_numericint($pconfig['maximumtableentries'])) { $input_errors[] = gettext("The Firewall Maximum Table Entries value must be an integer."); } if (count($input_errors) == 0) { if (!empty($pconfig['pf_share_forward'])) { $config['system']['pf_share_forward'] = true; } elseif (isset($config['system']['pf_share_forward'])) { unset($config['system']['pf_share_forward']); } if (!empty($pconfig['pf_disable_force_gw'])) { $config['system']['pf_disable_force_gw'] = true; } elseif (isset($config['system']['pf_disable_force_gw'])) { unset($config['system']['pf_disable_force_gw']); } if (!empty($pconfig['lb_use_sticky'])) { $config['system']['lb_use_sticky'] = true; } elseif (isset($config['system']['lb_use_sticky'])) { unset($config['system']['lb_use_sticky']); } if ($pconfig['noantilockout'] == "yes") { $config['system']['webgui']['noantilockout'] = true; } elseif (isset($config['system']['webgui']['noantilockout'])) { unset($config['system']['webgui']['noantilockout']); } if (!empty($pconfig['srctrack'])) { $config['system']['srctrack'] = $pconfig['srctrack']; } elseif (isset($config['system']['srctrack'])) { unset($config['system']['srctrack']); } if (!empty($pconfig['ipv6allow'])) { $config['system']['ipv6allow'] = true; } elseif (isset($config['system']['ipv6allow'])) { unset($config['system']['ipv6allow']); } if (!empty($pconfig['disablefilter'])) { $config['system']['disablefilter'] = "enabled"; } elseif (isset($config['system']['disablefilter'])) { unset($config['system']['disablefilter']); } if (!empty($pconfig['adaptiveend'])) { $config['system']['adaptiveend'] = $pconfig['adaptiveend']; } elseif (isset($config['system']['adaptiveend'])) { unset($config['system']['adaptiveend']); } if (!empty($pconfig['adaptivestart'])) { $config['system']['adaptivestart'] = $pconfig['adaptivestart']; } elseif (isset($config['system']['adaptivestart'])) { unset($config['system']['adaptivestart']); } if (!empty($pconfig['checkaliasesurlcert'])) { $config['system']['checkaliasesurlcert'] = true; } elseif (isset($config['system']['checkaliasesurlcert'])) { unset($config['system']['checkaliasesurlcert']); } /* setting is inverted on the page */ if (empty($pconfig['natreflection'])) { $config['system']['disablenatreflection'] = 'yes'; } elseif (isset($config['system']['disablenatreflection'])) { unset($config['system']['disablenatreflection']); } if (!empty($pconfig['enablebinatreflection'])) { $config['system']['enablebinatreflection'] = "yes"; } elseif (isset($config['system']['enablebinatreflection'])) { unset($config['system']['enablebinatreflection']); } if (!empty($pconfig['disablereplyto'])) { $config['system']['disablereplyto'] = $pconfig['disablereplyto']; } elseif (isset($config['system']['disablereplyto'])) { unset($config['system']['disablereplyto']); } if (!empty($pconfig['enablenatreflectionhelper'])) { $config['system']['enablenatreflectionhelper'] = "yes"; } elseif (isset($config['system']['enablenatreflectionhelper'])) { unset($config['system']['enablenatreflectionhelper']); } if (!empty($pconfig['state-policy'])) { $config['system']['state-policy'] = true; } elseif (!empty($config['system']['state-policy'])) { unset($config['system']['state-policy']); } $config['system']['optimization'] = $pconfig['optimization']; $config['system']['rulesetoptimization'] = $pconfig['rulesetoptimization']; $config['system']['maximumstates'] = $pconfig['maximumstates']; $config['system']['maximumfrags'] = $pconfig['maximumfrags']; $config['system']['aliasesresolveinterval'] = $pconfig['aliasesresolveinterval']; $config['system']['maximumtableentries'] = $pconfig['maximumtableentries']; if (!empty($pconfig['bypassstaticroutes'])) { $config['filter']['bypassstaticroutes'] = $pconfig['bypassstaticroutes']; } elseif (isset($config['filter']['bypassstaticroutes'])) { unset($config['filter']['bypassstaticroutes']); } if ($pconfig['bogonsinterval'] != $config['system']['bogons']['interval']) { $config['system']['bogons']['interval'] = $pconfig['bogonsinterval']; } if (!empty($pconfig['schedule_states'])) { $config['system']['schedule_states'] = true; } elseif (isset($config['system']['schedule_states'])) { unset($config['system']['schedule_states']); } if (!empty($pconfig['kill_states'])) { $config['system']['kill_states'] = true; } elseif (isset($config['system']['kill_states'])) { unset($config['system']['kill_states']); } if (!empty($pconfig['skip_rules_gw_down'])) { $config['system']['skip_rules_gw_down'] = true; } elseif (isset($config['system']['skip_rules_gw_down'])) { unset($config['system']['skip_rules_gw_down']); } if (!empty($pconfig['ip_change_kill_states'])) { $config['system']['ip_change_kill_states'] = true; } elseif (isset($config['system']['ip_change_kill_states'])) { unset($config['system']['ip_change_kill_states']); } write_config(); $savemsg = get_std_save_message(); system_cron_configure(); filter_configure(); } } legacy_html_escape_form_data($pconfig); include("head.inc"); ?>
0) { print_input_errors($input_errors); } if (isset($savemsg)) { print_info_box($savemsg); } ?>
1): ?>
onclick="enable_change(false)" />
/>
/>
/>
/>
/>
/>
" title="" name="srctrack" id="srctrack" type="text" value=""/>
/>
/>
/>
/>
/>
/>
/>
/>
/>
/>