Skip to content

Commit

Permalink
System: Settings: Administration - possible issue when syslog contain…
Browse files Browse the repository at this point in the history
…er doesn't exist in the config. closes opnsense#7323
  • Loading branch information
AdSchellevis committed Mar 13, 2024
1 parent 661e55d commit 022ab7a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/www/system_advanced_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
$pconfig['deployment'] = $config['system']['deployment'] ?? '';

/* XXX not really a syslog setting */
$pconfig['loglighttpd'] = empty($config['syslog']['nologlighttpd']);
$pconfig['loglighttpd'] = empty($config['syslog']) || empty($config['syslog']['nologlighttpd']);

/* XXX listtag "fun" */
$pconfig['sshlogingroup'] = !empty($config['system']['ssh']['group'][0]) ? $config['system']['ssh']['group'][0] : null;
Expand Down Expand Up @@ -152,6 +152,7 @@
if (count($input_errors) == 0) {
$newinterfaces = !empty($pconfig['webguiinterfaces']) ? implode(',', $pconfig['webguiinterfaces']) : '';
$newciphers = !empty($pconfig['ssl-ciphers']) ? implode(':', $pconfig['ssl-ciphers']) : '';
$syslog_conf = &config_read_array('syslog');

$restart_webgui = $config['system']['webgui']['protocol'] != $pconfig['webguiproto'] ||
($config['system']['webgui']['session_timeout'] ?? '') != $pconfig['session_timeout'] ||
Expand All @@ -164,15 +165,15 @@
empty($pconfig['ssl-hsts']) != empty($config['system']['webgui']['ssl-hsts']) ||
!empty($pconfig['disablehttpredirect']) != !empty($config['system']['webgui']['disablehttpredirect']) ||
($config['system']['deployment'] ?? '') != $pconfig['deployment'] ||
!empty($config['syslog']['nologlighttpd']) != empty($pconfig['loglighttpd']);
!empty($syslog_conf['nologlighttpd']) != empty($pconfig['loglighttpd']);

$config['system']['webgui']['protocol'] = $pconfig['webguiproto'];
$config['system']['webgui']['port'] = $pconfig['webguiport'];
$config['system']['webgui']['ssl-certref'] = $pconfig['ssl-certref'];
$config['system']['webgui']['ssl-ciphers'] = $newciphers;
$config['system']['webgui']['interfaces'] = $newinterfaces;
$config['system']['webgui']['compression'] = $pconfig['compression'];
$config['syslog']['nologlighttpd'] = empty($pconfig['loglighttpd']);
$syslog_conf['nologlighttpd'] = empty($pconfig['loglighttpd']);

if (!empty($pconfig['deployment'])) {
$config['system']['deployment'] = $pconfig['deployment'];
Expand Down

0 comments on commit 022ab7a

Please sign in to comment.