diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml b/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml index a14e08780..09d9709ec 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml @@ -25,11 +25,10 @@ - - + - + diff --git a/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml b/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml index 5b5d7f9e0..6c9ef732e 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml @@ -632,6 +632,7 @@ System: Authentication Servers system_authservers.php* + system_usermanager_settings_ldapacpicker.php* @@ -733,12 +734,6 @@ system_usermanager_addprivs.php?user* - - System: User Manager: settings - - system_usermanager_settings.php* - - System: User Manager: Settings: Test LDAP diff --git a/src/www/system_advanced_admin.php b/src/www/system_advanced_admin.php index 94e5ee1af..82101bf13 100644 --- a/src/www/system_advanced_admin.php +++ b/src/www/system_advanced_admin.php @@ -5,6 +5,7 @@ * Copyright (C) 2014-2015 Deciso B.V. * Copyright (C) 2005-2010 Scott Ullrich * Copyright (C) 2008 Shrew Soft Inc. + * Copyright (C) 2007 Bill Marquette * Copyright (C) 2003-2004 Manuel Kasper * All rights reserved. * @@ -36,10 +37,20 @@ require_once("system.inc"); require_once("services.inc"); $a_group = &config_read_array('system', 'group'); +$a_authmode = auth_get_authserver_list(); if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig = array(); + foreach (array('session_timeout', 'password_policy_duration', 'enable_password_policy_constraints', + 'password_policy_complexity', 'password_policy_length') as $fieldname) { + if (!empty($config['system']['webgui'][$fieldname])) { + $pconfig[$fieldname] = $config['system']['webgui'][$fieldname]; + } else { + $pconfig[$fieldname] = null; + } + } $pconfig['webguiinterfaces'] = !empty($config['system']['webgui']['interfaces']) ? explode(',', $config['system']['webgui']['interfaces']) : array(); + $pconfig['authmode'] = !empty($config['system']['webgui']['authmode']) ? explode(',', $config['system']['webgui']['authmode']) : array(); $pconfig['webguiproto'] = $config['system']['webgui']['protocol']; $pconfig['webguiport'] = $config['system']['webgui']['port']; $pconfig['ssl-certref'] = $config['system']['webgui']['ssl-certref']; @@ -90,6 +101,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext('You must specify a valid SSH port number.'); } + if (!empty($pconfig['session_timeout']) && (!is_numeric($pconfig['session_timeout']) || $pconfig['session_timeout'] <= 0)) { + $input_errors[] = gettext('Session timeout must be an integer value.'); + } + + if (!empty($pconfig['authmode'])) { + foreach ($pconfig['authmode'] as $auth_mode) { + if (!isset($a_authmode[$auth_mode])) { + $input_errors[] = sprintf(gettext('Authentication server "%s" is invalid.'), $auth_mode); + } + } + } + if (count($input_errors) == 0) { $newinterfaces = !empty($pconfig['webguiinterfaces']) ? implode(',', $pconfig['webguiinterfaces']) : ''; $newciphers = !empty($pconfig['ssl-ciphers']) ? implode(':', $pconfig['ssl-ciphers']) : ''; @@ -187,6 +210,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { unset($config['system']['webgui']['althostnames']); } + foreach (array('session_timeout', 'password_policy_duration', 'enable_password_policy_constraints', + 'password_policy_complexity', 'password_policy_length') as $fieldname) { + if (!empty($pconfig[$fieldname])) { + $config['system']['webgui'][$fieldname] = $pconfig[$fieldname]; + } elseif (isset($config['system']['webgui'][$fieldname])) { + unset($config['system']['webgui'][$fieldname]); + } + } + + if (!empty($pconfig['authmode'])) { + $config['system']['webgui']['authmode'] = implode(',', $pconfig['authmode']); + } elseif (isset($config['system']['webgui']['authmode'])) { + unset($config['system']['webgui']['authmode']); + } + /* always store setting to prevent installer auto-start */ $config['system']['ssh']['noauto'] = 1; @@ -367,6 +405,25 @@ $(document).ready(function() { }); + + + +
@@ -652,7 +709,7 @@ $(document).ready(function() {
- + @@ -736,6 +793,93 @@ $(document).ready(function() {
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ /> + + +
+ + +
+ + +
+ /> + + +
+
diff --git a/src/www/system_usermanager_settings.php b/src/www/system_usermanager_settings.php index 86df309a2..e89a53979 100644 --- a/src/www/system_usermanager_settings.php +++ b/src/www/system_usermanager_settings.php @@ -31,52 +31,14 @@ require_once("guiconfig.inc"); $save_and_test = false; -if ($_SERVER['REQUEST_METHOD'] === 'GET') { - $pconfig = array(); - foreach (array('session_timeout', 'password_policy_duration', - 'enable_password_policy_constraints', - 'password_policy_complexity', 'password_policy_length') as $fieldname) { - if (!empty($config['system']['webgui'][$fieldname])) { - $pconfig[$fieldname] = $config['system']['webgui'][$fieldname]; - } else { - $pconfig[$fieldname] = null; - } - } - $pconfig['authmode'] = !empty($config['system']['webgui']['authmode']) ? explode(',', $config['system']['webgui']['authmode']) : array(); -} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - $pconfig = $_POST; - $input_errors = array(); - if (!empty($pconfig['session_timeout']) && (!is_numeric($pconfig['session_timeout']) || $pconfig['session_timeout'] <= 0)) { - $input_errors[] = gettext("Session timeout must be an integer value."); - } - if (count($input_errors) == 0) { - $authsrv = auth_get_authserver($pconfig['authmode']); - if (!empty($pconfig['savetest'])) { - # XXX this needs repairing... - if ($authsrv['type'] == "ldap") { - $save_and_test = true; - } else { - $savemsg = gettext("The test was not performed because it is supported only for ldap based backends."); - } - } - - foreach (array('session_timeout', 'password_policy_duration', 'enable_password_policy_constraints', - 'password_policy_complexity', 'password_policy_length') as $fieldname) { - if (!empty($pconfig[$fieldname])) { - $config['system']['webgui'][$fieldname] = $pconfig[$fieldname]; - } elseif (isset($config['system']['webgui'][$fieldname])) { - unset($config['system']['webgui'][$fieldname]); - } - } - - if (!empty($pconfig['authmode'])) { - $config['system']['webgui']['authmode'] = implode(',', $pconfig['authmode']); - } elseif (isset($config['system']['webgui']['authmode'])) { - unset($config['system']['webgui']['authmode']); - } - - write_config(); +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + # XXX this needs repairing, can also be a list + $authsrv = auth_get_authserver($config['system']['webgui']['authmode']); + if ($authsrv['type'] == 'ldap') { + $save_and_test = true; + } else { + $savemsg = gettext('The test was not performed because it is supported only for LDAP-based backends.'); } } @@ -86,24 +48,6 @@ include("head.inc"); ?> - -