summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/vpn_openvpn_server.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-12-10 11:37:06 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-12-10 11:37:06 -0500
commita4ba0282e6cba7916e3955f2d44da9a902f80587 (patch)
tree0d72ed31459d4cc807ac2e8ec6795b2a74f45657 /src/usr/local/www/vpn_openvpn_server.php
parent4e322e2c189e18133324c933ad35f0735fab510f (diff)
downloadpfsense-a4ba0282e6cba7916e3955f2d44da9a902f80587.zip
pfsense-a4ba0282e6cba7916e3955f2d44da9a902f80587.tar.gz
Fixed #5602 by dynamically updating hte help text based on the cert selected.
Diffstat (limited to 'src/usr/local/www/vpn_openvpn_server.php')
-rw-r--r--src/usr/local/www/vpn_openvpn_server.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php
index 746eac6..4a475b4 100644
--- a/src/usr/local/www/vpn_openvpn_server.php
+++ b/src/usr/local/www/vpn_openvpn_server.php
@@ -747,24 +747,29 @@ if($act=="new" || $act=="edit") :
));
}
- $certhelp = "";
+ $certhelp = '<span id="certtype"></span>';
if (count($a_cert)) {
if (!empty(trim($pconfig['certref']))) {
$thiscert = lookup_cert($pconfig['certref']);
$purpose = cert_get_purpose($thiscert['crt'], true);
if ($purpose['server'] != "Yes") {
- $certhelp = gettext("Warning: The previously saved server was not created as an SSL Server certificate and may not work properly.");
+ $certhelp = '<span id="certtype" class="text-danger">' . gettext("Warning: The selected server certificate was not created as an SSL Server certificate and may not work as expected") . ' </span>';
}
}
} else {
- $certhelp = sprintf('No Certificates defined. You may create one here: %s', '<a href="system_camanager.php">System &gt; Cert Manager</a>');
+ $certhelp = sprintf('%s%s%s$s', '<span id="certtype">', gettext('No Certificates defined. You may create one here: '), '<a href="system_camanager.php">System &gt; Cert Manager</a>', '</span>');
}
+ $cl = openvpn_build_cert_list(false, true);
+
+ //Save the number of server certs for use at run-time
+ $servercerts = count($cl['server']);
+
$section->addInput(new Form_Select(
'certref',
'Server certificate',
$pconfig['certref'],
- openvpn_build_cert_list(false, true)
+ $cl['server'] + $cl['non-server']
))->setHelp($certhelp);
$section->addInput(new Form_Select(
@@ -1569,6 +1574,17 @@ events.push(function(){
tuntap_change();
});
+ // Certref
+ $('#certref').on('change', function() {
+ var errmsg = "";
+
+ if ($(this).find(":selected").index() >= "<?=$servercerts?>") {
+ var errmsg = '<span class="text-danger">' + "<?=gettext('Warning: The selected server certificate was not created as an SSL Server certificate and may not work as expected')?>" + '</span>';
+ }
+
+ $('#certtype').html(errmsg);
+ });
+
// ---------- Set initial page display state ----------------------------------------------------------------------
mode_change();
autokey_change();
OpenPOWER on IntegriCloud