system_advanced_misc.php 31.7 KB
Newer Older
Ad Schellevis's avatar
Ad Schellevis committed
1
<?php
2

Ad Schellevis's avatar
Ad Schellevis committed
3
/*
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
  Copyright (C) 2014-2015 Deciso B.V.
  Copyright (C) 2005-2007 Scott Ullrich
  Copyright (C) 2008 Shrew Soft Inc
  Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
  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.
Ad Schellevis's avatar
Ad Schellevis committed
30 31
*/

32
require_once("guiconfig.inc");
Ad Schellevis's avatar
Ad Schellevis committed
33 34 35
require_once("filter.inc");
require_once("vpn.inc");
require_once("vslb.inc");
36
require_once("system.inc");
37
require_once("pfsense-utils.inc");
38
require_once("services.inc");
39
require_once("interfaces.inc");
Ad Schellevis's avatar
Ad Schellevis committed
40 41 42


$crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"),
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
                        '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")
);



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['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";
69 70
    $pconfig['rrdbackup'] = !empty($config['system']['rrdbackup']) ? $config['system']['rrdbackup'] : null;
    $pconfig['dhcpbackup'] = !empty($config['system']['dhcpbackup']) ? $config['system']['dhcpbackup'] : null;
71 72 73 74 75 76 77 78 79 80
    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();
81
    $pconfig = $_POST;
Ad Schellevis's avatar
Ad Schellevis committed
82

83
    if (!empty($pconfig['crypto_hardware']) && !array_key_exists($pconfig['crypto_hardware'], $crypto_modules)) {
84 85 86
        $input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
    }

87
    if (!empty($pconfig['thermal_hardware']) && !array_key_exists($pconfig['thermal_hardware'], $thermal_hardware_modules)) {
88 89 90
        $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
    }

91
    if (count($input_errors) == 0) {
92
        if (!empty($pconfig['proxyurl'])) {
93
            $config['system']['proxyurl'] = $_POST['proxyurl'];
94
        } elseif (isset($config['system']['proxyurl'])) {
95 96 97
            unset($config['system']['proxyurl']);
        }

98 99 100
        if (!empty($pconfig['proxyport'])) {
            $config['system']['proxyport'] = $pconfig['proxyport'];
        } elseif (isset($config['system']['proxyport'])) {
101 102 103
            unset($config['system']['proxyport']);
        }

104 105 106
        if (!empty($pconfig['proxyuser'])) {
            $config['system']['proxyuser'] = $pconfig['proxyuser'];
        } elseif (isset($config['system']['proxyuser'])) {
107 108 109
            unset($config['system']['proxyuser']);
        }

110 111 112
        if (!empty($pconfig['proxypass'])) {
            $config['system']['proxypass'] = $pconfig['proxypass'];
        } elseif (isset($config['system']['proxypass'])) {
113 114 115 116
            unset($config['system']['proxypass']);
        }

        $need_relayd_restart = false;
117
        if (!empty($pconfig['lb_use_sticky'])) {
118 119 120 121
            if (!isset($config['system']['lb_use_sticky'])) {
                $config['system']['lb_use_sticky'] = true;
                $need_relayd_restart = true;
            }
122 123 124 125 126 127 128 129
        } elseif (isset($config['system']['lb_use_sticky'])) {
            unset($config['system']['lb_use_sticky']);
            $need_relayd_restart = true;
        }
        if (!empty($pconfig['srctrack'])) {
            $config['system']['srctrack'] = $pconfig['srctrack'];
        } elseif (isset($config['system']['srctrack'])) {
            unset($config['system']['srctrack']);
130 131
        }

132 133

        if (!empty($pconfig['gw_switch_default'])) {
134
            $config['system']['gw_switch_default'] = true;
135
        } elseif (isset($config['system']['gw_switch_default'])) {
136 137 138
            unset($config['system']['gw_switch_default']);
        }

139
        if (!empty($pconfig['powerd_enable'])) {
140
            $config['system']['powerd_enable'] = true;
141
        } elseif (isset($config['system']['powerd_enable'])) {
142 143 144
            unset($config['system']['powerd_enable']);
        }

145 146
        $config['system']['powerd_ac_mode'] = $pconfig['powerd_ac_mode'];
        $config['system']['powerd_battery_mode'] = $pconfig['powerd_battery_mode'];
147

148 149 150
        if ($pconfig['crypto_hardware']) {
            $config['system']['crypto_hardware'] = $pconfig['crypto_hardware'];
        } elseif (isset($config['system']['crypto_hardware'])) {
151 152 153
            unset($config['system']['crypto_hardware']);
        }

154 155 156
        if (!empty($pconfig['thermal_hardware'])) {
            $config['system']['thermal_hardware'] = $pconfig['thermal_hardware'];
        } elseif (isset($config['system']['thermal_hardware'])) {
157 158 159
            unset($config['system']['thermal_hardware']);
        }

160
        if (!empty($pconfig['schedule_states'])) {
161
            $config['system']['schedule_states'] = true;
162
        } elseif (isset($config['system']['schedule_states'])) {
163 164 165
            unset($config['system']['schedule_states']);
        }

166
        if (!empty($pconfig['kill_states'])) {
167
            $config['system']['kill_states'] = true;
168
        } elseif (isset($config['system']['kill_states'])) {
169 170 171
            unset($config['system']['kill_states']);
        }

172
        if (!empty($pconfig['skip_rules_gw_down'])) {
173
            $config['system']['skip_rules_gw_down'] = true;
174
        } elseif (isset($config['system']['skip_rules_gw_down'])) {
175 176 177
            unset($config['system']['skip_rules_gw_down']);
        }

178
        if (!empty($pconfig['use_mfs_tmpvar'])) {
179
            $config['system']['use_mfs_tmpvar'] = true;
180
        } elseif (isset($config['system']['use_mfs_tmpvar'])) {
181 182 183
            unset($config['system']['use_mfs_tmpvar']);
        }

184
        if (!empty($pconfig['rrdbackup'])) {
185 186
            $config['system']['rrdbackup'] = $_POST['rrdbackup'];
            install_cron_job("/usr/local/etc/rc.backup_rrd", ($config['system']['rrdbackup'] > 0), $minute = "0", "*/{$config['system']['rrdbackup']}");
187 188 189
        } elseif (isset($config['system']['rrdbackup'])) {
            install_cron_job("/usr/local/etc/rc.backup_rrd", false, $minute = "0", "*/{$config['system']['rrdbackup']}");
            unset($config['system']['rrdbackup']);
190
        }
191 192
        if (!empty($pconfig['dhcpbackup'])) {
            $config['system']['dhcpbackup'] = $pconfig['dhcpbackup'];
193
            install_cron_job("/usr/local/etc/rc.backup_dhcpleases", ($config['system']['dhcpbackup'] > 0), $minute = "0", "*/{$config['system']['dhcpbackup']}");
194 195 196
        } elseif (isset($config['system']['dhcpbackup'])) {
            install_cron_job("/usr/local/etc/rc.backup_dhcpleases", false, $minute = "0", "*/{$config['system']['dhcpbackup']}");
            unset($config['system']['dhcpbackup']);
197 198 199
        }

        write_config();
200
        $savemsg = get_std_save_message();
201 202

        system_resolvconf_generate(true);
203
        filter_configure();
204 205 206 207 208 209 210
        activate_powerd();
        load_crypto();
        load_thermal_hardware();
        if ($need_relayd_restart) {
            relayd_configure();
        }
    }
Ad Schellevis's avatar
Ad Schellevis committed
211 212
}

213
legacy_html_escape_form_data($pconfig);
214

Ad Schellevis's avatar
Ad Schellevis committed
215 216 217 218
include("head.inc");

?>

219 220
<body>
    <?php
221
    include("fbegin.inc");
222 223 224 225
    ?>
    <script type="text/javascript">
    //<![CDATA[
    function sticky_checked(obj) {
226 227 228 229 230
      if (obj.checked) {
        $('#srctrack').attr('disabled',false);
      } else {
        $('#srctrack').attr('disabled','true');
      }
231 232
    }
    function tmpvar_checked(obj) {
233 234 235 236 237 238 239 240 241 242 243
      if (obj.checked) {
        $('#rrdbackup').attr('disabled',false);
        $('#dhcpbackup').attr('disabled',false);
        $('#rrdbackup').selectpicker('refresh');
        $('#dhcpbackup').selectpicker('refresh');
      } else {
        $('#rrdbackup').attr('disabled','true');
        $('#dhcpbackup').attr('disabled','true');
        $('#rrdbackup').selectpicker('refresh');
        $('#dhcpbackup').selectpicker('refresh');
      }
244
    }
245 246
//]]>
</script>
247 248

<section class="page-content-main">
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
  <div class="container-fluid">
    <div class="row">
<?php
    if (isset($input_errors) && count($input_errors) > 0) {
        print_input_errors($input_errors);
    }
    if (isset($savemsg)) {
        print_info_box($savemsg);
    }
?>
      <section class="col-xs-12">
        <div class="content-box tab-content table-responsive">
          <form action="system_advanced_misc.php" method="post" name="iform" id="iform">
            <table class="table table-striped">
              <tr>
                <td width="22%"><strong><?=gettext("Proxy support"); ?></strong></td>
                <td  width="78%" align="right">
                  <small><?=gettext("full help"); ?> </small>
                  <i class="fa fa-toggle-off text-danger"  style="cursor: pointer;" id="show_all_help_page" type="button"></i></a>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_proxyurl" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy URL"); ?></td>
                <td>
                  <input name="proxyurl" id="proxyurl" type="text" value="<?=!empty($pconfig['proxyurl']) ? $pconfig['proxyurl'] : ""; ?>"/>
                  <div class="hidden" for="help_for_proxyurl">
                    <?php printf(gettext("Proxy url for allowing %s to use this proxy to connect outside."), $g['product']); ?>
                  </div>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_proxyport" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy Port"); ?></td>
                <td>
                  <input name="proxyport" id="proxyport" type="text" value="<?=!empty($pconfig['proxyport']) ? $pconfig['proxyport'] :"";?>"/>
                  <div class="hidden" for="help_for_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']); ?>
                  </div>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_proxyuser" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy Username"); ?></td>
                <td>
                  <input name="proxyuser" id="proxyuser" type="text" value="<?= !empty($pconfig['proxyuser']) ? $pconfig['proxyuser'] : "";?>"/>
                  <div class="hidden" for="help_for_proxyuser">
                    <?php printf(gettext("Proxy username for allowing %s to use this proxy to connect outside"), $g['product']); ?>
                  </div>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_proxypassword" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Proxy Pass"); ?></td>
                <td>
                  <input type="password" name="proxypass" id="proxypass" value="<?= !empty($pconfig['proxypass']) ? $pconfig['proxypass'] : "";?>"/>
                  <div class="hidden" for="help_for_proxypassword">
                    <?php printf(gettext("Proxy password for allowing %s to use this proxy to connect outside"), $g['product']); ?>
                  </div>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("Load Balancing"); ?></th>
              </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>
                <td>
                  <input name="gw_switch_default" type="checkbox" id="gw_switch_default" value="yes" <?= !empty($pconfig['gw_switch_default']) ? "checked=\"checked\"" : "";?> />
                  <strong><?=gettext("Allow default gateway switching"); ?></strong><br />
                  <div class="hidden" for="help_for_gw_switch_default">
                    <?=gettext("If the link where the default gateway resides fails " .
316
                                        "switch the default gateway to another available one."); ?>
317 318 319 320 321 322 323 324 325 326
                  </div>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_lb_use_sticky" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Sticky connections");?> </td>
                <td>
                  <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 " .
327 328 329 330 331 332 333
                                        "in a round-robin manner with connections from the same " .
                                        "source being sent to the same web server. This 'sticky " .
                                        "connection' will exist as long as there are states that " .
                                        "refer to this connection. Once the states expire, so will " .
                                        "the sticky connection. Further connections from that host " .
                                        "will be redirected to the next web server in the round " .
                                        "robin. Changing this option will restart the Load Balancing service."); ?>
334 335 336 337 338
                  </div>
                  <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\"" : "";?> />

                  <div class="hidden" for="help_for_lb_use_sticky">
                    <?=gettext("Set the source tracking timeout for sticky connections. " .
339 340
                                        "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."); ?>
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
                  </div>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("Power savings"); ?></th>
              </tr>
              <tr>
                <td><a id="help_for_powerd_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Use PowerD"); ?></td>
                <td>
                  <input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?=!empty($pconfig['powerd_enable']) ? "checked=\"checked\"" : "";?> />
                  <hr/>
                  <table class="table table-condensed">
                      <thead>
                        <tr>
                          <th><?=gettext("On AC Power Mode"); ?></th>
                          <th><?=gettext("On Battery Power Mode"); ?></th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <td>
                            <select name="powerd_ac_mode" class="selectpicker" data-style="btn-default" data-width="auto">
                              <option value="hadp" <?=$pconfig['powerd_ac_mode']=="hadp" ? "selected=\"selected\"" : "";?>>
                                <?=gettext("Hiadaptive");?>
                              </option>
                              <option value="adp" <?=$pconfig['powerd_ac_mode']=="adp" ? "selected=\"selected\"" : "";?>>
                                <?=gettext("Adaptive");?>
                              </option>
                              <option value="min" <?=$pconfig['powerd_ac_mode']=="min" ? "selected=\"selected\"" : "";?>>
                                <?=gettext("Minimum");?>
                              </option>
                              <option value="max" <?=$pconfig['powerd_ac_mode']=="max" ? " selected=\"selected\"" : "";?>>
                                <?=gettext("Maximum");?>
                              </option>
                            </select>
                          </td>
                          <td>
                            <select name="powerd_battery_mode" class="selectpicker" data-style="btn-default" data-width="auto">
                              <option value="hadp"<?=$pconfig['powerd_battery_mode']=="hadp" ? "selected=\"selected\"" : "";?>>
                                <?=gettext("Hiadaptive");?>
                              </option>
                              <option value="adp" <?=$pconfig['powerd_battery_mode']=="adp" ? "selected=\"selected\"" : "";?>>
                                <?=gettext("Adaptive");?>
                              </option>
                              <option value="min" <?=$pconfig['powerd_battery_mode']=="min" ? "selected=\"selected\"" :"";?>>
                                <?=gettext("Minimum");?>
                              </option>
                              <option value="max" <?=$pconfig['powerd_battery_mode']=="max" ? "selected=\"selected\"" : "";?>>
                                <?=gettext("Maximum");?>
                              </option>
                            </select>
                          </td>
                        </tr>
                      </tbody>
                  </table>
                  <div class="hidden" for="help_for_powerd_enable">
                    <?=gettext("The powerd utility monitors the system state and sets various power control " .
398 399 400 401 402 403 404 405 406 407 408 409
                                        "options accordingly.  It offers four modes (maximum, minimum, adaptive " .
                                        "and hiadaptive) that can be individually selected while on AC power or batteries. " .
                                        "The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, " .
                                        "min, adp, hadp.  Maximum mode chooses the highest performance values.  Minimum " .
                                        "mode selects the lowest performance values to get the most power savings. " .
                                        "Adaptive mode attempts to strike a balance by degrading performance when " .
                                        "the system appears idle and increasing it when the system is busy.  It " .
                                        "offers a good balance between a small performance loss for greatly " .
                                        "increased power savings.  Hiadaptive mode is alike adaptive mode, but " .
                                        "tuned for systems where performance and interactivity are more important " .
                                        "than power consumption.  It raises frequency faster, drops slower and " .
                                        "keeps twice lower CPU load."); ?>
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
                  </div>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Hardware Acceleration"); ?></th>
              </tr>
              <tr>
                <td><a id="help_for_crypto_hardware" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hardware");?></td>
                <td>
                  <select name="crypto_hardware" id="crypto_hardware" class="selectpicker" data-style="btn-default">
                    <option value=""><?=gettext("None"); ?></option>
<?php
                    foreach ($crypto_modules as $cryptomod_name => $cryptomod_descr) :?>
                      <option value="<?=$cryptomod_name; ?>" <?=$pconfig['crypto_hardware'] == $cryptomod_name ? "selected=\"selected\"" :"";?>>
                        <?="{$cryptomod_descr} ({$cryptomod_name})"; ?>
                      </option>
<?php
                    endforeach; ?>
                  </select>
                  <div class="hidden" for="help_for_crypto_hardware">
                    <?=gettext("A cryptographic accelerator module will use hardware support to speed up some " .
431 432 433 434 435 436
                                            "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 " .
                                            "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 " .
                                            "should be set for AES-128-CBC and have cryptodev enabled for hardware " .
                                            "acceleration."); ?>
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
                  <br /><br />
                  <?=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."); ?>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></th>
              </tr>
              <tr>
                <td><a id="help_for_thermal_hardware" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hardware");?> </td>
                <td>
                  <select name="thermal_hardware" class="selectpicker" data-style="btn-default">
                    <option value=""><?=gettext("None/ACPI"); ?></option>
<?php
                    foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr) :?>
                      <option value="<?=$themalmod_name; ?>" <?=$pconfig['thermal_hardware'] == $themalmod_name ? " selected=\"selected\"" :"";?>>
                        <?="{$themalmod_descr} ({$themalmod_name})"; ?>
                      </option>
<?php
                    endforeach; ?>
                  </select>
                  <div class="hidden" for="help_for_thermal_hardware">
                    <?=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 " .
                                              "temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?>
                    <br /><br />
                    <?=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."); ?>
                  </div>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("Schedules"); ?></th>
              </tr>
              <tr>
                <td><a id="help_for_schedule_states" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Schedule States"); ?></td>
                <td>
                  <input name="schedule_states" type="checkbox" value="yes" <?=!empty($pconfig['schedule_states']) ? "checked=\"checked\"" :"";?> />
                  <div class="hidden" for="help_for_schedule_states">
                    <?=gettext("By default schedules clear the states of existing connections when the expiration time has come. ".
477
                                        "This option overrides that behavior by not clearing states for existing connections."); ?>
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
                  </div>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></th>
              </tr>
              <tr>
                <td><a id="help_for_kill_states" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Kill states");?> </td>
                <td>
                  <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>
                  <div class="hidden" for="help_for_kill_states">
                    <?=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>
                </td>
              </tr>
              <tr>
                <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>
                  <input name="skip_rules_gw_down" type="checkbox" id="skip_rules_gw_down" value="yes" <?=!empty($pconfig['skip_rules_gw_down']) ? "checked=\"checked\"" : "";?> />
                  <strong><?=gettext("Skip rules when gateway is down"); ?></strong>
                  <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, ".
501 502
                                        "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"); ?>
503 504 505 506 507 508 509 510 511 512 513 514 515
                  </div>
                </td>
              </tr>
              <tr>
                <th colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></th>
              </tr>
              <tr>
                <td><a id="help_for_use_mfs_tmpvar" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Use RAM Disks"); ?></td>
                <td>
                  <input name="use_mfs_tmpvar" type="checkbox" id="use_mfs_tmpvar" value="yes" <?=!empty($pconfig['use_mfs_tmpvar']) ? "checked=\"checked\"" : "";?> 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 />
                    <?=gettext("Set this if you wish to use /tmp and /var as RAM disks (memory file system disks) on a full install " .
516
                                        "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."); ?>
517 518 519 520 521 522 523
                  </div>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_rrdbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic RRD Backup");?></td>
                  <td>
                    <select name="rrdbackup" class="selectpicker" data-style="btn-default" id="rrdbackup" <?=empty($pconfig['use_mfs_tmpvar']) ? "disabled=\"disabled\"" : "";?> >
524
                      <option value='0' <?=!$pconfig['rrdbackup'] == 0 ? "selected='selected'" : "";?>>
525 526 527 528
                        <?=gettext("Disable"); ?>
                      </option>
<?php
                      for ($x=1; $x<=24; $x++):?>
529
                      <option value='<?= $x ?>' <?= $pconfig['rrdbackup'] == $x ? "selected='selected'" : "";?>>
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
                        <?= $x ?> <?=gettext("hour"); ?><?=($x>1) ? "s" : "";?>
                      </option>
<?php
                      endfor; ?>
                  </select>
                  <br />
                  <div class="hidden" for="help_for_rrdbackup">
                    <?=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>
                </td>
              </tr>
              <tr>
                <td><a id="help_for_dhcpbackup" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Periodic DHCP Leases Backup");?></td>
                <td>
                  <select name="dhcpbackup" class="selectpicker" data-style="btn-default" id="dhcpbackup" <?=empty($pconfig['use_mfs_tmpvar']) ? "disabled=\"disabled\"" : "";?> >
545
                    <option value='0' <?= $pconfig['dhcpbackup'] == 0 ? "selected='selected'" : ""; ?>><?=gettext("Disable"); ?></option>
546 547
<?php
                    for ($x=1; $x<=24; $x++):?>
548
                    <option value='<?= $x ?>' <?= $pconfig['dhcpbackup'] == $x ? "selected='selected'" : "";?>>
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
                      <?= $x ?> <?=gettext("hour"); ?><?=($x>1) ? "s" : "";?>
                    </option>
<?php
                    endfor; ?>
                  </select>
                  <div class="hidden" for="help_for_dhcpbackup">
                    <?=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.");?>
                  </div>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>
                  <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
                </td>
              </tr>
            </table>
          </form>
567
        </div>
568 569 570
      </section>
    </div>
  </div>
571 572
</section>

573
<?php include("foot.inc");