This commit is contained in:
Julien Vaubourg
2015-09-28 17:25:43 +02:00
parent e001f16c2d
commit d1d4ac7358
7 changed files with 182 additions and 129 deletions

View File

@@ -78,6 +78,7 @@ dispatch('/', function() {
set('ip6_net', $ip6_net);
set('crt_client_exists', file_exists('/etc/openvpn/keys/user.crt'));
set('crt_client_key_exists', file_exists('/etc/openvpn/keys/user.key'));
set('crt_client_ta_exists', file_exists('/etc/openvpn/keys/user_ta.key'));
set('crt_server_ca_exists', file_exists('/etc/openvpn/keys/ca-server.crt'));
set('faststatus', service_faststatus() == 0);
set('raw_openvpn', $raw_openvpn);
@@ -180,6 +181,12 @@ dispatch_put('/settings', function() {
} elseif($_POST['crt_client_key_delete'] == 1) {
unlink('/etc/openvpn/keys/user.key');
}
if($_FILES['crt_client_ta']['error'] == UPLOAD_ERR_OK) {
move_uploaded_file($_FILES['crt_client_ta']['tmp_name'], '/etc/openvpn/keys/user_ta.key');
} elseif($_POST['crt_client_ta_delete'] == 1) {
unlink('/etc/openvpn/keys/user_ta.key');
}
if($_FILES['crt_server_ca']['error'] == UPLOAD_ERR_OK) {
move_uploaded_file($_FILES['crt_server_ca']['tmp_name'], '/etc/openvpn/keys/ca-server.crt');