system: move web GUI error log setting to appropriate page #6830

The storage location is wrong but deal with this later.
This commit is contained in:
Franco Fichtner 2024-02-28 12:57:27 +01:00
parent 5247ab3f3a
commit d5b84cf46e
3 changed files with 19 additions and 22 deletions

View File

@ -216,7 +216,7 @@ EOD;
$lighty_port = $port;
$lighty_use_syslog = '';
if (!isset($config['syslog']['nologlighttpd'])) {
if (empty($config['syslog']['nologlighttpd'])) {
$lighty_use_syslog = <<<EOD
## where to send error/access-messages to
server.syslog-facility = "daemon"

View File

@ -50,7 +50,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['logbogons'] = empty($config['syslog']['nologbogons']);
$pconfig['logprivatenets'] = empty($config['syslog']['nologprivatenets']);
$pconfig['logoutboundnat'] = !empty($config['syslog']['logoutboundnat']);
$pconfig['loglighttpd'] = empty($config['syslog']['nologlighttpd']);
$pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']);
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_POST['action']) && $_POST['action'] == "resetlogs") {
@ -92,14 +91,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$oldnologdefaultpass = isset($config['syslog']['nologdefaultpass']);
$oldnologbogons = isset($config['syslog']['nologbogons']);
$oldnologprivatenets = isset($config['syslog']['nologprivatenets']);
$oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
$oldlogoutboundnat = isset($config['syslog']['logoutboundnat']);
$config['syslog']['nologdefaultblock'] = empty($pconfig['logdefaultblock']);
$config['syslog']['nologdefaultpass'] = empty($pconfig['logdefaultpass']);
$config['syslog']['nologbogons'] = empty($pconfig['logbogons']);
$config['syslog']['nologprivatenets'] = empty($pconfig['logprivatenets']);
$config['syslog']['logoutboundnat'] = !empty($pconfig['logoutboundnat']);
$config['syslog']['nologlighttpd'] = empty($pconfig['loglighttpd']);
write_config();
@ -114,11 +111,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$savemsg = get_std_save_message();
if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
configd_run('webgui restart 2', true);
$savemsg .= "<br />" . gettext("WebGUI process is restarting.");
}
}
}
}
@ -240,16 +232,6 @@ $(document).ready(function() {
<?=gettext("Log packets blocked by 'Block Private Networks' rules");?>
</td>
</tr>
<tr>
<td><a id="help_for_loglighttpd" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Web Server Log') ?></td>
<td>
<input name="loglighttpd" type="checkbox" id="loglighttpd" value="yes" <?=!empty($pconfig['loglighttpd']) ? "checked=\"checked\"" :""; ?> />
<?=gettext("Log errors from the web server process.");?>
<div class="hidden" data-for="help_for_loglighttpd">
<?=gettext('Hint: If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the main system log.');?>
</div>
</td>
</tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext('Local Logging') ?></td>
<td> <input name="disablelocallogging" type="checkbox" id="disablelocallogging" value="yes" <?=!empty($pconfig['disablelocallogging']) ? "checked=\"checked\"" :""; ?> />

View File

@ -78,6 +78,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['quietlogin'] = isset($config['system']['webgui']['quietlogin']);
$pconfig['deployment'] = $config['system']['deployment'] ?? '';
/* XXX not really a syslog setting */
$pconfig['loglighttpd'] = empty($config['syslog']['nologlighttpd']);
/* XXX listtag "fun" */
$pconfig['sshlogingroup'] = !empty($config['system']['ssh']['group'][0]) ? $config['system']['ssh']['group'][0] : null;
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
@ -157,10 +160,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['system']['webgui']['compression'] != $pconfig['compression'] ||
$config['system']['webgui']['ssl-ciphers'] != $newciphers ||
$config['system']['webgui']['interfaces'] != $newinterfaces ||
(empty($pconfig['httpaccesslog'])) != empty($config['system']['webgui']['httpaccesslog']) ||
(empty($pconfig['ssl-hsts'])) != empty($config['system']['webgui']['ssl-hsts']) ||
empty($pconfig['httpaccesslog']) != empty($config['system']['webgui']['httpaccesslog']) ||
empty($pconfig['ssl-hsts']) != empty($config['system']['webgui']['ssl-hsts']) ||
!empty($pconfig['disablehttpredirect']) != !empty($config['system']['webgui']['disablehttpredirect']) ||
($config['system']['deployment'] ?? '') != $pconfig['deployment'];
($config['system']['deployment'] ?? '') != $pconfig['deployment'] ||
!empty($config['syslog']['nologlighttpd']) != empty($pconfig['loglighttpd']);
$config['system']['webgui']['protocol'] = $pconfig['webguiproto'];
$config['system']['webgui']['port'] = $pconfig['webguiport'];
@ -168,6 +172,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['system']['webgui']['ssl-ciphers'] = $newciphers;
$config['system']['webgui']['interfaces'] = $newinterfaces;
$config['system']['webgui']['compression'] = $pconfig['compression'];
$config['syslog']['nologlighttpd'] = empty($pconfig['loglighttpd']);
if (!empty($pconfig['deployment'])) {
$config['system']['deployment'] = $pconfig['deployment'];
@ -690,6 +695,16 @@ $(document).ready(function() {
</div>
</td>
</tr>
<tr>
<td><a id="help_for_loglighttpd" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Server Log') ?></td>
<td>
<input name="loglighttpd" type="checkbox" id="loglighttpd" value="yes" <?=!empty($pconfig['loglighttpd']) ? "checked=\"checked\"" :""; ?> />
<?=gettext("Log server errors") ?>
<div class="hidden" data-for="help_for_loglighttpd">
<?=gettext('If this is checked, errors from the web GUI will appear in the main system log.') ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_webguiinterfaces" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Listen Interfaces') ?></td>
<td>