Projet

Général

Profil

Télécharger (21,9 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / system_crlmanager.php @ b4e9a4da

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

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

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

    
44
global $openssl_crl_status;
45

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
186
if ($_POST) {
187
	unset($input_errors);
188
	$pconfig = $_POST;
189

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

    
205
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
206

    
207
	/* if this is an AJAX caller then handle via JSON */
208
	if (isAjax() && is_array($input_errors)) {
209
		input_errors2Ajax($input_errors);
210
		exit;
211
	}
212

    
213
	/* save modifications */
214
	if (!$input_errors) {
215
		$result = false;
216

    
217
		if ($thiscrl) {
218
			$crl =& $thiscrl;
219
		} else {
220
			$crl = array();
221
			$crl['refid'] = uniqid();
222
		}
223

    
224
		$crl['descr'] = $pconfig['descr'];
225
		if ($act != "editimported") {
226
			$crl['caref'] = $pconfig['caref'];
227
			$crl['method'] = $pconfig['method'];
228
		}
229

    
230
		if (($pconfig['method'] == "existing") || ($act == "editimported")) {
231
			$crl['text'] = base64_encode($pconfig['crltext']);
232
		}
233

    
234
		if ($pconfig['method'] == "internal") {
235
			$crl['serial'] = empty($pconfig['serial']) ? 9999 : $pconfig['serial'];
236
			$crl['lifetime'] = empty($pconfig['lifetime']) ? 9999 : $pconfig['lifetime'];
237
			$crl['cert'] = array();
238
		}
239

    
240
		if (!$thiscrl)
241
			$a_crl[] = $crl;
242

    
243
		write_config("Saved CRL {$crl['descr']}");
244
		openvpn_refresh_crls();
245
		pfSenseHeader("system_crlmanager.php");
246
	}
247
}
248

    
249
include("head.inc");
250
?>
251

    
252
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
253
<?php include("fbegin.inc"); ?>
254
<script type="text/javascript">
255
//<![CDATA[
256

    
257
function method_change() {
258

    
259
	method = document.iform.method.value;
260

    
261
	switch (method) {
262
		case "internal":
263
			document.getElementById("existing").style.display="none";
264
			document.getElementById("internal").style.display="";
265
			break;
266
		case "existing":
267
			document.getElementById("existing").style.display="";
268
			document.getElementById("internal").style.display="none";
269
			break;
270
	}
271
}
272

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

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

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

    
343
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="existing" summary="existing">
344
						<tr>
345
							<td colspan="2" class="list" height="12"></td>
346
						</tr>
347
						<tr>
348
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Existing Certificate Revocation List");?></td>
349
						</tr>
350

    
351
						<tr>
352
							<td width="22%" valign="top" class="vncellreq"><?=gettext("CRL data");?></td>
353
							<td width="78%" class="vtable">
354
								<textarea name="crltext" id="crltext" cols="65" rows="7" class="formfld_crl"><?=$pconfig['crltext'];?></textarea>
355
								<br />
356
								<?=gettext("Paste a Certificate Revocation List in X.509 CRL format here.");?>
357
							</td>
358
						</tr>
359
					</table>
360

    
361
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="internal" summary="internal">
362
						<tr>
363
							<td colspan="2" class="list" height="12"></td>
364
						</tr>
365
						<tr>
366
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Internal Certificate Revocation List");?></td>
367
						</tr>
368
						<tr>
369
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td>
370
							<td width="78%" class="vtable">
371
								<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>"/>
372
								<?=gettext("days");?><br />
373
								<?=gettext("Default: 9999");?>
374
							</td>
375
						</tr>
376
						<tr>
377
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Serial");?></td>
378
							<td width="78%" class="vtable">
379
								<input name="serial" type="text" class="formfld unknown" id="serial" size="5" value="<?=htmlspecialchars($pconfig['serial']);?>"/>
380
								<br />
381
								<?=gettext("Default: 0");?>
382
							</td>
383
						</tr>
384
					</table>
385

    
386
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="save">
387
						<tr>
388
							<td width="22%" valign="top">&nbsp;</td>
389
							<td width="78%">
390
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
391
								<?php if (isset($id) && $thiscrl): ?>
392
								<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
393
								<?php endif;?>
394
							</td>
395
						</tr>
396
					</table>
397
				</form>
398
				<?php elseif ($act == "editimported"): ?>
399
				<?php 	$crl = $thiscrl; ?>
400
				<form action="system_crlmanager.php" method="post" name="iform" id="iform">
401
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="editimported" summary="import">
402
						<tr>
403
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Imported Certificate Revocation List");?></td>
404
						</tr>
405
						<tr>
406
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
407
							<td width="78%" class="vtable">
408
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($crl['descr']);?>"/>
409
							</td>
410
						</tr>
411
						<tr>
412
							<td width="22%" valign="top" class="vncellreq"><?=gettext("CRL data");?></td>
413
							<td width="78%" class="vtable">
414
								<textarea name="crltext" id="crltext" cols="65" rows="7" class="formfld_crl"><?=base64_decode($crl['text']);?></textarea>
415
								<br />
416
								<?=gettext("Paste a Certificate Revocation List in X.509 CRL format here.");?></td>
417
							</td>
418
						</tr>
419
						<tr>
420
							<td width="22%" valign="top">&nbsp;</td>
421
							<td width="78%">
422
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
423
								<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
424
								<input name="act" type="hidden" value="editimported" />
425
							</td>
426
						</tr>
427
					</table>
428
				</form>
429

    
430
				<?php elseif ($act == "edit"): ?>
431
				<?php 	$crl = $thiscrl; ?>
432
				<form action="system_crlmanager.php" method="post" name="iform" id="iform">
433
				<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="revoke">
434
					<thead>
435
					<tr>
436
						<th width="90%" class="listhdrr" colspan="3"><b><?php echo gettext("Currently Revoked Certificates for CRL") . ': ' . $crl['descr']; ?></b></th>
437
						<th width="10%" class="list"></th>
438
					</tr>
439
					<tr>
440
						<th width="30%" class="listhdrr"><b><?php echo gettext("Certificate Name")?></b></th>
441
						<th width="30%" class="listhdrr"><b><?php echo gettext("Revocation Reason")?></b></th>
442
						<th width="30%" class="listhdrr"><b><?php echo gettext("Revoked At")?></b></th>
443
						<th width="10%" class="list"></th>
444
					</tr>
445
					</thead>
446
					<tbody>
447
				<?php /* List Certs on CRL */
448
					if (!is_array($crl['cert']) || (count($crl['cert']) == 0)): ?>
449
					<tr>
450
						<td class="listlr" colspan="3">
451
							&nbsp;&nbsp;&nbsp;&nbsp;<?php echo gettext("No Certificates Found for this CRL."); ?>
452
						</td>
453
						<td class="list">&nbsp;</td>
454
					</td>
455
				<?php	else:
456
					foreach($crl['cert'] as $i => $cert):
457
						$name = htmlspecialchars($cert['descr']);
458
				 ?>
459
					<tr>
460
						<td class="listlr">
461
							<?php echo $name; ?>
462
						</td>
463
						<td class="listlr">
464
							<?php echo $openssl_crl_status[$cert["reason"]]; ?>
465
						</td>
466
						<td class="listlr">
467
							<?php echo date("D M j G:i:s T Y", $cert["revoke_time"]); ?>
468
						</td>
469
						<td class="list">
470
							<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?");?>')">
471
								<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" />
472
							</a>
473
						</td>
474
					</tr>
475
					<?php
476
					endforeach;
477
					endif;
478
					?>
479
				<?php /* Drop-down with other certs from this CA. */
480
					// Map Certs to CAs in one pass
481
					$ca_certs = array();
482
					foreach($a_cert as $cert)
483
						if ($cert['caref'] == $crl['caref'])
484
							$ca_certs[] = $cert;
485
					if (count($ca_certs) == 0): ?>
486
					<tr>
487
						<td class="listlr" colspan="3">
488
							&nbsp;&nbsp;&nbsp;&nbsp;<?php echo gettext("No Certificates Found for this CA."); ?>
489
						</td>
490
						<td class="list">&nbsp;</td>
491
					</td>
492
				<?php	else: ?>
493
					<tr>
494
						<td class="listlr" colspan="3" align="center">
495
							<b><?php echo gettext("Choose a Certificate to Revoke"); ?></b>: <select name='certref' id='certref' class="formselect">
496
				<?php	foreach($ca_certs as $cert): ?>
497
							<option value="<?=$cert['refid'];?>"><?=htmlspecialchars($cert['descr'])?></option>
498
				<?php	endforeach; ?>
499
							</select>
500
							<b><?php echo gettext("Reason");?></b>:
501
							<select name='crlreason' id='crlreason' class="formselect">
502
				<?php	foreach($openssl_crl_status as $code => $reason): ?>
503
							<option value="<?= $code ?>"><?= htmlspecialchars($reason) ?></option>
504
				<?php	endforeach; ?>
505
							</select>
506
							<input name="act" type="hidden" value="addcert" />
507
							<input name="crlref" type="hidden" value="<?=$crl['refid'];?>" />
508
							<input name="id" type="hidden" value="<?=$crl['refid'];?>" />
509
							<input id="submit" name="add" type="submit" class="formbtn" value="<?=gettext("Add"); ?>" />
510
						</td>
511
						<td class="list">&nbsp;</td>
512
					</tr>
513
				<?php	endif; ?>
514
					</tbody>
515
				</table>
516
				</form>
517
				<?php else: ?>
518

    
519
				<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="ocpms">
520
					<thead>
521
					<tr>
522
						<td width="35%" class="listhdrr"><?=gettext("Name");?></td>
523
						<td width="10%" class="listhdrr"><?=gettext("Internal");?></td>
524
						<td width="35%" class="listhdrr"><?=gettext("Certificates");?></td>
525
						<td width="10%" class="listhdrr"><?=gettext("In Use");?></td>
526
						<td width="10%" class="list"></td>
527
					</tr>
528
					</thead>
529
					<tfoot>
530
					<tr>
531
						<td colspan="5">
532
							<p>
533
								<?=gettext("Additional Certificate Revocation Lists can be added here.");?>
534
							</p>
535
						</td>
536
					</tr>
537
					</tfoot>					<tbody>
538
					<?php
539
						$caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
540
						// Map CRLs to CAs in one pass
541
						$ca_crl_map = array();
542
						foreach($a_crl as $crl)
543
							$ca_crl_map[$crl['caref']][] = $crl['refid'];
544

    
545
						$i = 0;
546
						foreach($a_ca as $ca):
547
							$name = htmlspecialchars($ca['descr']);
548

    
549
							if($ca['prv']) {
550
								$cainternal = "YES";
551
							} else 
552
								$cainternal = "NO";
553
					?>
554
					<tr>
555
						<td class="listlr" colspan="4">
556
							<table border="0" cellpadding="0" cellspacing="0" summary="icon">
557
								<tr>
558
									<td align="left" valign="middle">
559
										<img src="<?=$caimg;?>" alt="CA" title="CA" border="0" height="16" width="16" />
560
									</td>
561
									<td align="left" valign="middle">
562
										<?=$name;?>
563
									</td>
564
								</tr>
565
							</table>
566
						</td>
567
						<td class="list">
568
						<?php if ($cainternal == "YES"): ?>
569
							<a href="system_crlmanager.php?act=new&amp;caref=<?php echo $ca['refid']; ?>">
570
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?php printf(gettext("Add or Import CRL for %s"),$ca['descr']);?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" />
571
							</a>
572
						<?php else: ?>
573
							<a href="system_crlmanager.php?act=new&amp;caref=<?php echo $ca['refid']; ?>&amp;importonly=yes">
574
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?php printf(gettext("Import CRL for %s"),$ca['descr']);?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" />
575
							</a>
576
						<?php endif; ?>
577
						</td>
578
					</tr>
579
					
580
						<?php
581
						if (is_array($ca_crl_map[$ca['refid']])):
582
							foreach($ca_crl_map[$ca['refid']] as $crl):
583
								$tmpcrl = lookup_crl($crl);
584
								$internal = is_crl_internal($tmpcrl);
585
								$inuse = crl_in_use($tmpcrl['refid']);
586
						?>
587
					<tr>
588
						<td class="listlr"><?php echo $tmpcrl['descr']; ?></td>
589
						<td class="listr"><?php echo ($internal) ? "YES" : "NO"; ?></td>
590
						<td class="listr"><?php echo ($internal) ? count($tmpcrl['cert']) : "Unknown (imported)"; ?></td>
591
						<td class="listr"><?php echo ($inuse) ? "YES" : "NO"; ?></td>
592
						<td valign="middle" class="list nowrap">
593
							<a href="system_crlmanager.php?act=exp&amp;id=<?=$tmpcrl['refid'];?>">
594
								<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" />
595
							</a>
596
							<?php if ($internal): ?>
597
							<a href="system_crlmanager.php?act=edit&amp;id=<?=$tmpcrl['refid'];?>">
598
								<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" />
599
							</a>
600
							<?php else: ?>
601
							<a href="system_crlmanager.php?act=editimported&amp;id=<?=$tmpcrl['refid'];?>">
602
								<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" />
603
							</a>
604
							<?php endif; ?>
605
							<?php if (!$inuse): ?>
606
							<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']) . ')';?>')">
607
								<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" />
608
							</a>
609
							<?php endif; ?>
610
						</td>
611
					</tr>
612
						<?php
613
								$i++;
614
							endforeach;
615
						endif;
616
						?>
617
					<tr><td colspan="5">&nbsp;</td></tr>
618
					<?php
619
							$i++;
620
						endforeach;
621
					?>
622
					</tbody>
623
				</table>
624

    
625
				<?php endif; ?>
626

    
627
			</div>
628
		</td>
629
	</tr>
630
</table>
631
<?php include("fend.inc");?>
632
<script type="text/javascript">
633
//<![CDATA[
634

    
635
method_change();
636

    
637
//]]>
638
</script>
639

    
640
</body>
641
</html>
(213-213/255)