Commit 0d2f56bd authored by Ad Schellevis's avatar Ad Schellevis

(legacy) work in progress refactor system_advanced_misc.php

parent dad9cf96
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2005-2007 Scott Ullrich Copyright (C) 2005-2007 Scott Ullrich
Copyright (C) 2008 Shrew Soft Inc Copyright (C) 2008 Shrew Soft Inc
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -38,45 +38,47 @@ require_once("pfsense-utils.inc"); ...@@ -38,45 +38,47 @@ require_once("pfsense-utils.inc");
require_once("services.inc"); require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$pconfig['proxyurl'] = $config['system']['proxyurl'];
$pconfig['proxyport'] = $config['system']['proxyport'];
$pconfig['proxyuser'] = $config['system']['proxyuser'];
$pconfig['proxypass'] = $config['system']['proxypass'];
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
$pconfig['srctrack'] = $config['system']['srctrack'];
$pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']);
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']);
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
$pconfig['powerd_ac_mode'] = "hadp";
if (!empty($config['system']['powerd_ac_mode'])) {
$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
}
$pconfig['powerd_battery_mode'] = "hadp";
if (!empty($config['system']['powerd_battery_mode'])) {
$pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
}
$crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"), $crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"),
'aesni' => gettext("AES-NI CPU-based Acceleration")); 'aesni' => gettext("AES-NI CPU-based Acceleration")
);
$thermal_hardware_modules = array( 'coretemp' => gettext("Intel Core* CPU on-die thermal sensor"),
'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor")); $thermal_hardware_modules = array('coretemp' => gettext("Intel Core* CPU on-die thermal sensor"),
'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor")
if ($_POST) { );
unset($input_errors);
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array();
$pconfig['proxyurl'] = !empty($config['system']['proxyurl']) ? $config['system']['proxyurl'] : null;
$pconfig['proxyport'] = !empty($config['system']['proxyport']) ? $config['system']['proxyport'] : null;
$pconfig['proxyuser'] = !empty($config['system']['proxyuser']) ? $config['system']['proxyuser'] : null;
$pconfig['proxypass'] = !empty($config['system']['proxypass']) ? $config['system']['proxypass'] : null;
$pconfig['harddiskstandby'] = !empty($config['system']['harddiskstandby']) ? $config['system']['harddiskstandby'] : null;
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
$pconfig['srctrack'] = !empty($config['system']['srctrack']) ? $config['system']['srctrack'] : null;
$pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']);
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
$pconfig['crypto_hardware'] = !empty($config['system']['crypto_hardware']) ? $config['system']['crypto_hardware'] : null;
$pconfig['thermal_hardware'] = !empty($config['system']['thermal_hardware']) ? $config['system']['thermal_hardware'] : null;
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']);
$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
$pconfig['powerd_ac_mode'] = "hadp";
if (!empty($config['system']['powerd_ac_mode'])) {
$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
}
$pconfig['powerd_battery_mode'] = "hadp";
if (!empty($config['system']['powerd_battery_mode'])) {
$pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
}
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
//
$input_errors = array();
$pconfig = $_POST; $pconfig = $_POST;
ob_flush();
flush();
if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules)) { if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules)) {
$input_errors[] = gettext("Please select a valid Cryptographic Accelerator."); $input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
} }
...@@ -85,7 +87,7 @@ if ($_POST) { ...@@ -85,7 +87,7 @@ if ($_POST) {
$input_errors[] = gettext("Please select a valid Thermal Hardware Sensor."); $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
} }
if (!$input_errors) { if (count($input_errors) == 0) {
if ($_POST['harddiskstandby'] <> "") { if ($_POST['harddiskstandby'] <> "") {
$config['system']['harddiskstandby'] = $_POST['harddiskstandby']; $config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
system_set_harddisk_standby(); system_set_harddisk_standby();
...@@ -205,6 +207,7 @@ if ($_POST) { ...@@ -205,6 +207,7 @@ if ($_POST) {
} }
} }
legacy_html_escape_form_data($pconfig);
$pgtitle = array(gettext("System"),gettext("Settings"),gettext("Miscellaneous")); $pgtitle = array(gettext("System"),gettext("Settings"),gettext("Miscellaneous"));
include("head.inc"); include("head.inc");
...@@ -217,110 +220,108 @@ include("head.inc"); ...@@ -217,110 +220,108 @@ include("head.inc");
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
function sticky_checked(obj) { function sticky_checked(obj) {
if (obj.checked) if (obj.checked) {
jQuery('#srctrack').attr('disabled',false); $('#srctrack').attr('disabled',false);
else } else {
jQuery('#srctrack').attr('disabled','true'); $('#srctrack').attr('disabled','true');
}
} }
function tmpvar_checked(obj) { function tmpvar_checked(obj) {
if (obj.checked) { if (obj.checked) {
jQuery('#rrdbackup').attr('disabled',false); $('#rrdbackup').attr('disabled',false);
jQuery('#dhcpbackup').attr('disabled',false); $('#dhcpbackup').attr('disabled',false);
jQuery('#rrdbackup').selectpicker('refresh'); $('#rrdbackup').selectpicker('refresh');
jQuery('#dhcpbackup').selectpicker('refresh'); $('#dhcpbackup').selectpicker('refresh');
} else { } else {
jQuery('#rrdbackup').attr('disabled','true'); $('#rrdbackup').attr('disabled','true');
jQuery('#dhcpbackup').attr('disabled','true'); $('#dhcpbackup').attr('disabled','true');
jQuery('#rrdbackup').selectpicker('refresh'); $('#rrdbackup').selectpicker('refresh');
jQuery('#dhcpbackup').selectpicker('refresh'); $('#dhcpbackup').selectpicker('refresh');
} }
} }
//]]> //]]>
</script> </script>
<!-- row --> <!-- row -->
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php <?php
if (isset($input_errors) && count($input_errors) > 0) { if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors); print_input_errors($input_errors);
} }
if (isset($savemsg)) { if (isset($savemsg)) {
print_info_box($savemsg); print_info_box($savemsg);
} }
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box tab-content"> <div class="content-box tab-content table-responsive">
<form action="system_advanced_misc.php" method="post" name="iform" id="iform"> <form action="system_advanced_misc.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area" class="table table-striped"> <table class="table table-striped">
<thead> <tr>
<tr> <td width="22%"><strong><?=gettext("Proxy support"); ?></strong></td>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Proxy support"); ?></th> <td width="78%" align="right">
</tr> <small><?=gettext("full help"); ?> </small>
</thead> <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i></a>
</td>
<tbody> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Proxy URL"); ?></td> <td><a id="help_for_proxyurl" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy URL"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="proxyurl" id="proxyurl" type="text" value="<?php if ($pconfig['proxyurl'] <> "") { <input name="proxyurl" id="proxyurl" type="text" value="<?=!empty($pconfig['proxyurl']) ? $pconfig['proxyurl'] : ""; ?>"/>
echo $pconfig['proxyurl']; <div class="hidden" for="help_for_proxyurl">
} ?>" class="formfld unknown" /> <?php printf(gettext("Proxy url for allowing %s to use this proxy to connect outside."), $g['product']); ?>
<br /> </div>
<?php printf(gettext("Proxy url for allowing %s to use this proxy to connect outside."), $g['product']); ?> </td>
</td> </tr>
</tr> <tr>
<tr> <td><a id="help_for_proxyport" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy Port"); ?></td>
<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Port"); ?></td> <td>
<td width="78%" class="vtable"> <input name="proxyport" id="proxyport" type="text" value="<?=!empty($pconfig['proxyport']) ? $pconfig['proxyport'] :"";?>"/>
<input name="proxyport" id="proxyport" type="text" value="<?php if ($pconfig['proxyport'] <> "") { <div class="hidden" for="help_for_proxyport">
echo $pconfig['proxyport']; <?php printf(gettext("Proxy port to use when %s connects to the proxy URL configured above. Default is 8080 for http protocol or 443 for ssl."), $g['product']); ?>
} ?>" class="formfld unknown" /> </div>
<br /> </td>
<?php printf(gettext("Proxy port to use when %s connects to the proxy URL configured above. Default is 8080 for http protocol or 443 for ssl."), $g['product']); ?> </tr>
</td> <tr>
</tr> <td><a id="help_for_proxyuser" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy Username"); ?></td>
<tr> <td>
<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Username"); ?></td> <input name="proxyuser" id="proxyuser" type="text" value="<?= !empty($pconfig['proxyuser']) ? $pconfig['proxyuser'] : "";?>"/>
<td width="78%" class="vtable"> <div class="hidden" for="help_for_proxyuser">
<input name="proxyuser" id="proxyuser" type="text" value="<?php if ($pconfig['proxyuser'] <> "") { <?php printf(gettext("Proxy username for allowing %s to use this proxy to connect outside"), $g['product']); ?>
echo $pconfig['proxyuser']; </div>
} ?>" class="formfld unknown" /> </td>
<br /> </tr>
<?php printf(gettext("Proxy username for allowing %s to use this proxy to connect outside"), $g['product']); ?> <tr>
</td> <td><a id="help_for_proxypassword" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy Pass"); ?></td>
</tr> <td>
<tr> <input type="password" name="proxypass" id="proxypass" value="<?= !empty($pconfig['proxypass']) ? $pconfig['proxypass'] : "";?>"/>
<td width="22%" valign="top" class="vncell"><?=gettext("Proxy Pass"); ?></td> <div class="hidden" for="help_for_proxypassword">
<td width="78%" class="vtable"> <?php printf(gettext("Proxy password for allowing %s to use this proxy to connect outside"), $g['product']); ?>
<input type="password" name="proxypass" id="proxypass" value="<?php if ($pconfig['proxypass'] <> "") { </div>
echo $pconfig['proxypass']; </td>
} ?>" class="formfld unknown" /> </tr>
<br /> <tr>
<?php printf(gettext("Proxy password for allowing %s to use this proxy to connect outside"), $g['product']); ?> <th colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></th>
</td> </tr>
</tr> <tr>
<td><a id="help_for_gw_switch_default" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Gateway switching");?> </td>
<tr> <td>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></th> <input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?= !empty($pconfig['gw_switch_default']) ? "checked=\"checked\"" : "";?> />
</tr> <strong><?=gettext("Allow default gateway switching"); ?></strong><br />
<tr> <div class="hidden" for="help_for_gw_switch_default">
<td width="22%" valign="top" class="vncell"></td> <?=gettext("If the link where the default gateway resides fails " .
<td width="78%" class="vtable">
<input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?php if ($pconfig['gw_switch_default']) {
echo "checked=\"checked\"";
} ?> />
<strong><?=gettext("Allow default gateway switching"); ?></strong><br />
<?=gettext("If the link where the default gateway resides fails " .
"switch the default gateway to another available one."); ?> "switch the default gateway to another available one."); ?>
<br /> </div>
<br /> </td>
<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) { </tr>
echo "checked=\"checked\""; <tr>
} ?> onclick="sticky_checked(this)" /> <td><a id="help_for_lb_use_sticky" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Sticky connections");?> </td>
<strong><?=gettext("Use sticky connections"); ?></strong><br /> <td>
<?=gettext("Successive connections will be redirected to the servers " . <input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?= !empty($pconfig['lb_use_sticky']) ? "checked=\"checked\"" :"";?> onclick="sticky_checked(this)" />
<strong><?=gettext("Use sticky connections"); ?></strong><br />
<div class="hidden" for="help_for_lb_use_sticky">
<?=gettext("Successive connections will be redirected to the servers " .
"in a round-robin manner with connections from the same " . "in a round-robin manner with connections from the same " .
"source being sent to the same web server. This 'sticky " . "source being sent to the same web server. This 'sticky " .
"connection' will exist as long as there are states that " . "connection' will exist as long as there are states that " .
...@@ -328,73 +329,70 @@ include("head.inc"); ...@@ -328,73 +329,70 @@ include("head.inc");
"the sticky connection. Further connections from that host " . "the sticky connection. Further connections from that host " .
"will be redirected to the next web server in the round " . "will be redirected to the next web server in the round " .
"robin. Changing this option will restart the Load Balancing service."); ?> "robin. Changing this option will restart the Load Balancing service."); ?>
<br /> </div>
<br /> <input placeholder="<?=gettext("Source tracking timeout");?>" title="<?=gettext("Source tracking timeout");?>" data-toggle="tooltip" data-placement="left" name="srctrack" id="srctrack" type="text" value="<?= !empty($pconfig['srctrack']) ? $pconfig['srctrack'] : "";?>" <?= empty($pconfig['lb_use_sticky']) ? "disabled=\"disabled\"" : "";?> />
<input name="srctrack" id="srctrack" type="text" value="<?php if ($pconfig['srctrack'] <> "") {
echo $pconfig['srctrack']; <div class="hidden" for="help_for_lb_use_sticky">
<?=gettext("Set the source tracking timeout for sticky connections. " .
} else {
"1400";
} ?>" class="formfld unknown" <?php if ($pconfig['lb_use_sticky'] == false) {
echo "disabled=\"disabled\"";
} ?> />
<?=gettext("Set the source tracking timeout for sticky connections. " .
"By default this is 0, so source tracking is removed as soon as the state expires. " . "By default this is 0, so source tracking is removed as soon as the state expires. " .
"Setting this timeout higher will cause the source/destination relationship to persist for longer periods of time."); ?> "Setting this timeout higher will cause the source/destination relationship to persist for longer periods of time."); ?>
</td> </div>
</tr> </td>
<tr> </tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></th> <tr>
</tr> <th colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></th>
<tr> </tr>
<td width="22%" valign="top" class="vncell"></td> <tr>
<td width="78%" class="vtable"> <td><a id="help_for_powerd_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Use PowerD"); ?></td>
<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) { <td>
echo "checked=\"checked\""; <input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?=!empty($pconfig['powerd_enable']) ? "checked=\"checked\"" : "";?> />
} ?> /> <hr/>
<strong><?=gettext("Use PowerD"); ?></strong><br /> <table class="table table-condensed">
<br /> <thead>
<?=gettext("On AC Power Mode"); ?>&nbsp;:&nbsp; <tr>
<select name="powerd_ac_mode" id="powerd_ac_mode" class="selectpicker" data-style="btn-default" data-width="auto"> <th><?=gettext("On AC Power Mode"); ?></th>
<option value="hadp"<?php if ($pconfig['powerd_ac_mode']=="hadp") { <th><?=gettext("On Battery Power Mode"); ?></th>
echo " selected=\"selected\""; </tr>
</thead>
} ?>><?=gettext("Hiadaptive");?></option> <tbody>
<option value="adp"<?php if ($pconfig['powerd_ac_mode']=="adp") { <tr>
echo " selected=\"selected\""; <td>
<select name="powerd_ac_mode" class="selectpicker" data-style="btn-default" data-width="auto">
} ?>><?=gettext("Adaptive");?></option> <option value="hadp" <?=$pconfig['powerd_ac_mode']=="hadp" ? "selected=\"selected\"" : "";?>>
<option value="min"<?php if ($pconfig['powerd_ac_mode']=="min") { <?=gettext("Hiadaptive");?>
echo " selected=\"selected\""; </option>
<option value="adp" <?=$pconfig['powerd_ac_mode']=="adp" ? "selected=\"selected\"" : "";?>>
} ?>><?=gettext("Minimum");?></option> <?=gettext("Adaptive");?>
<option value="max"<?php if ($pconfig['powerd_ac_mode']=="max") { </option>
echo " selected=\"selected\""; <option value="min" <?=$pconfig['powerd_ac_mode']=="min" ? "selected=\"selected\"" : "";?>>
<?=gettext("Minimum");?>
} ?>><?=gettext("Maximum");?></option> </option>
</select> <option value="max" <?=$pconfig['powerd_ac_mode']=="max" ? " selected=\"selected\"" : "";?>>
&nbsp;&nbsp; <?=gettext("Maximum");?>
<?=gettext("On Battery Power Mode"); ?>&nbsp;:&nbsp; </option>
<select name="powerd_battery_mode" id="powerd_battery_mode" class="selectpicker" data-style="btn-default" data-width="auto"> </select>
<option value="hadp"<?php if ($pconfig['powerd_battery_mode']=="hadp") { </td>
echo " selected=\"selected\""; <td>
<select name="powerd_battery_mode" class="selectpicker" data-style="btn-default" data-width="auto">
} ?>><?=gettext("Hiadaptive");?></option> <option value="hadp"<?=$pconfig['powerd_battery_mode']=="hadp" ? "selected=\"selected\"" : "";?>>
<option value="adp"<?php if ($pconfig['powerd_battery_mode']=="adp") { <?=gettext("Hiadaptive");?>
echo " selected=\"selected\""; </option>
<option value="adp" <?=$pconfig['powerd_battery_mode']=="adp" ? "selected=\"selected\"" : "";?>>
} ?>><?=gettext("Adaptive");?></option> <?=gettext("Adaptive");?>
<option value="min"<?php if ($pconfig['powerd_battery_mode']=="min") { </option>
echo " selected=\"selected\""; <option value="min" <?=$pconfig['powerd_battery_mode']=="min" ? "selected=\"selected\"" :"";?>>
<?=gettext("Minimum");?>
} ?>><?=gettext("Minimum");?></option> </option>
<option value="max"<?php if ($pconfig['powerd_battery_mode']=="max") { <option value="max" <?=$pconfig['powerd_battery_mode']=="max" ? "selected=\"selected\"" : "";?>>
echo " selected=\"selected\""; <?=gettext("Maximum");?>
</option>
} ?>><?=gettext("Maximum");?></option> </select>
</select> </td>
<br /><br /> </tr>
<?=gettext("The powerd utility monitors the system state and sets various power control " . </tbody>
</table>
<div class="hidden" for="help_for_powerd_enable">
<?=gettext("The powerd utility monitors the system state and sets various power control " .
"options accordingly. It offers four modes (maximum, minimum, adaptive " . "options accordingly. It offers four modes (maximum, minimum, adaptive " .
"and hiadaptive) that can be individually selected while on AC power or batteries. " . "and hiadaptive) that can be individually selected while on AC power or batteries. " .
"The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, " . "The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, " .
...@@ -407,182 +405,167 @@ include("head.inc"); ...@@ -407,182 +405,167 @@ include("head.inc");
"tuned for systems where performance and interactivity are more important " . "tuned for systems where performance and interactivity are more important " .
"than power consumption. It raises frequency faster, drops slower and " . "than power consumption. It raises frequency faster, drops slower and " .
"keeps twice lower CPU load."); ?> "keeps twice lower CPU load."); ?>
</td> </div>
</tr> </td>
<tr> </tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Hardware Acceleration"); ?></th> <tr>
</tr> <th colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Hardware Acceleration"); ?></th>
<tr> </tr>
<td width="22%" valign="top" class="vncell"></td> <tr>
<td width="78%" class="vtable"> <td><a id="help_for_crypto_hardware" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hardware");?></td>
<select name="crypto_hardware" id="crypto_hardware" class="selectpicker" data-style="btn-default"> <td>
<option value=""><?php echo gettext("None"); ?></option> <select name="crypto_hardware" id="crypto_hardware" class="selectpicker" data-style="btn-default">
<?php foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr) : <option value=""><?=gettext("None"); ?></option>
?> <?php
<option value="<?php echo $cryptomod_name; ?>" <?php if ($pconfig['crypto_hardware'] == $cryptomod_name) { foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr) :?>
echo " selected=\"selected\""; <option value="<?=$cryptomod_name; ?>" <?=$pconfig['crypto_hardware'] == $cryptomod_name ? "selected=\"selected\"" :"";?>>
} ?>><?php echo "{$cryptomod_descr} ({$cryptomod_name})"; ?></option> <?="{$cryptomod_descr} ({$cryptomod_name})"; ?>
<?php </option>
endforeach; ?> <?php
</select> endforeach; ?>
<br /> </select>
<?=gettext("A cryptographic accelerator module will use hardware support to speed up some " . <div class="hidden" for="help_for_crypto_hardware">
<?=gettext("A cryptographic accelerator module will use hardware support to speed up some " .
"cryptographic functions on systems which have the chip. Do not enable this " . "cryptographic functions on systems which have the chip. Do not enable this " .
"option if you have a Hifn cryptographic acceleration card, as this will take " . "option if you have a Hifn cryptographic acceleration card, as this will take " .
"precedence and the Hifn card will not be used. Acceleration should be automatic " . "precedence and the Hifn card will not be used. Acceleration should be automatic " .
"for IPsec when using a cipher supported by your chip, such as AES-128. OpenVPN " . "for IPsec when using a cipher supported by your chip, such as AES-128. OpenVPN " .
"should be set for AES-128-CBC and have cryptodev enabled for hardware " . "should be set for AES-128-CBC and have cryptodev enabled for hardware " .
"acceleration."); ?> "acceleration."); ?>
<br /><br /> <br /><br />
<?=gettext("If you do not have a crypto chip in your system, this option will have no " . <?=gettext("If you do not have a crypto chip in your system, this option will have no " .
"effect. To unload the selected module, set this option to 'none' and then reboot."); ?> "effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></th> <th colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></th>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"></td> <td><a id="help_for_thermal_hardware" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hardware");?> </td>
<td width="78%" class="vtable"> <td>
<select name="thermal_hardware" id="thermal_hardware" class="selectpicker" data-style="btn-default"> <select name="thermal_hardware" class="selectpicker" data-style="btn-default">
<option value=""><?php echo gettext("None/ACPI"); ?></option> <option value=""><?=gettext("None/ACPI"); ?></option>
<?php foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr) : <?php
?> foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr) :?>
<option value="<?php echo $themalmod_name; ?>" <?php if ($pconfig['thermal_hardware'] == $themalmod_name) { <option value="<?=$themalmod_name; ?>" <?=$pconfig['thermal_hardware'] == $themalmod_name ? " selected=\"selected\"" :"";?>>
echo " selected=\"selected\""; <?="{$themalmod_descr} ({$themalmod_name})"; ?>
} ?>><?php echo "{$themalmod_descr} ({$themalmod_name})"; ?></option> </option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
<br /> <div class="hidden" for="help_for_thermal_hardware">
<?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropriate " . <?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropriate " .
"driver to read its temperature. Setting this to 'None' will attempt to read the " . "driver to read its temperature. Setting this to 'None' will attempt to read the " .
"temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?> "temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?>
<br /><br /> <br /><br />
<?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " . <?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " .
"effect. To unload the selected module, set this option to 'none' and then reboot."); ?> "effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
</td> </div>
</tr> </td>
<tr> </tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></th> <tr>
</tr> <th colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></th>
<tr> </tr>
<td width="22%" valign="top" class="vncell"></td> <tr>
<td width="78%" class="vtable"> <td><a id="help_for_schedule_states" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Schedule States"); ?></td>
<input name="schedule_states" type="checkbox" id="schedule_states" value="yes" <?php if ($pconfig['schedule_states']) { <td>
echo "checked=\"checked\""; <input name="schedule_states" type="checkbox" value="yes" <?=!empty($pconfig['schedule_states']) ? "checked=\"checked\"" :"";?> />
} ?> /> <div class="hidden" for="help_for_schedule_states">
<strong><?=gettext("Schedule States"); ?></strong> <?=gettext("By default schedules clear the states of existing connections when the expiration time has come. ".
<br />
<?=gettext("By default schedules clear the states of existing connections when the expiration time has come. ".
"This option overrides that behavior by not clearing states for existing connections."); ?> "This option overrides that behavior by not clearing states for existing connections."); ?>
</td> </div>
</tr> </td>
<tr> </tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></th> <tr>
</tr> <th colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></th>
<tr> </tr>
<td width="22%" valign="top" class="vncell"></td> <tr>
<td width="78%" class="vtable"> <td><a id="help_for_kill_states" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Kill states");?> </td>
<input name="kill_states" type="checkbox" id="kill_states" value="yes" <?php if ($pconfig['kill_states']) { <td>
echo "checked=\"checked\""; <input name="kill_states" type="checkbox" id="kill_states" value="yes" <?= !empty($pconfig['kill_states']) ? "checked=\"checked\"" : "";?> />
} ?> /> <strong><?=gettext("State Killing on Gateway Failure"); ?></strong>
</strong><?=gettext("State Killing on Gateway Failure"); ?></strong> <div class="hidden" for="help_for_kill_states">
<br /> <?=gettext("The monitoring process will flush states for a gateway that goes down if this box is not checked. Check this box to disable this behavior."); ?>
<?=gettext("The monitoring process will flush states for a gateway that goes down if this box is not checked. Check this box to disable this behavior."); ?> </div>
<br /> </td>
<br /> </tr>
<input name="skip_rules_gw_down" type="checkbox" id="skip_rules_gw_down" value="yes" <?php if ($pconfig['skip_rules_gw_down']) { <tr>
echo "checked=\"checked\""; <td><a id="help_for_skip_rules_gw_down" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Skip rules");?> </td>
} ?> /> <td>
<strong><?=gettext("Skip rules when gateway is down"); ?></strong> <input name="skip_rules_gw_down" type="checkbox" id="skip_rules_gw_down" value="yes" <?=!empty($pconfig['skip_rules_gw_down']) ? "checked=\"checked\"" : "";?> />
<br /> <strong><?=gettext("Skip rules when gateway is down"); ?></strong>
<?=gettext("By default, when a rule has a specific gateway set, and this gateway is down, ". <div class="hidden" for="help_for_skip_rules_gw_down">
<?=gettext("By default, when a rule has a specific gateway set, and this gateway is down, ".
"rule is created and traffic is sent to default gateway.This option overrides that behavior ". "rule is created and traffic is sent to default gateway.This option overrides that behavior ".
"and the rule is not created when gateway is down"); ?> "and the rule is not created when gateway is down"); ?>
</td> </div>
</tr> </td>
<tr> </tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></th> <tr>
</tr> <th colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></th>
<tr> </tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Use RAM Disks"); ?></td> <tr>
<td width="78%" class="vtable"> <td><a id="help_for_use_mfs_tmpvar" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Use RAM Disks"); ?></td>
<input name="use_mfs_tmpvar" type="checkbox" id="use_mfs_tmpvar" value="yes" <?php if ($pconfig['use_mfs_tmpvar']) { <td>
echo "checked=\"checked\""; <input name="use_mfs_tmpvar" type="checkbox" id="use_mfs_tmpvar" value="yes" <?=!empty($pconfig['use_mfs_tmpvar']) ? "checked=\"checked\"" : "";?> onclick="tmpvar_checked(this)" />
} ?> onclick="tmpvar_checked(this)" /> <div class="hidden" for="help_for_use_mfs_tmpvar">
<strong><?=gettext("Use memory file system for /tmp and /var"); ?></strong><br /> <strong><?=gettext("Use memory file system for /tmp and /var"); ?></strong><br />
<?=gettext("Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install " . <?=gettext("Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install " .
"rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost at reboot, including log data. RRD and DHCP Leases will be retained."); ?> "rather than use the hard disk. Setting this will cause the data in /tmp and /var to be lost at reboot, including log data. RRD and DHCP Leases will be retained."); ?>
</td> </div>
</tr> </td>
<tr> </tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic RRD Backup");?></td> <tr>
<td width="78%" class="vtable"> <td><a id="help_for_rrdbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic RRD Backup");?></td>
<select name="rrdbackup" class="selectpicker" data-style="btn-default" id="rrdbackup" <?php if ($pconfig['use_mfs_tmpvar'] == false) { <td>
echo "disabled=\"disabled\""; <select name="rrdbackup" class="selectpicker" data-style="btn-default" id="rrdbackup" <?=empty($pconfig['use_mfs_tmpvar']) ? "disabled=\"disabled\"" : "";?> >
} ?> > <option value='0' <?=!isset($config['system']['rrdbackup']) || $config['system']['rrdbackup'] == 0 ? "selected='selected'" : "";?>>
<option value='0' <?php if (!isset($config['system']['rrdbackup']) || ($config['system']['rrdbackup'] == 0)) { <?=gettext("Disable"); ?>
echo "selected='selected'"; </option>
<?php
} ?>><?=gettext("Disable"); ?></option> for ($x=1; $x<=24; $x++):?>
<?php for ($x=1; $x<=24; $x++) { <option value='<?= $x ?>' <?= $config['system']['rrdbackup'] == $x ? "selected='selected'" : "";?>>
?> <?= $x ?> <?=gettext("hour"); ?><?=($x>1) ? "s" : "";?>
<option value='<?= $x ?>' <?php if ($config['system']['rrdbackup'] == $x) { </option>
echo "selected='selected'"; <?php
endfor; ?>
} ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) { </select>
echo "s"; <br />
} ?></option> <div class="hidden" for="help_for_rrdbackup">
<?php <?=gettext("This will periodically backup the RRD data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
} ?> </div>
</select> </td>
<br /> </tr>
<?=gettext("This will periodically backup the RRD data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?> <tr>
<br /> <td><a id="help_for_dhcpbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic DHCP Leases Backup");?></td>
<br /> <td>
</td> <select name="dhcpbackup" class="selectpicker" data-style="btn-default" id="dhcpbackup" <?=empty($pconfig['use_mfs_tmpvar']) ? "disabled=\"disabled\"" : "";?> >
</tr> <option value='0' <?= !isset($config['system']['dhcpbackup']) || ($config['system']['dhcpbackup'] == 0) ? "selected='selected'" : ""; ?>><?=gettext("Disable"); ?></option>
<tr> <?php
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic DHCP Leases Backup");?></td> for ($x=1; $x<=24; $x++):?>
<td width="78%" class="vtable"> <option value='<?= $x ?>' <?= $config['system']['dhcpbackup'] == $x ? "selected='selected'" : "";?>>
<select name="dhcpbackup" class="selectpicker" data-style="btn-default" id="dhcpbackup" <?php if ($pconfig['use_mfs_tmpvar'] == false) { <?= $x ?> <?=gettext("hour"); ?><?=($x>1) ? "s" : "";?>
echo "disabled=\"disabled\""; </option>
} ?> > <?php
<option value='0' <?php if (!isset($config['system']['dhcpbackup']) || ($config['system']['dhcpbackup'] == 0)) { endfor; ?>
echo "selected='selected'"; </select>
<div class="hidden" for="help_for_dhcpbackup">
} ?>><?=gettext("Disable"); ?></option> <?=gettext("This will periodically backup the DHCP leases data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
<?php for ($x=1; $x<=24; $x++) { </div>
?> </td>
<option value='<?= $x ?>' <?php if ($config['system']['dhcpbackup'] == $x) { </tr>
echo "selected='selected'"; <tr>
<td>&nbsp;</td>
} ?>><?= $x ?> <?=gettext("hour"); ?><?php if ($x>1) { <td>
echo "s"; <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
} ?></option> </td>
<?php </tr>
} ?> </table>
</select> </form>
<br />
<?=gettext("This will periodically backup the DHCP leases data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.");?>
<br />
<br />
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
</td>
</tr>
</tbody>
</table>
</form>
</div>
</section>
</div> </div>
</div> </section>
</div>
</div>
</section> </section>
<?php include("foot.inc"); <?php include("foot.inc");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment