summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-12-21 08:55:52 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-12-21 08:55:52 -0500
commitffa383cb968dc4a57421e3fcaf31a7b5284d5e9b (patch)
tree0645af49bcc3fff58e336976630f91c86cbaeabb /src/usr/local/www
parent07271d6c92c9b9e8e3f4f157b8f6254d86629979 (diff)
parent3c85b0f9cfab5ebd3a490f84f493efc964612955 (diff)
downloadpfsense-ffa383cb968dc4a57421e3fcaf31a7b5284d5e9b.zip
pfsense-ffa383cb968dc4a57421e3fcaf31a7b5284d5e9b.tar.gz
Merge pull request #2301 from NOYB/Staus_-_System_-_Logs_-_Write_Config_Only
Diffstat (limited to 'src/usr/local/www')
-rwxr-xr-xsrc/usr/local/www/status_logs.php18
-rw-r--r--src/usr/local/www/status_logs_filter.php34
2 files changed, 39 insertions, 13 deletions
diff --git a/src/usr/local/www/status_logs.php b/src/usr/local/www/status_logs.php
index 9b069f0..4a1ff52 100755
--- a/src/usr/local/www/status_logs.php
+++ b/src/usr/local/www/status_logs.php
@@ -214,17 +214,27 @@ if ($save_settings) {
if ($logfile == 'system') {
$oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
$config['syslog']['nologlighttpd'] = $loglighttpd ? false : true;
+
+ if ($oldnologlighttpd !== $config['syslog']['nologlighttpd']) {
+ $logging_changed = $lighttpd_logging_changed = true;
+ }
}
- write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]));
+ // If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync).
+ if ($logging_changed) {
+ write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
+ $retval = 0;
+ $retval = system_syslogd_start();
+ } else {
+ write_config($desc = "Log Display Settings Saved (no backup, no sync): " . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
+ }
- $retval = 0;
- $savemsg = get_std_save_message($retval);
+ $savemsg = gettext("The changes have been applied successfully.");
# System General (main) Specific
if ($logfile == 'system') {
- if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
+ if ($lighttpd_logging_changed) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
diff --git a/src/usr/local/www/status_logs_filter.php b/src/usr/local/www/status_logs_filter.php
index 60432eb..132c76b 100644
--- a/src/usr/local/www/status_logs_filter.php
+++ b/src/usr/local/www/status_logs_filter.php
@@ -236,6 +236,10 @@ if ($save_settings) {
if ($logfile == 'system') {
$oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
$config['syslog']['nologlighttpd'] = $loglighttpd ? false : true;
+
+ if ($oldnologlighttpd !== $config['syslog']['nologlighttpd']) {
+ $logging_changed = $lighttpd_logging_changed = true;
+ }
}
# Firewall Specific
@@ -255,17 +259,31 @@ if ($save_settings) {
} else {
unset($config['syslog']['filterdescriptions']);
}
+
+ if (
+ ($oldnologdefaultblock !== $config['syslog']['nologdefaultblock']) ||
+ ($oldnologdefaultpass !== $config['syslog']['nologdefaultpass']) ||
+ ($oldnologbogons !== $config['syslog']['nologbogons']) ||
+ ($oldnologprivatenets !== $config['syslog']['nologprivatenets'])) {
+ $logging_changed = $firewall_logging_changed = true;
+ }
}
- write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]));
+ // If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync).
+ if ($logging_changed) {
+ write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
+ $retval = 0;
+ $retval = system_syslogd_start();
+ } else {
+ write_config($desc = "Log Display Settings Saved (no backup, no sync): " . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
+ }
- $retval = 0;
- $savemsg = get_std_save_message($retval);
+ $savemsg = gettext("The changes have been applied successfully.");
# System General (main) Specific
if ($logfile == 'system') {
- if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
+ if ($lighttpd_logging_changed) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
@@ -276,14 +294,12 @@ if ($save_settings) {
# Firewall Specific
if ($logfile == 'filter') {
- if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) ||
- ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) ||
- ($oldnologbogons !== isset($config['syslog']['nologbogons'])) ||
- ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) {
-
+ if ($firewall_logging_changed) {
require_once("filter.inc");
$retval |= filter_configure();
filter_pflog_start(true);
+
+ $savemsg = get_std_save_message($retval);
}
}
}
OpenPOWER on IntegriCloud