diff --git a/ajax/openvpn/activate_ovpncfg.php b/ajax/openvpn/activate_ovpncfg.php
index b8f822c2..2a8542a9 100644
--- a/ajax/openvpn/activate_ovpncfg.php
+++ b/ajax/openvpn/activate_ovpncfg.php
@@ -5,11 +5,11 @@ require_once '../../includes/functions.php';
if (isset($_POST['cfg_id'])) {
$ovpncfg_id = $_POST['cfg_id'];
- $ovpncfg_path = pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME).'/';
+ $ovpncfg_path = pathinfo(RASPI_OPENVPN_CLIENT_CONFIG, PATHINFO_DIRNAME).'/';
$ovpncfg_files = $ovpncfg_path .$ovpncfg_id.'_*.conf';
// move currently active profile
- $meta = file_get_meta(RASPI_OPENVPN_CLIENT_LOGIN,'#\sfilename\s(.*)');
+ $meta = file_get_meta(RASPI_OPENVPN_CLIENT_CONFIG,'#\sfilename\s(.*)');
$ovpncfg_client = $ovpncfg_path .$meta.'_client.conf';
$ovpncfg_login = $ovpncfg_path .$meta.'_login.conf';
exec("sudo mv ".RASPI_OPENVPN_CLIENT_CONFIG." $ovpncfg_client", $return);
diff --git a/app/js/custom.js b/app/js/custom.js
index 838d0cbb..d912db26 100644
--- a/app/js/custom.js
+++ b/app/js/custom.js
@@ -282,6 +282,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/locale/en_US/LC_MESSAGES/messages.mo b/locale/en_US/LC_MESSAGES/messages.mo
index d9fec98a..1a789dd4 100644
Binary files a/locale/en_US/LC_MESSAGES/messages.mo and b/locale/en_US/LC_MESSAGES/messages.mo differ
diff --git a/locale/en_US/LC_MESSAGES/messages.po b/locale/en_US/LC_MESSAGES/messages.po
index ac7086b4..839bed68 100644
--- a/locale/en_US/LC_MESSAGES/messages.po
+++ b/locale/en_US/LC_MESSAGES/messages.po
@@ -728,6 +728,36 @@ msgstr "Cancel"
msgid "Enable this option to log openvpn
activity."
msgstr "Enable this option to log openvpn
activity."
+msgid "Authentification Method"
+msgstr "Authentification Method"
+
+msgid "Username and password"
+msgstr "Username and password"
+
+msgid "Certificates"
+msgstr "Certificates"
+
+msgid "Enter username and password"
+msgstr "Enter username and password"
+
+msgid "Certificates in the configuration file"
+msgstr "Certificates in the configuration file"
+
+msgid "RaspAP supports certificates by including them in the configuration file."
+msgstr "RaspAP supports certificates by including them in the configuration file."
+
+msgid "Signing certification authority (CA) certificate (e.g. ca.crt
): enclosed in <ca> ... </ca>
tags."
+msgstr "Signing certification authority (CA) certificate (e.g. ca.crt
): enclosed in <ca> ... </ca>
tags."
+
+msgid "Client certificate (public key) (e.g. client.crt
): enclosed in <cert> ... </cert>
tags."
+msgstr "Client certificate (public key) (e.g. client.crt
): enclosed in <cert> ... </cert>
tags."
+
+msgid "Private key of the client certificate (e.g. client.key
): enclosed in <key> ... </key>
tags."
+msgstr "Private key of the client certificate (e.g. client.key
): enclosed in <key> ... </key>
tags."
+
+msgid "Configuration File"
+msgstr "Configuration File"
+
#: includes/torproxy.php
msgid "TOR is not running"
msgstr "TOR is not running"
diff --git a/templates/openvpn.php b/templates/openvpn.php
index 4f76d6ec..4e0adaba 100755
--- a/templates/openvpn.php
+++ b/templates/openvpn.php
@@ -45,8 +45,7 @@
-
-
+