. 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. */ /* pfSense_MODULE: system */ ##|+PRIV ##|*IDENT=page-diagnostics-logs-settings ##|*NAME=Diagnostics: Logs: Settings page ##|*DESCR=Allow access to the 'Diagnostics: Logs: Settings' page. ##|*MATCH=diag_logs_settings.php* ##|-PRIV require("guiconfig.inc"); require_once("functions.inc"); require_once("filter.inc"); require_once("shaper.inc"); $pconfig['reverse'] = isset($config['syslog']['reverse']); $pconfig['nentries'] = $config['syslog']['nentries']; $pconfig['remoteserver'] = $config['syslog']['remoteserver']; $pconfig['remoteserver2'] = $config['syslog']['remoteserver2']; $pconfig['remoteserver3'] = $config['syslog']['remoteserver3']; $pconfig['sourceip'] = $config['syslog']['sourceip']; $pconfig['ipproto'] = $config['syslog']['ipproto']; $pconfig['filter'] = isset($config['syslog']['filter']); $pconfig['dhcp'] = isset($config['syslog']['dhcp']); $pconfig['portalauth'] = isset($config['syslog']['portalauth']); $pconfig['vpn'] = isset($config['syslog']['vpn']); $pconfig['apinger'] = isset($config['syslog']['apinger']); $pconfig['relayd'] = isset($config['syslog']['relayd']); $pconfig['hostapd'] = isset($config['syslog']['hostapd']); $pconfig['logall'] = isset($config['syslog']['logall']); $pconfig['system'] = isset($config['syslog']['system']); $pconfig['enable'] = isset($config['syslog']['enable']); $pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']); $pconfig['logbogons'] = !isset($config['syslog']['nologbogons']); $pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']); $pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']); $pconfig['rawfilter'] = isset($config['syslog']['rawfilter']); $pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions']; $pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']); $pconfig['logfilesize'] = $config['syslog']['logfilesize']; if (!$pconfig['nentries']) $pconfig['nentries'] = 50; function is_valid_syslog_server($target) { return (is_ipaddr($target) || is_ipaddrwithport($target) || is_hostname($target) || is_hostnamewithport($target)); } if ($_POST['resetlogs'] == gettext("Reset Log Files")) { clear_all_log_files(); $savemsg .= gettext("The log files have been reset."); } elseif ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ if ($_POST['enable'] && !is_valid_syslog_server($_POST['remoteserver'])) { $input_errors[] = gettext("A valid IP address/hosname or IP/hostname:port must be specified for remote syslog server #1."); } if ($_POST['enable'] && $_POST['remoteserver2'] && !is_valid_syslog_server($_POST['remoteserver2'])) { $input_errors[] = gettext("A valid IP address/hosname or IP/hostname:port must be specified for remote syslog server #2."); } if ($_POST['enable'] && $_POST['remoteserver3'] && !is_valid_syslog_server($_POST['remoteserver3'])) { $input_errors[] = gettext("A valid IP address/hosname or IP/hostname:port must be specified for remote syslog server #3."); } if (($_POST['nentries'] < 5) || ($_POST['nentries'] > 2000)) { $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000."); } if (isset($_POST['logfilesize']) && (strlen($_POST['logfilesize']) > 0)) { if (!is_numeric($_POST['logfilesize']) || ($_POST['logfilesize'] < 5120)) { $input_errors[] = gettext("Log file size must be a positive integer greater than 5120."); } } if (!$input_errors) { $config['syslog']['reverse'] = $_POST['reverse'] ? true : false; $config['syslog']['nentries'] = (int)$_POST['nentries']; $pconfig['nentries'] = $config['syslog']['nentries']; if (isset($_POST['logfilesize']) && (strlen($_POST['logfilesize']) > 0)) { $config['syslog']['logfilesize'] = (int)$_POST['logfilesize']; $pconfig['logfilesize'] = $config['syslog']['logfilesize']; } else { unset($config['syslog']['logfilesize']); } $config['syslog']['remoteserver'] = $_POST['remoteserver']; $config['syslog']['remoteserver2'] = $_POST['remoteserver2']; $config['syslog']['remoteserver3'] = $_POST['remoteserver3']; $config['syslog']['sourceip'] = $_POST['sourceip']; $config['syslog']['ipproto'] = $_POST['ipproto']; $config['syslog']['filter'] = $_POST['filter'] ? true : false; $config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false; $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false; $config['syslog']['vpn'] = $_POST['vpn'] ? true : false; $config['syslog']['apinger'] = $_POST['apinger'] ? true : false; $config['syslog']['relayd'] = $_POST['relayd'] ? true : false; $config['syslog']['hostapd'] = $_POST['hostapd'] ? true : false; $config['syslog']['logall'] = $_POST['logall'] ? true : false; $config['syslog']['system'] = $_POST['system'] ? true : false; $config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false; $config['syslog']['enable'] = $_POST['enable'] ? true : false; $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']); $oldnologbogons = isset($config['syslog']['nologbogons']); $oldnologprivatenets = isset($config['syslog']['nologprivatenets']); $oldnologlighttpd = isset($config['syslog']['nologlighttpd']); $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true; $config['syslog']['nologbogons'] = $_POST['logbogons'] ? false : true; $config['syslog']['nologprivatenets'] = $_POST['logprivatenets'] ? false : true; $config['syslog']['nologlighttpd'] = $_POST['loglighttpd'] ? false : true; $config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false; if (is_numeric($_POST['filterdescriptions']) && $_POST['filterdescriptions'] > 0) $config['syslog']['filterdescriptions'] = $_POST['filterdescriptions']; else unset($config['syslog']['filterdescriptions']); if($config['syslog']['enable'] == false) { unset($config['syslog']['remoteserver']); unset($config['syslog']['remoteserver2']); unset($config['syslog']['remoteserver3']); } write_config(); $retval = 0; $retval = system_syslogd_start(); if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) || ($oldnologbogons !== isset($config['syslog']['nologbogons'])) || ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) $retval |= filter_configure(); $savemsg = get_std_save_message($retval); if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) { ob_flush(); flush(); log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator.")); send_event("service restart webgui"); $savemsg .= "
" . gettext("WebGUI process is restarting."); } filter_pflog_start(true); } } $pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Settings")); $closehead = false; include("head.inc"); ?>
Forward/Reverse Display />
GUI Log Entries to Display
Log File Size (Bytes)


. .
Log Firewall Default Blocks />

/>

/>
Web Server Log />
Raw Logs />
Filter descriptions
Local Logging onclick="enable_change(false)" />
Reset Logs " onclick="return confirm('')" />

 




onclick="enable_change(false)" />
 
onclick="check_everything();" />

/>
/>
/>
/>
/>
/>
/>
/>
  " onclick="enable_change(true)" />
 
.