diff options
author | jim-p <jimp@pfsense.org> | 2015-09-14 14:04:33 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-09-14 14:04:33 -0400 |
commit | d6b4dfe36b2be8b71df733823bb7ffe552300676 (patch) | |
tree | 45a2d061c752af82f9b03b57fbae610a74c60bd8 /src/usr | |
parent | bc1da94a54d88ff8fe80a888d07b0f1fda53d37e (diff) | |
download | pfsense-d6b4dfe36b2be8b71df733823bb7ffe552300676.zip pfsense-d6b4dfe36b2be8b71df733823bb7ffe552300676.tar.gz |
Provide an LDAP server timeout field. Default to 25 seconds. Resolves #3383
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/system_authservers.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index 6f35451..1bf47ea 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -130,6 +130,7 @@ if ($act == "edit") { $pconfig['ldap_caref'] = $a_server[$id]['ldap_caref']; $pconfig['ldap_host'] = $a_server[$id]['host']; $pconfig['ldap_port'] = $a_server[$id]['ldap_port']; + $pconfig['ldap_timeout'] = $a_server[$id]['ldap_timeout']; $pconfig['ldap_urltype'] = $a_server[$id]['ldap_urltype']; $pconfig['ldap_protver'] = $a_server[$id]['ldap_protver']; $pconfig['ldap_scope'] = $a_server[$id]['ldap_scope']; @@ -255,8 +256,11 @@ if ($_POST) { $input_errors[] = gettext("An authentication server with the same name already exists."); } - if (($pconfig['type'] == "radius") && isset($_POST['radius_timeout']) && !empty($_POST['radius_timeout']) && (!is_numeric($_POST['radius_timeout']) || (is_numeric($_POST['radius_timeout']) && ($_POST['radius_timeout'] <= 0)))) { - $input_errors[] = gettext("RADIUS Timeout value must be numeric and positive."); + if (($pconfig['type'] == "ldap") || ($pconfig['type'] == "radius")) { + $to_field = "{$pconfig['type']}_timeout"; + if (isset($_POST[$to_field]) && !empty($_POST[$to_field]) && (!is_numeric($_POST[$to_field]) || (is_numeric($_POST[$to_field]) && ($_POST[$to_field] <= 0)))) { + $input_errors[] = sprintf(gettext("%s Timeout value must be numeric and positive."), strtoupper($pconfig['type'])); + } } /* if this is an AJAX caller then handle via JSON */ @@ -311,6 +315,12 @@ if ($_POST) { unset($server['ldap_binddn']); unset($server['ldap_bindpw']); } + + if ($pconfig['ldap_timeout']) { + $server['ldap_timeout'] = $pconfig['ldap_timeout']; + } else { + $server['ldap_timeout'] = 25; + } } if ($server['type'] == "radius") { @@ -503,6 +513,14 @@ $section->addInput(new Form_Select( array_combine($ldap_protvers, $ldap_protvers) )); +$section->addInput(new Form_Input( + 'ldap_timeout', + 'Server Timeout', + 'number', + $pconfig['ldap_timeout'], + ['placeholder' => 25] +))->setHelp('Timeout for LDAP operations (seconds)'); + $group = new Form_Group('Search scope'); $SSF = new Form_Select( |