Project

General

Profile

Download (22.6 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	system_crlmanager.php
4
	
5
	Copyright (C) 2010 Jim Pingle
6
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
	All rights reserved.
8
	
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
	
12
	1. Redistributions of source code must retain the above copyright notice,
13
	this list of conditions and the following disclaimer.
14
	
15
	2. Redistributions in binary form must reproduce the above copyright
16
	notice, this list of conditions and the following disclaimer in the
17
	documentation and/or other materials provided with the distribution.
18
	
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30
/*
31
	pfSense_MODULE:	certificate_manager
32
*/
33

    
34
##|+PRIV
35
##|*IDENT=page-system-crlmanager
36
##|*NAME=System: CRL Manager
37
##|*DESCR=Allow access to the 'System: CRL Manager' page.
38
##|*MATCH=system_crlmanager.php*
39
##|-PRIV
40

    
41
require("guiconfig.inc");
42
require_once("certs.inc");
43
require_once('openvpn.inc');
44

    
45
global $openssl_crl_status;
46

    
47
$pgtitle = array(gettext("System"), gettext("Certificate Revocation List Manager"));
48

    
49
$crl_methods = array(
50
	"internal" => gettext("Create an internal Certificate Revocation List"),
51
	"existing" => gettext("Import an existing Certificate Revocation List"));
52

    
53
if (ctype_alnum($_GET['id']))
54
	$id = $_GET['id'];
55
if (isset($_POST['id']) && ctype_alnum($_POST['id']))
56
	$id = $_POST['id'];
57

    
58
if (!is_array($config['ca']))
59
	$config['ca'] = array();
60

    
61
$a_ca =& $config['ca'];
62

    
63
if (!is_array($config['cert']))
64
	$config['cert'] = array();
65

    
66
$a_cert =& $config['cert'];
67

    
68
if (!is_array($config['crl']))
69
	$config['crl'] = array();
70

    
71
$a_crl =& $config['crl'];
72

    
73
foreach ($a_crl as $cid => $acrl)
74
	if (!isset($acrl['refid']))
75
		unset ($a_crl[$cid]);
76

    
77
$act = $_GET['act'];
78
if ($_POST['act'])
79
	$act = $_POST['act'];
80

    
81
if (!empty($id))
82
	$thiscrl =& lookup_crl($id);
83

    
84
// If we were given an invalid crlref in the id, no sense in continuing as it would only cause errors.
85
if (!$thiscrl && (($act != "") && ($act != "new"))) {
86
	pfSenseHeader("system_crlmanager.php");
87
	$act="";
88
	$savemsg = gettext("Invalid CRL reference.");
89
}
90

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

    
104
if ($act == "new") {
105
	$pconfig['method'] = $_GET['method'];
106
	$pconfig['caref'] = $_GET['caref'];
107
	$pconfig['lifetime'] = "9999";
108
	$pconfig['serial'] = "0";
109
}
110

    
111
if ($act == "exp") {
112
	crl_update($thiscrl);
113
	$exp_name = urlencode("{$thiscrl['descr']}.crl");
114
	$exp_data = base64_decode($thiscrl['text']);
115
	$exp_size = strlen($exp_data);
116

    
117
	header("Content-Type: application/octet-stream");
118
	header("Content-Disposition: attachment; filename={$exp_name}");
119
	header("Content-Length: $exp_size");
120
	echo $exp_data;
121
	exit;
122
}
123

    
124
if ($act == "addcert") {
125
	if ($_POST) {
126
		unset($input_errors);
127
		$pconfig = $_POST;
128

    
129
		if (!$pconfig['crlref'] || !$pconfig['certref']) {
130
			pfSenseHeader("system_crlmanager.php");
131
			exit;
132
		}
133

    
134
		// certref, crlref
135
		$crl =& lookup_crl($pconfig['crlref']);
136
		$cert = lookup_cert($pconfig['certref']);
137

    
138
		if (!$crl['caref'] || !$cert['caref']) {
139
			$input_errors[] = gettext("Both the Certificate and CRL must be specified.");
140
		}
141

    
142
		if ($crl['caref'] != $cert['caref']) {
143
			$input_errors[] = gettext("CA mismatch between the Certificate and CRL. Unable to Revoke.");
144
		}
145
		if (!is_crl_internal($crl)) {
146
			$input_errors[] = gettext("Cannot revoke certificates for an imported/external CRL.");
147
		}
148

    
149
		if (!$input_errors) {
150
			$reason = (empty($pconfig['crlreason'])) ? OCSP_REVOKED_STATUS_UNSPECIFIED : $pconfig['crlreason'];
151
			cert_revoke($cert, $crl, $reason);
152
			openvpn_refresh_crls();
153
			write_config("Revoked cert {$cert['descr']} in CRL {$crl['descr']}.");
154
			pfSenseHeader("system_crlmanager.php");
155
			exit;
156
		}
157
	}
158
}
159

    
160
if ($act == "delcert") {
161
	if (!is_array($thiscrl['cert'])) {
162
		pfSenseHeader("system_crlmanager.php");
163
		exit;
164
	}
165
	$found = false;
166
	foreach ($thiscrl['cert'] as $acert) {
167
		if ($acert['refid'] == $_GET['certref']) {
168
			$found = true;
169
			$thiscert = $acert;
170
		}
171
	}
172
	if (!$found) {
173
		pfSenseHeader("system_crlmanager.php");
174
		exit;
175
	}
176
	$certname = htmlspecialchars($thiscert['descr']);
177
	$crlname = htmlspecialchars($thiscrl['descr']);
178
	if (cert_unrevoke($thiscert, $thiscrl)) {
179
		$savemsg = sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname) . "<br />";
180
		openvpn_refresh_crls();
181
		write_config(sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname));
182
	} else {
183
		$savemsg = sprintf(gettext("Failed to delete Certificate %s from CRL %s"), $certname, $crlname) . "<br />";
184
	}
185
	$act="edit";
186
}
187

    
188
if ($_POST) {
189
	$input_errors = array();
190
	$pconfig = $_POST;
191

    
192
	/* input validation */
193
	if (($pconfig['method'] == "existing") || ($act == "editimported")) {
194
		$reqdfields = explode(" ", "descr crltext");
195
		$reqdfieldsn = array(
196
				gettext("Descriptive name"),
197
				gettext("Certificate Revocation List data"));
198
	}
199
	if ($pconfig['method'] == "internal") {
200
		$reqdfields = explode(" ",
201
				"descr caref");
202
		$reqdfieldsn = array(
203
				gettext("Descriptive name"),
204
				gettext("Certificate Authority"));
205
	}
206

    
207
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
208

    
209
	if (preg_match("/[\?\>\<\&\/\\\"\']/", $pconfig['descr'])) {
210
		array_push($input_errors, "The field 'Descriptive Name' contains invalid characters.");
211
	}
212

    
213
	/* if this is an AJAX caller then handle via JSON */
214
	if (isAjax() && is_array($input_errors)) {
215
		input_errors2Ajax($input_errors);
216
		exit;
217
	}
218

    
219
	/* save modifications */
220
	if (!$input_errors) {
221
		$result = false;
222

    
223
		if ($thiscrl) {
224
			$crl =& $thiscrl;
225
		} else {
226
			$crl = array();
227
			$crl['refid'] = uniqid();
228
		}
229

    
230
		$crl['descr'] = $pconfig['descr'];
231
		if ($act != "editimported") {
232
			$crl['caref'] = $pconfig['caref'];
233
			$crl['method'] = $pconfig['method'];
234
		}
235

    
236
		if (($pconfig['method'] == "existing") || ($act == "editimported")) {
237
			$crl['text'] = base64_encode($pconfig['crltext']);
238
		}
239

    
240
		if ($pconfig['method'] == "internal") {
241
			$crl['serial'] = empty($pconfig['serial']) ? 9999 : $pconfig['serial'];
242
			$crl['lifetime'] = empty($pconfig['lifetime']) ? 9999 : $pconfig['lifetime'];
243
			$crl['cert'] = array();
244
		}
245

    
246
		if (!$thiscrl)
247
			$a_crl[] = $crl;
248

    
249
		write_config("Saved CRL {$crl['descr']}");
250
		openvpn_refresh_crls();
251
		pfSenseHeader("system_crlmanager.php");
252
	}
253
}
254

    
255
include("head.inc");
256
?>
257

    
258
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
259
<?php include("fbegin.inc"); ?>
260
<script type="text/javascript">
261
//<![CDATA[
262

    
263
function method_change() {
264

    
265
	method = document.iform.method.value;
266

    
267
	switch (method) {
268
		case "internal":
269
			document.getElementById("existing").style.display="none";
270
			document.getElementById("internal").style.display="";
271
			break;
272
		case "existing":
273
			document.getElementById("existing").style.display="";
274
			document.getElementById("internal").style.display="none";
275
			break;
276
	}
277
}
278

    
279
//]]>
280
</script>
281
<?php
282
	if ($input_errors)
283
		print_input_errors($input_errors);
284
	if ($savemsg)
285
		print_info_box($savemsg);
286
?>
287
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="CRL manager">
288
	<tr>
289
		<td>
290
		<?php
291
			$tab_array = array();
292
			$tab_array[] = array(gettext("CAs"), false, "system_camanager.php");
293
			$tab_array[] = array(gettext("Certificates"), false, "system_certmanager.php");
294
			$tab_array[] = array(gettext("Certificate Revocation"), true, "system_crlmanager.php");
295
			display_top_tabs($tab_array);
296
		?>
297
		</td>
298
	</tr>
299
	<tr>
300
		<td id="mainarea">
301
			<div class="tabcont">
302

    
303
				<?php if ($act == "new" || $act == gettext("Save") || $input_errors): ?>
304

    
305
				<form action="system_crlmanager.php" method="post" name="iform" id="iform">
306
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
307
						<?php if (!isset($id)): ?>
308
						<tr>
309
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Method");?></td>
310
							<td width="78%" class="vtable">
311
								<select name='method' id='method' class="formselect" onchange='method_change()'>
312
								<?php
313
									$rowIndex = 0;
314
									foreach($crl_methods as $method => $desc):
315
									if (($_GET['importonly'] == "yes") && ($method != "existing"))
316
										continue;
317
									$selected = "";
318
									if ($pconfig['method'] == $method)
319
										$selected = "selected=\"selected\"";
320
									$rowIndex++;
321
								?>
322
									<option value="<?=$method;?>" <?=$selected;?>><?=$desc;?></option>
323
								<?php endforeach;
324
								if ($rowIndex == 0)
325
									echo "<option></option>";
326
								?>
327
								</select>
328
							</td>
329
						</tr>
330
						<?php endif; ?>
331
						<tr>
332
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
333
							<td width="78%" class="vtable">
334
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
335
							</td>
336
						</tr>
337
						<tr>
338
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate Authority");?></td>
339
							<td width="78%" class="vtable">
340
								<select name='caref' id='caref' class="formselect">
341
								<?php
342
									$rowIndex = 0;
343
									foreach($a_ca as $ca):
344
									$selected = "";
345
									if ($pconfig['caref'] == $ca['refid'])
346
										$selected = "selected=\"selected\"";
347
									$rowIndex++;
348
								?>
349
									<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=htmlspecialchars($ca['descr']);?></option>
350
								<?php endforeach;
351
								if ($rowIndex == 0)
352
									echo "<option></option>";
353
								?>
354
								</select>
355
							</td>
356
						</tr>
357
					</table>
358

    
359
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="existing" summary="existing">
360
						<tr>
361
							<td colspan="2" class="list" height="12"></td>
362
						</tr>
363
						<tr>
364
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Existing Certificate Revocation List");?></td>
365
						</tr>
366

    
367
						<tr>
368
							<td width="22%" valign="top" class="vncellreq"><?=gettext("CRL data");?></td>
369
							<td width="78%" class="vtable">
370
								<textarea name="crltext" id="crltext" cols="65" rows="7" class="formfld_crl"><?=$pconfig['crltext'];?></textarea>
371
								<br />
372
								<?=gettext("Paste a Certificate Revocation List in X.509 CRL format here.");?>
373
							</td>
374
						</tr>
375
					</table>
376

    
377
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="internal" summary="internal">
378
						<tr>
379
							<td colspan="2" class="list" height="12"></td>
380
						</tr>
381
						<tr>
382
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Internal Certificate Revocation List");?></td>
383
						</tr>
384
						<tr>
385
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td>
386
							<td width="78%" class="vtable">
387
								<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>"/>
388
								<?=gettext("days");?><br />
389
								<?=gettext("Default: 9999");?>
390
							</td>
391
						</tr>
392
						<tr>
393
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Serial");?></td>
394
							<td width="78%" class="vtable">
395
								<input name="serial" type="text" class="formfld unknown" id="serial" size="5" value="<?=htmlspecialchars($pconfig['serial']);?>"/>
396
								<br />
397
								<?=gettext("Default: 0");?>
398
							</td>
399
						</tr>
400
					</table>
401

    
402
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="save">
403
						<tr>
404
							<td width="22%" valign="top">&nbsp;</td>
405
							<td width="78%">
406
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
407
								<?php if (isset($id) && $thiscrl): ?>
408
								<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
409
								<?php endif;?>
410
							</td>
411
						</tr>
412
					</table>
413
				</form>
414
				<?php elseif ($act == "editimported"): ?>
415
				<?php 	$crl = $thiscrl; ?>
416
				<form action="system_crlmanager.php" method="post" name="iform" id="iform">
417
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="editimported" summary="import">
418
						<tr>
419
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Imported Certificate Revocation List");?></td>
420
						</tr>
421
						<tr>
422
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
423
							<td width="78%" class="vtable">
424
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($crl['descr']);?>"/>
425
							</td>
426
						</tr>
427
						<tr>
428
							<td width="22%" valign="top" class="vncellreq"><?=gettext("CRL data");?></td>
429
							<td width="78%" class="vtable">
430
								<textarea name="crltext" id="crltext" cols="65" rows="7" class="formfld_crl"><?=base64_decode($crl['text']);?></textarea>
431
								<br />
432
								<?=gettext("Paste a Certificate Revocation List in X.509 CRL format here.");?></td>
433
							</td>
434
						</tr>
435
						<tr>
436
							<td width="22%" valign="top">&nbsp;</td>
437
							<td width="78%">
438
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
439
								<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
440
								<input name="act" type="hidden" value="editimported" />
441
							</td>
442
						</tr>
443
					</table>
444
				</form>
445

    
446
				<?php elseif ($act == "edit"): ?>
447
				<?php 	$crl = $thiscrl; ?>
448
				<form action="system_crlmanager.php" method="post" name="iform" id="iform">
449
				<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="revoke">
450
					<thead>
451
					<tr>
452
						<th width="90%" class="listhdrr" colspan="3"><b><?php echo gettext("Currently Revoked Certificates for CRL") . ': ' . htmlspecialchars($crl['descr']); ?></b></th>
453
						<th width="10%" class="list"></th>
454
					</tr>
455
					<tr>
456
						<th width="30%" class="listhdrr"><b><?php echo gettext("Certificate Name")?></b></th>
457
						<th width="30%" class="listhdrr"><b><?php echo gettext("Revocation Reason")?></b></th>
458
						<th width="30%" class="listhdrr"><b><?php echo gettext("Revoked At")?></b></th>
459
						<th width="10%" class="list"></th>
460
					</tr>
461
					</thead>
462
					<tbody>
463
				<?php /* List Certs on CRL */
464
					if (!is_array($crl['cert']) || (count($crl['cert']) == 0)): ?>
465
					<tr>
466
						<td class="listlr" colspan="3">
467
							&nbsp;&nbsp;&nbsp;&nbsp;<?php echo gettext("No Certificates Found for this CRL."); ?>
468
						</td>
469
						<td class="list">&nbsp;</td>
470
					</tr>
471
				<?php	else:
472
					foreach($crl['cert'] as $i => $cert):
473
				 ?>
474
					<tr>
475
						<td class="listlr">
476
							<?php echo htmlspecialchars($cert['descr']); ?>
477
						</td>
478
						<td class="listlr">
479
							<?php echo $openssl_crl_status[$cert["reason"]]; ?>
480
						</td>
481
						<td class="listlr">
482
							<?php echo date("D M j G:i:s T Y", $cert["revoke_time"]); ?>
483
						</td>
484
						<td class="list">
485
							<a href="system_crlmanager.php?act=delcert&amp;id=<?php echo $crl['refid']; ?>&amp;certref=<?php echo $cert['refid']; ?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate from the CRL?");?>')">
486
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("Delete this certificate from the CRL ");?>" alt="<?=gettext("Delete this certificate from the CRL ");?>" width="17" height="17" border="0" />
487
							</a>
488
						</td>
489
					</tr>
490
					<?php
491
					endforeach;
492
					endif;
493
					?>
494
				<?php /* Drop-down with other certs from this CA. */
495
					// Map Certs to CAs in one pass
496
					$ca_certs = array();
497
					foreach($a_cert as $cert)
498
						if ($cert['caref'] == $crl['caref'])
499
							$ca_certs[] = $cert;
500
					if (count($ca_certs) == 0): ?>
501
					<tr>
502
						<td class="listlr" colspan="3">
503
							&nbsp;&nbsp;&nbsp;&nbsp;<?php echo gettext("No Certificates Found for this CA."); ?>
504
						</td>
505
						<td class="list">&nbsp;</td>
506
					</tr>
507
				<?php	else: ?>
508
					<tr>
509
						<td class="listlr" colspan="3" align="center">
510
							<b><?php echo gettext("Choose a Certificate to Revoke"); ?></b>: <select name='certref' id='certref' class="formselect">
511
				<?php	$rowIndex = 0;
512
						foreach($ca_certs as $cert): 
513
							$rowIndex++; ?>
514
							<option value="<?=$cert['refid'];?>"><?=htmlspecialchars($cert['descr'])?></option>
515
				<?php	endforeach;
516
						if ($rowIndex == 0)
517
							echo "<option></option>"; ?>
518
							</select>
519
							<b><?php echo gettext("Reason");?></b>:
520
							<select name='crlreason' id='crlreason' class="formselect">
521
				<?php	$rowIndex = 0;
522
						foreach($openssl_crl_status as $code => $reason): 
523
							$rowIndex++; ?>
524
							<option value="<?= $code ?>"><?= htmlspecialchars($reason) ?></option>
525
				<?php	endforeach;
526
						if ($rowIndex == 0)
527
							echo "<option></option>"; ?>
528
							</select>
529
							<input name="act" type="hidden" value="addcert" />
530
							<input name="crlref" type="hidden" value="<?=$crl['refid'];?>" />
531
							<input name="id" type="hidden" value="<?=$crl['refid'];?>" />
532
							<input id="submit" name="add" type="submit" class="formbtn" value="<?=gettext("Add"); ?>" />
533
						</td>
534
						<td class="list">&nbsp;</td>
535
					</tr>
536
				<?php	endif; ?>
537
					</tbody>
538
				</table>
539
				</form>
540
				<?php else: ?>
541

    
542
				<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="ocpms">
543
					<thead>
544
					<tr>
545
						<td width="35%" class="listhdrr"><?=gettext("Name");?></td>
546
						<td width="10%" class="listhdrr"><?=gettext("Internal");?></td>
547
						<td width="35%" class="listhdrr"><?=gettext("Certificates");?></td>
548
						<td width="10%" class="listhdrr"><?=gettext("In Use");?></td>
549
						<td width="10%" class="list"></td>
550
					</tr>
551
					</thead>
552
					<tfoot>
553
					<tr>
554
						<td colspan="5">
555
							<p>
556
								<?=gettext("Additional Certificate Revocation Lists can be added here.");?>
557
							</p>
558
						</td>
559
					</tr>
560
					</tfoot>					<tbody>
561
					<?php
562
						$caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
563
						// Map CRLs to CAs in one pass
564
						$ca_crl_map = array();
565
						foreach($a_crl as $crl)
566
							$ca_crl_map[$crl['caref']][] = $crl['refid'];
567

    
568
						$i = 0;
569
						foreach($a_ca as $ca):
570
							if($ca['prv']) {
571
								$cainternal = "YES";
572
							} else 
573
								$cainternal = "NO";
574
					?>
575
					<tr>
576
						<td class="listlr" colspan="4">
577
							<table border="0" cellpadding="0" cellspacing="0" summary="icon">
578
								<tr>
579
									<td align="left" valign="middle">
580
										<img src="<?=$caimg;?>" alt="CA" title="CA" border="0" height="16" width="16" />
581
									</td>
582
									<td align="left" valign="middle">
583
										<?=htmlspecialchars($ca['descr']);?>
584
									</td>
585
								</tr>
586
							</table>
587
						</td>
588
						<td class="list">
589
						<?php if ($cainternal == "YES"): ?>
590
							<a href="system_crlmanager.php?act=new&amp;caref=<?php echo $ca['refid']; ?>">
591
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?php printf(gettext("Add or Import CRL for %s"),htmlspecialchars($ca['descr']));?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" />
592
							</a>
593
						<?php else: ?>
594
							<a href="system_crlmanager.php?act=new&amp;caref=<?php echo $ca['refid']; ?>&amp;importonly=yes">
595
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?php printf(gettext("Import CRL for %s"),htmlspecialchars($ca['descr']));?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" />
596
							</a>
597
						<?php endif; ?>
598
						</td>
599
					</tr>
600
					
601
						<?php
602
						if (is_array($ca_crl_map[$ca['refid']])):
603
							foreach($ca_crl_map[$ca['refid']] as $crl):
604
								$tmpcrl = lookup_crl($crl);
605
								$internal = is_crl_internal($tmpcrl);
606
								$inuse = crl_in_use($tmpcrl['refid']);
607
						?>
608
					<tr>
609
						<td class="listlr"><?php echo htmlspecialchars($tmpcrl['descr']); ?></td>
610
						<td class="listr"><?php echo ($internal) ? "YES" : "NO"; ?></td>
611
						<td class="listr"><?php echo ($internal) ? count($tmpcrl['cert']) : "Unknown (imported)"; ?></td>
612
						<td class="listr"><?php echo ($inuse) ? "YES" : "NO"; ?></td>
613
						<td valign="middle" class="list nowrap">
614
							<a href="system_crlmanager.php?act=exp&amp;id=<?=$tmpcrl['refid'];?>">
615
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("Export CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" alt="<?=gettext("Export CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" width="17" height="17" border="0" />
616
							</a>
617
							<?php if ($internal): ?>
618
							<a href="system_crlmanager.php?act=edit&amp;id=<?=$tmpcrl['refid'];?>">
619
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("Edit CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" alt="<?=gettext("Edit CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" width="17" height="17" border="0" />
620
							</a>
621
							<?php else: ?>
622
							<a href="system_crlmanager.php?act=editimported&amp;id=<?=$tmpcrl['refid'];?>">
623
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("Edit CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" alt="<?=gettext("Edit CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" width="17" height="17" border="0" />
624
							</a>
625
							<?php endif; ?>
626
							<?php if (!$inuse): ?>
627
							<a href="system_crlmanager.php?act=del&amp;id=<?=$tmpcrl['refid'];?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate Revocation List?") . ' (' . htmlspecialchars($tmpcrl['descr']) . ')';?>')">
628
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("Delete CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" alt="<?=gettext("Delete CRL") . " " . htmlspecialchars($tmpcrl['descr']); ?>" width="17" height="17" border="0" />
629
							</a>
630
							<?php endif; ?>
631
						</td>
632
					</tr>
633
						<?php
634
								$i++;
635
							endforeach;
636
						endif;
637
						?>
638
					<tr><td colspan="5">&nbsp;</td></tr>
639
					<?php
640
							$i++;
641
						endforeach;
642
					?>
643
					</tbody>
644
				</table>
645

    
646
				<?php endif; ?>
647

    
648
			</div>
649
		</td>
650
	</tr>
651
</table>
652
<?php include("fend.inc");?>
653
<script type="text/javascript">
654
//<![CDATA[
655

    
656
method_change();
657

    
658
//]]>
659
</script>
660

    
661
</body>
662
</html>
(210-210/252)