Project

General

Profile

« Previous | Next » 

Revision 7f799b0b

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.
(cherry picked from commit 61d1ca3e0ffb0fb6a397edb8ca5d88f039787140)

View differences:

src/usr/local/www/system_crlmanager.php
114 114
	pfSenseHeader("system_crlmanager.php");
115 115
	$act="";
116 116
	$savemsg = gettext("Invalid CRL reference.");
117
	$class = "danger";
117 118
}
118 119

  
119 120
if ($act == "del") {
120 121
	$name = htmlspecialchars($thiscrl['descr']);
121 122
	if (crl_in_use($id)) {
122 123
		$savemsg = sprintf(gettext("Certificate Revocation List %s is in use and cannot be deleted."), $name);
124
		$class = "danger";
123 125
	} else {
124 126
		foreach ($a_crl as $cid => $acrl) {
125 127
			if ($acrl['refid'] == $thiscrl['refid']) {
......
128 130
		}
129 131
		write_config("Deleted CRL {$name}.");
130 132
		$savemsg = sprintf(gettext("Certificate Revocation List %s successfully deleted."), $name);
133
		$class = "success";
131 134
	}
132 135
}
133 136

  
......
209 212
	$crlname = htmlspecialchars($thiscrl['descr']);
210 213
	if (cert_unrevoke($thiscert, $thiscrl)) {
211 214
		$savemsg = sprintf(gettext("Deleted Certificate %s from CRL %s."), $certname, $crlname);
215
		$class = "success";
212 216
		// refresh IPsec and OpenVPN CRLs
213 217
		openvpn_refresh_crls();
214 218
		vpn_ipsec_configure();
215 219
		write_config($savemsg);
216 220
	} else {
217 221
		$savemsg = sprintf(gettext("Failed to delete Certificate %s from CRL %s."), $certname, $crlname);
222
		$class = "danger";
218 223
	}
219 224
	$act="edit";
220 225
}
......
359 364
}
360 365

  
361 366
if ($savemsg) {
362
	print_info_box($savemsg, 'success');
367
	print_info_box($savemsg, $class);
363 368
}
364 369

  
365 370
$tab_array = array();

Also available in: Unified diff