Make a function to resync all OpenVPN CSCs and use it when saving an OpenVPN server. Fixes #6139

This commit is contained in:
jim-p 2016-07-15 15:09:13 -04:00
parent f0314a2a82
commit 1f95431826
2 changed files with 11 additions and 5 deletions

View File

@ -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";
@ -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();
}

View File

@ -578,6 +578,7 @@ if ($_POST) {
write_config();
openvpn_resync('server', $server);
openvpn_resync_csc_all();
header("Location: vpn_openvpn_server.php");
exit;