Fix OpenVPN server validation logic. It was failing if you tried to save a shared key server instance with an existing shared key.

This commit is contained in:
jim-p 2010-05-08 12:12:04 -04:00
parent 520b1e07b0
commit 21c776dd85

View File

@ -244,12 +244,14 @@ if ($_POST) {
if ($pconfig['maxclients'] && !is_numeric($pconfig['maxclients']))
$input_errors[] = "The field 'Concurrent connections' must be numeric.";
if (!$tls_mode && !$pconfig['autokey_enable']) {
$reqdfields = array('shared_key');
$reqdfieldsn = array('Shared key');
} else {
/* If we are not in shared key mode, then we need the CA/Cert. */
if ($pconfig['mode'] != "p2p_shared_key") {
$reqdfields = explode(" ", "caref certref");
$reqdfieldsn = explode(",", "Certificate Authority,Certificate");;
} elseif (!$pconfig['autokey_enable']) {
/* We only need the shared key filled in if we are in shared key mode and autokey is not selected. */
$reqdfields = array('shared_key');
$reqdfieldsn = array('Shared key');
}
$reqdfields[] = 'tunnel_network';