diff --git a/src/opnsense/service/templates/OPNsense/Auth/+TARGETS b/src/opnsense/service/templates/OPNsense/Auth/+TARGETS index b79ade401..9bb7d2b3e 100644 --- a/src/opnsense/service/templates/OPNsense/Auth/+TARGETS +++ b/src/opnsense/service/templates/OPNsense/Auth/+TARGETS @@ -3,3 +3,4 @@ motd:/etc/motd sshd.pam:/etc/pam.d/sshd sudoers:/usr/local/etc/sudoers.d/opnsense system.pam:/etc/pam.d/system +csh.cshrc:/etc/csh.cshrc diff --git a/src/opnsense/service/templates/OPNsense/Auth/csh.cshrc b/src/opnsense/service/templates/OPNsense/Auth/csh.cshrc new file mode 100644 index 000000000..1c00306b0 --- /dev/null +++ b/src/opnsense/service/templates/OPNsense/Auth/csh.cshrc @@ -0,0 +1,6 @@ +# $FreeBSD$ +# +# System-wide .cshrc file for csh(1). +{% if not helpers.empty('system.autologout')%} +set -r autologout={{system.autologout}} +{% endif %} diff --git a/src/www/system_advanced_admin.php b/src/www/system_advanced_admin.php index 9cb716518..2a77bc96a 100644 --- a/src/www/system_advanced_admin.php +++ b/src/www/system_advanced_admin.php @@ -64,6 +64,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['serialusb'] = isset($config['system']['serialusb']); $pconfig['primaryconsole'] = $config['system']['primaryconsole']; $pconfig['secondaryconsole'] = $config['system']['secondaryconsole']; + $pconfig['autologout'] = $config['system']['autologout']; $pconfig['enablesshd'] = $config['system']['ssh']['enabled']; $pconfig['sshport'] = $config['system']['ssh']['port']; $pconfig['sshinterfaces'] = !empty($config['system']['ssh']['interfaces']) ? explode(',', $config['system']['ssh']['interfaces']) : array(); @@ -106,6 +107,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext('Session timeout must be an integer value.'); } + if (!empty($pconfig['autologout']) && (!is_numeric($pconfig['autologout']) || $pconfig['autologout'] <= 0)) { + $input_errors[] = gettext('Inactivity timeout must be an integer value.'); + } + if (!empty($pconfig['authmode'])) { foreach ($pconfig['authmode'] as $auth_mode) { if (!isset($a_authmode[$auth_mode])) { @@ -236,6 +241,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { unset($config['system']['webgui']['authmode']); } + if (!empty($pconfig['autologout'])) { + $config['system']['autologout'] = $pconfig['autologout']; + } elseif (isset($config['system']['autologout'])) { + unset($config['system']['autologout']); + } + /* always store setting to prevent installer auto-start */ $config['system']['ssh']['noauto'] = 1; @@ -873,6 +884,25 @@ $(document).ready(function() { +
+ + + + + + + + + +
+ + + +
+