From f73aa36ce3b2c65d02bbadbba3af95a09893cda5 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 23 Nov 2020 18:37:35 +0100 Subject: [PATCH] User management: add user OTP seed option in System->Settings->Administration. for https://github.com/opnsense/core/issues/4474 --- src/www/system_advanced_admin.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/www/system_advanced_admin.php b/src/www/system_advanced_admin.php index c59b52132..945f2d64f 100644 --- a/src/www/system_advanced_admin.php +++ b/src/www/system_advanced_admin.php @@ -56,6 +56,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['disableintegratedauth'] = !empty($config['system']['disableintegratedauth']); $pconfig['sudo_allow_wheel'] = $config['system']['sudo_allow_wheel']; $pconfig['sudo_allow_group'] = isset($config['system']['sudo_allow_group']) ? $config['system']['sudo_allow_group'] : null; + $pconfig['user_allow_gen_token'] = isset($config['system']['user_allow_gen_token']) ? explode(",", $config['system']['user_allow_gen_token']) : null; $pconfig['nodnsrebindcheck'] = isset($config['system']['webgui']['nodnsrebindcheck']); $pconfig['nohttpreferercheck'] = isset($config['system']['webgui']['nohttpreferercheck']); $pconfig['althostnames'] = $config['system']['webgui']['althostnames']; @@ -264,6 +265,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { unset($config['system']['sudo_allow_group']); } + if (!empty($pconfig['user_allow_gen_token'])) { + $config['system']['user_allow_gen_token'] = implode(",", $pconfig['user_allow_gen_token']); + } elseif (isset($config['system']['user_allow_gen_token'])) { + unset($config['system']['user_allow_gen_token']); + } + + if (!empty($pconfig['sshpasswordauth'])) { $config['system']['ssh']['passwordauth'] = true; } elseif (isset($config['system']['ssh']['passwordauth'])) { @@ -928,6 +936,24 @@ $(document).ready(function() { + + + + + + + + + +