Project

General

Profile

« Previous | Next » 

Revision 61d1ca3e

Added by Phil Davis over 8 years ago

Make appropriate success or danger boxes in system_crlmanager

When there is a problem, the messages should be in a "danger" box.
Note: It is a bit difficult to actual get the danger messages to appear in the UI, because the relevant "delete" buttons are not shown in the UI when delete is not valid. But it can be tested by starting to edit a CRL that is in use, then change the "edit=" to "del=" in the URL bar and send it.

View differences:

src/usr/local/www/system_crlmanager.php
82 82
	pfSenseHeader("system_crlmanager.php");
83 83
	$act="";
84 84
	$savemsg = gettext("Invalid CRL reference.");
85
	$class = "danger";
85 86
}
86 87

  
87 88
if ($act == "del") {
88 89
	$name = htmlspecialchars($thiscrl['descr']);
89 90
	if (crl_in_use($id)) {
90 91
		$savemsg = sprintf(gettext("Certificate Revocation List %s is in use and cannot be deleted."), $name);
92
		$class = "danger";
91 93
	} else {
92 94
		foreach ($a_crl as $cid => $acrl) {
93 95
			if ($acrl['refid'] == $thiscrl['refid']) {
......
96 98
		}
97 99
		write_config("Deleted CRL {$name}.");
98 100
		$savemsg = sprintf(gettext("Certificate Revocation List %s successfully deleted."), $name);
101
		$class = "success";
99 102
	}
100 103
}
101 104

  
......
177 180
	$crlname = htmlspecialchars($thiscrl['descr']);
178 181
	if (cert_unrevoke($thiscert, $thiscrl)) {
179 182
		$savemsg = sprintf(gettext("Deleted Certificate %s from CRL %s."), $certname, $crlname);
183
		$class = "success";
180 184
		// refresh IPsec and OpenVPN CRLs
181 185
		openvpn_refresh_crls();
182 186
		vpn_ipsec_configure();
183 187
		write_config($savemsg);
184 188
	} else {
185 189
		$savemsg = sprintf(gettext("Failed to delete Certificate %s from CRL %s."), $certname, $crlname);
190
		$class = "danger";
186 191
	}
187 192
	$act="edit";
188 193
}
......
327 332
}
328 333

  
329 334
if ($savemsg) {
330
	print_info_box($savemsg, 'success');
335
	print_info_box($savemsg, $class);
331 336
}
332 337

  
333 338
$tab_array = array();

Also available in: Unified diff