Project

General

Profile

« Previous | Next » 

Revision 44c42356

Added by Phil Davis over 8 years ago

Report problems applying changes

1) Strictly keep track of the accumulating $retval from calls to various
functions that apply changes.
2) Use new function print_apply_result_box() to print a suitable message
in a suitable severity based on $retval

View differences:

src/usr/local/www/vpn_ipsec.php
50 50

  
51 51
if ($_POST) {
52 52
	if ($_POST['apply']) {
53
		$retval = vpn_ipsec_configure();
53
		$ipsec_dynamic_hosts = vpn_ipsec_configure();
54 54
		/* reload the filter in the background */
55
		filter_configure();
56
		$savemsg = get_std_save_message($retval);
57
		if ($retval >= 0) {
55
		$retval = 0;
56
		$retval |= filter_configure();
57
		if ($ipsec_dynamic_hosts >= 0) {
58 58
			if (is_subsystem_dirty('ipsec')) {
59 59
				clear_subsystem_dirty('ipsec');
60 60
			}
......
228 228
$tab_array[] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
229 229
display_top_tabs($tab_array);
230 230

  
231
	if ($savemsg) {
232
		print_info_box($savemsg, 'success');
233
	}
231
if ($_POST['apply']) {
232
	print_apply_result_box($retval);
233
}
234 234

  
235
	if (is_subsystem_dirty('ipsec')) {
236
		print_apply_box(gettext("The IPsec tunnel configuration has been changed.") . "<br />" . gettext("The changes must be applied for them to take effect."));
237
	}
235
if (is_subsystem_dirty('ipsec')) {
236
	print_apply_box(gettext("The IPsec tunnel configuration has been changed.") . "<br />" . gettext("The changes must be applied for them to take effect."));
237
}
238 238
?>
239 239

  
240 240
<form name="mainform" method="post">

Also available in: Unified diff