Revision de85521a
Added by Jim Pingle almost 12 years ago
etc/inc/openvpn.inc | ||
---|---|---|
838 | 838 |
mwexec("/bin/rm {$g['varetc_path']}/openvpn/{$mode_id}.*"); |
839 | 839 |
} |
840 | 840 |
|
841 |
function openvpn_cleanup_csc($common_name) { |
|
842 |
global $g, $config; |
|
843 |
if (empty($common_name)) |
|
844 |
return; |
|
845 |
$fpath = "{$g['varetc_path']}/openvpn-csc/" . basename($common_name); |
|
846 |
if (is_file($fpath)) |
|
847 |
unlink_if_exists($fpath); |
|
848 |
return; |
|
849 |
} |
|
850 |
|
|
841 | 851 |
function openvpn_resync_csc(& $settings) { |
842 | 852 |
global $g, $config; |
843 | 853 |
|
usr/local/www/vpn_openvpn_csc.php | ||
---|---|---|
210 | 210 |
$csc['nbdd_server1'] = $pconfig['nbdd_server1']; |
211 | 211 |
} |
212 | 212 |
|
213 |
if (isset($id) && $a_csc[$id]) |
|
213 |
if (isset($id) && $a_csc[$id]) { |
|
214 |
$old_csc_cn = $a_csc[$id]['common_name']; |
|
214 | 215 |
$a_csc[$id] = $csc; |
215 |
else |
|
216 |
} else
|
|
216 | 217 |
$a_csc[] = $csc; |
217 | 218 |
|
219 |
if (!empty($old_csc_cn)) |
|
220 |
openvpn_cleanup_csc($old_csc_cn); |
|
218 | 221 |
openvpn_resync_csc($csc); |
219 | 222 |
write_config(); |
220 | 223 |
|
Also available in: Unified diff
Remove prior CSC entry when cleaning up. Fixes #3143