Skip to content

Commit

Permalink
Make a function to resync all OpenVPN CSCs and use it when saving an …
Browse files Browse the repository at this point in the history
…OpenVPN server. Fixes #6139
  • Loading branch information
jim-p committed Jul 15, 2016
1 parent f0314a2 commit 1f95431
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/etc/inc/openvpn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,15 @@ function openvpn_resync_csc(& $settings) {
}
}

function openvpn_resync_csc_all() {
global $config;
if (is_array($config['openvpn']['openvpn-csc'])) {
foreach ($config['openvpn']['openvpn-csc'] as & $settings) {
openvpn_resync_csc($settings);
}
}
}

function openvpn_delete_csc(& $settings) {
global $g, $config, $openvpn_tls_server_modes;
$csc_base_path = "{$g['varetc_path']}/openvpn-csc";
Expand Down Expand Up @@ -1359,11 +1368,7 @@ function openvpn_resync_all($interface = "") {
}
}

if (is_array($config['openvpn']['openvpn-csc'])) {
foreach ($config['openvpn']['openvpn-csc'] as & $settings) {
openvpn_resync_csc($settings);
}
}
openvpn_resync_csc_all();

}

Expand Down
1 change: 1 addition & 0 deletions src/usr/local/www/vpn_openvpn_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@

write_config();
openvpn_resync('server', $server);
openvpn_resync_csc_all();

header("Location: vpn_openvpn_server.php");
exit;
Expand Down

0 comments on commit 1f95431

Please sign in to comment.