diff --git a/app/js/custom.js b/app/js/custom.js index d5047558..cd142a89 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -281,6 +281,22 @@ $('#ovpn-confirm-activate').on('shown.bs.modal', function (e) { $('.btn-activate', this).data('recordId', data.recordId); }); +$('#ovpn-userpw,#ovpn-certs').on('click', function (e) { +// e.stopPropagation(); + if (this.id == 'ovpn-userpw') { + $('#PanelCerts').hide(); + $('#PanelUserPW').show(); + } else if (this.id == 'ovpn-certs') { + $('#PanelUserPW').hide(); + $('#PanelCerts').show(); + } +}); + +// Add the following code if you want the name of the file appear on select +$(".custom-file-input").on("change", function() { + var fileName = $(this).val().split("\\").pop(); + $(this).siblings(".custom-file-label").addClass("selected").html(fileName); +}); /* Sets the wirelss channel select options based on hw_mode and country_code. diff --git a/includes/openvpn.php b/includes/openvpn.php index 810746a2..c5b00d1c 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -53,7 +53,7 @@ function DisplayOpenVPNConfig() $authUser = current($auth); $authPassword = next($auth); } - $clients = preg_grep('~\login.(conf)$~', scandir(pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME))); + $clients = preg_grep('/client.(conf)$/', scandir(pathinfo(RASPI_OPENVPN_CLIENT_CONFIG, PATHINFO_DIRNAME))); $logEnable = 0; if (!empty($_POST) && !isset($_POST['log-openvpn'])) { diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php index 6f8056fd..dc624c63 100644 --- a/templates/openvpn/configs.php +++ b/templates/openvpn/configs.php @@ -8,11 +8,11 @@