Project

General

Profile

« Previous | Next » 

Revision 057d15dc

Added by Jim Pingle over 6 years ago

Fix a potential source of PHP errors when saving per-log settings. Fixes #9540

While here, fix save descriptions.

(cherry picked from commit 303641f8283016a88f53c7743c962e16ba683579)

View differences:

src/usr/local/www/status_logs_common.inc
583 583
		return;
584 584
	}
585 585

  
586
	global $logfile, $specific_log, $config, $pconfig, $save_settings, $input_errors, $extra_save_msg, $retval, $changes_applied;
586
	global $logfile, $specific_log, $config, $pconfig, $save_settings, $input_errors, $extra_save_msg, $retval, $changes_applied, $allowed_logs;
587 587

  
588 588
	$changes_applied = false;
589 589
	$extra_save_msg = "";
590 590
	$specific_log = basename($logfile) . '_settings';
591
	init_config_arr(array('syslog', $specific_log));
591 592

  
592 593
	// Common to All Logs
593 594
	$pconfig['cronorder'] = isset($config['syslog'][$specific_log]['cronorder']) ? $config['syslog'][$specific_log]['cronorder'] : "forward";
......
719 720
			$changes_applied = true;
720 721

  
721 722
		// 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).
723
			$log_friendly_name = empty($allowed_logs[$logfile]["name"]) ? $logfile : $allowed_logs[$logfile]["name"];
722 724
			if ($logging_changed) {
723
				write_config($desc = gettext("Log Display Settings Saved: ") . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false);
725
				write_config($desc = gettext("Log Display Settings Saved: ") . gettext($log_friendly_name), $backup = true, $write_config_only = false);
724 726
				system_syslogd_start();
725 727
			} else {
726
				write_config($desc = gettext("Log Display Settings Saved (no backup, no sync): ") . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true);
728
				write_config($desc = gettext("Log Display Settings Saved (no backup, no sync): ") . gettext($log_friendly_name), $backup = false, $write_config_only = true);
727 729
			}
728 730

  
729 731
		// Specific to System General (main) Log

Also available in: Unified diff