Project

General

Profile

Download (20.4 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
    system_camanager.php
4

    
5
    Copyright (C) 2008 Shrew Soft Inc.
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-camanager
35
##|*NAME=System: CA Manager
36
##|*DESCR=Allow access to the 'System: CA Manager' page.
37
##|*MATCH=system_camanager.php*
38
##|-PRIV
39

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

    
43
$ca_methods = array(
44
	"existing" => gettext("Import an existing Certificate Authority"),
45
	"internal" => gettext("Create an internal Certificate Authority"));
46

    
47
$ca_keylens = array( "512", "1024", "2048", "4096");
48

    
49
$pgtitle = array(gettext("System"), gettext("Certificate Authority Manager"));
50

    
51
$id = $_GET['id'];
52
if (isset($_POST['id']))
53
	$id = $_POST['id'];
54

    
55
if (!is_array($config['ca']))
56
	$config['ca'] = array();
57

    
58
$a_ca =& $config['ca'];
59

    
60
if (!is_array($config['cert']))
61
	$config['cert'] = array();
62

    
63
$a_cert =& $config['cert'];
64

    
65
if (!is_array($config['crl']))
66
	$config['crl'] = array();
67

    
68
$a_crl =& $config['crl'];
69

    
70
$act = $_GET['act'];
71
if ($_POST['act'])
72
	$act = $_POST['act'];
73

    
74
if ($act == "del") {
75

    
76
	if (!$a_ca[$id]) {
77
		pfSenseHeader("system_camanager.php");
78
		exit;
79
	}
80

    
81
	$index = count($a_cert) - 1;
82
	for (;$index >=0; $index--)
83
		if ($a_cert[$index]['caref'] == $a_ca[$id]['refid'])
84
			unset($a_cert[$index]);
85

    
86
	$index = count($a_crl) - 1;
87
	for (;$index >=0; $index--)
88
		if ($a_crl[$index]['caref'] == $a_ca[$id]['refid'])
89
			unset($a_crl[$index]);
90

    
91
	$name = $a_ca[$id]['descr'];
92
	unset($a_ca[$id]);
93
	write_config();
94
	$savemsg = sprintf(gettext("Certificate Authority %s and its CRLs (if any) successfully deleted"), $name) . "<br/>";
95
	pfSenseHeader("system_camanager.php");
96
	exit;
97
}
98

    
99
if ($act == "edit") {
100
	if (!$a_ca[$id]) {
101
		pfSenseHeader("system_camanager.php");
102
		exit;
103
	}
104
	$pconfig['descr']  = $a_ca[$id]['descr'];
105
	$pconfig['refid']  = $a_ca[$id]['refid'];
106
	$pconfig['cert']   = base64_decode($a_ca[$id]['crt']);
107
	$pconfig['serial'] = $a_ca[$id]['serial'];
108
	if (!empty($a_ca[$id]['prv']))
109
		$pconfig['key'] = base64_decode($a_ca[$id]['prv']);
110
}
111

    
112
if ($act == "new") {
113
	$pconfig['method'] = $_GET['method'];
114
	$pconfig['keylen'] = "2048";
115
	$pconfig['lifetime'] = "3650";
116
	$pconfig['dn_commonname'] = "internal-ca";
117
}
118

    
119
if ($act == "exp") {
120

    
121
	if (!$a_ca[$id]) {
122
		pfSenseHeader("system_camanager.php");
123
		exit;
124
	}
125

    
126
	$exp_name = urlencode("{$a_ca[$id]['descr']}.crt");
127
	$exp_data = base64_decode($a_ca[$id]['crt']);
128
	$exp_size = strlen($exp_data);
129

    
130
	header("Content-Type: application/octet-stream");
131
	header("Content-Disposition: attachment; filename={$exp_name}");
132
	header("Content-Length: $exp_size");
133
	echo $exp_data;
134
	exit;
135
}
136

    
137
if ($act == "expkey") {
138

    
139
	if (!$a_ca[$id]) {
140
		pfSenseHeader("system_camanager.php");
141
		exit;
142
	}
143

    
144
	$exp_name = urlencode("{$a_ca[$id]['descr']}.key");
145
	$exp_data = base64_decode($a_ca[$id]['prv']);
146
	$exp_size = strlen($exp_data);
147

    
148
	header("Content-Type: application/octet-stream");
149
	header("Content-Disposition: attachment; filename={$exp_name}");
150
	header("Content-Length: $exp_size");
151
	echo $exp_data;
152
	exit;
153
}
154

    
155
if ($_POST) {
156

    
157
	$input_errors = array();
158
	$pconfig = $_POST;
159

    
160
	/* input validation */
161
	if ($pconfig['method'] == "existing") {
162
		$reqdfields = explode(" ", "descr cert");
163
		$reqdfieldsn = array(
164
				gettext("Descriptive name"),
165
				gettext("Certificate data"));
166
		if ($_POST['cert'] && (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE")))
167
			$input_errors[] = gettext("This certificate does not appear to be valid.");
168
		if ($_POST['key'] && strstr($_POST['key'], "ENCRYPTED"))
169
			$input_errors[] = gettext("Encrypted private keys are not yet supported.");
170
	}
171
	if ($pconfig['method'] == "internal") {
172
		$reqdfields = explode(" ",
173
				"descr keylen lifetime dn_country dn_state dn_city ".
174
				"dn_organization dn_email dn_commonname");
175
		$reqdfieldsn = array(
176
				gettext("Descriptive name"),
177
				gettext("Key length"),
178
				gettext("Lifetime"),
179
				gettext("Distinguished name Country Code"),
180
				gettext("Distinguished name State or Province"),
181
				gettext("Distinguished name City"),
182
				gettext("Distinguished name Organization"),
183
				gettext("Distinguished name Email Address"),
184
				gettext("Distinguished name Common Name"));
185
	}
186

    
187
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
188
	if ($pconfig['method'] != "existing")
189
		/* Make sure we do not have invalid characters in the fields for the certificate */
190
		for ($i = 0; $i < count($reqdfields); $i++) {
191
			if ($reqdfields[$i] == 'dn_email'){
192
				if (preg_match("/[\!\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["dn_email"]))
193
					array_push($input_errors, "The field 'Distinguished name Email Address' contains invalid characters.");
194
			}else if ($reqdfields[$i] == 'dn_commonname'){
195
				if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["dn_commonname"]))
196
					array_push($input_errors, "The field 'Distinguished name Common Name' contains invalid characters.");
197
			}else if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
198
				array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
199
		}
200

    
201
	/* if this is an AJAX caller then handle via JSON */
202
	if (isAjax() && is_array($input_errors)) {
203
		input_errors2Ajax($input_errors);
204
		exit;
205
	}
206

    
207
	/* save modifications */
208
	if (!$input_errors) {
209

    
210
		$ca = array();
211
		if (!isset($pconfig['refid']) || empty($pconfig['refid']))
212
			$ca['refid'] = uniqid();
213
		else
214
			$ca['refid'] = $pconfig['refid'];
215

    
216
		if (isset($id) && $a_ca[$id])
217
			$ca = $a_ca[$id];
218

    
219
		$ca['descr'] = $pconfig['descr'];
220

    
221
		if ($_POST['edit'] == "edit") {
222
			$ca['descr']  = $pconfig['descr'];
223
			$ca['refid']  = $pconfig['refid'];
224
			$ca['serial'] = $pconfig['serial'];
225
			$ca['crt']    = base64_encode($pconfig['cert']);
226
			if (!empty($pconfig['key']))
227
				$ca['prv']    = base64_encode($pconfig['key']);
228
		} else {
229
			if ($pconfig['method'] == "existing")
230
				ca_import($ca, $pconfig['cert'], $pconfig['key'], $pconfig['serial']);
231

    
232
			if ($pconfig['method'] == "internal") {
233
				$dn = array(
234
					'countryName' => $pconfig['dn_country'],
235
					'stateOrProvinceName' => $pconfig['dn_state'],
236
					'localityName' => $pconfig['dn_city'],
237
					'organizationName' => $pconfig['dn_organization'],
238
					'emailAddress' => $pconfig['dn_email'],
239
					'commonName' => $pconfig['dn_commonname']);
240
				ca_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn);
241
			}
242
		}
243

    
244
		if (isset($id) && $a_ca[$id])
245
			$a_ca[$id] = $ca;
246
		else
247
			$a_ca[] = $ca;
248

    
249
		write_config();
250

    
251
//		pfSenseHeader("system_camanager.php");
252
	}
253
}
254

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

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

    
263
function method_change() {
264

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

    
267
	switch (method) {
268
		case 0:
269
			document.getElementById("existing").style.display="";
270
			document.getElementById("internal").style.display="none";
271
			break;
272
		case 1:
273
			document.getElementById("existing").style.display="none";
274
			document.getElementById("internal").style.display="";
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
	// Load valid country codes
288
	$dn_cc = array();
289
	if (file_exists("/etc/ca_countries")){
290
		$dn_cc_file=file("/etc/ca_countries");
291
		foreach($dn_cc_file as $line)
292
			if (preg_match('/^(\S*)\s(.*)$/', $line, $matches))
293
				array_push($dn_cc, $matches[1]);
294
	}
295
?>
296
<table width="100%" border="0" cellpadding="0" cellspacing="0">
297
	<tr>
298
		<td>
299
		<?php
300
			$tab_array = array();
301
			$tab_array[] = array(gettext("CAs"), true, "system_camanager.php");
302
			$tab_array[] = array(gettext("Certificates"), false, "system_certmanager.php");
303
			$tab_array[] = array(gettext("Certificate Revocation"), false, "system_crlmanager.php");
304
			display_top_tabs($tab_array);
305
		?>
306
		</td>
307
	</tr>
308
	<tr>
309
		<td id="mainarea">
310
			<div class="tabcont">
311

    
312
				<?php if ($act == "new" || $act == "edit" || $act == gettext("Save") || $input_errors): ?>
313

    
314
				<form action="system_camanager.php" method="post" name="iform" id="iform">
315
					<?php if ($act == "edit"): ?>
316
					<input type="hidden" name="edit" value="edit" id="edit">
317
					<input type="hidden" name="id" value="<?php echo $id; ?>" id="id">
318
					<input type="hidden" name="refid" value="<?php echo $pconfig['refid']; ?>" id="refid">
319
					<?php endif; ?>
320
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
321
						<tr>
322
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
323
							<td width="78%" class="vtable">
324
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
325
							</td>
326
						</tr>
327
						<?php if (!isset($id) || $act == "edit"): ?>
328
						<tr>
329
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Method");?></td>
330
							<td width="78%" class="vtable">
331
								<select name='method' id='method' class="formselect" onchange='method_change()'>
332
								<?php
333
									foreach($ca_methods as $method => $desc):
334
									$selected = "";
335
									if ($pconfig['method'] == $method)
336
										$selected = "selected";
337
								?>
338
									<option value="<?=$method;?>"<?=$selected;?>><?=$desc;?></option>
339
								<?php endforeach; ?>
340
								</select>
341
							</td>
342
						</tr>
343
						<?php endif; ?>
344
					</table>
345

    
346
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="existing">
347
						<tr>
348
							<td colspan="2" class="list" height="12"></td>
349
						</tr>
350
						<tr>
351
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Existing Certificate Authority");?></td>
352
						</tr>
353

    
354
						<tr>
355
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate data");?></td>
356
							<td width="78%" class="vtable">
357
								<textarea name="cert" id="cert" cols="65" rows="7" class="formfld_cert"><?=htmlspecialchars($pconfig['cert']);?></textarea>
358
								<br>
359
								<?=gettext("Paste a certificate in X.509 PEM format here.");?></td>
360
							</td>
361
						</tr>
362
						<tr>
363
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate Private Key");?><br/><?=gettext("(optional)");?></td>
364
							<td width="78%" class="vtable">
365
								<textarea name="key" id="key" cols="65" rows="7" class="formfld_cert"><?=htmlspecialchars($pconfig['key']);?></textarea>
366
								<br>
367
								<?=gettext("Paste the private key for the above certificate here. This is optional in most cases, but required if you need to generate a Certificate Revocation List (CRL).");?></td>
368
							</td>
369
						</tr>
370

    
371
					<?php if (!isset($id) || $act == "edit"): ?>
372
						<tr>
373
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Serial");?></td>
374
							<td width="78%" class="vtable">
375
								<input name="serial" type="text" class="formfld unknown" id="serial" size="20" value="<?=htmlspecialchars($pconfig['serial']);?>"/>
376
							</td>
377
						</tr>
378
					<?php endif; ?>
379
					</table>
380

    
381
					<table width="100%" border="0" cellpadding="6" cellspacing="0" id="internal">
382
						<tr>
383
							<td colspan="2" class="list" height="12"></td>
384
						</tr>
385
						<tr>
386
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Internal Certificate Authority");?></td>
387
						</tr>
388
						<tr>
389
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Key length");?></td>
390
							<td width="78%" class="vtable">
391
								<select name='keylen' id='keylen' class="formselect">
392
								<?php
393
									foreach( $ca_keylens as $len):
394
									$selected = "";
395
									if ($pconfig['keylen'] == $len)
396
										$selected = "selected";
397
								?>
398
									<option value="<?=$len;?>"<?=$selected;?>><?=$len;?></option>
399
								<?php endforeach; ?>
400
								</select>
401
								<?=gettext("bits");?>
402
							</td>
403
						</tr>
404
						<tr>
405
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td>
406
							<td width="78%" class="vtable">
407
								<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>"/>
408
								<?=gettext("days");?>
409
							</td>
410
						</tr>
411
						<tr>
412
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Distinguished name");?></td>
413
							<td width="78%" class="vtable">
414
								<table border="0" cellspacing="0" cellpadding="2">
415
									<tr>
416
										<td align="right"><?=gettext("Country Code");?> : &nbsp;</td>
417
										<td align="left">
418
											<select name='dn_country' class="formselect">
419
											<?php
420
											foreach( $dn_cc as $cc){
421
												$selected = "";
422
												if ($pconfig['dn_country'] == $cc) $selected = "selected";
423
												print "<option value=\"$cc\" $selected>$cc</option>";
424
												}
425
											?>
426
											</select>
427
										</td>
428
									</tr>
429
									<tr>
430
										<td align="right"><?=gettext("State or Province");?> : &nbsp;</td>
431
										<td align="left">
432
											<input name="dn_state" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_state']);?>"/>
433
											&nbsp;
434
											<em><?=gettext("ex:");?></em>
435
											&nbsp;
436
											<?=gettext("Texas");?>
437
										</td>
438
									</tr>
439
									<tr>
440
										<td align="right"><?=gettext("City");?> : &nbsp;</td>
441
										<td align="left">
442
											<input name="dn_city" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_city']);?>"/>
443
											&nbsp;
444
											<em><?=gettext("ex:");?></em>
445
											&nbsp;
446
											<?=gettext("Austin");?>
447
										</td>
448
									</tr>
449
									<tr>
450
										<td align="right"><?=gettext("Organization");?> : &nbsp;</td>
451
										<td align="left">
452
											<input name="dn_organization" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['dn_organization']);?>"/>
453
											&nbsp;
454
											<em><?=gettext("ex:");?></em>
455
											&nbsp;
456
											<?=gettext("My Company Inc.");?>
457
										</td>
458
									</tr>
459
									<tr>
460
										<td align="right"><?=gettext("Email Address");?> : &nbsp;</td>
461
										<td align="left">
462
											<input name="dn_email" type="text" class="formfld unknown" size="25" value="<?=htmlspecialchars($pconfig['dn_email']);?>"/>
463
											&nbsp;
464
											<em><?=gettext("ex:");?></em>
465
											&nbsp;
466
											<?=gettext("admin@mycompany.com");?>
467
										</td>
468
									</tr>
469
									<tr>
470
										<td align="right"><?=gettext("Common Name");?> : &nbsp;</td>
471
										<td align="left">
472
											<input name="dn_commonname" type="text" class="formfld unknown" size="25" value="<?=htmlspecialchars($pconfig['dn_commonname']);?>"/>
473
											&nbsp;
474
											<em><?=gettext("ex:");?></em>
475
											&nbsp;
476
											<?=gettext("internal-ca");?>
477
										</td>
478
									</tr>
479
								</table>
480
							</td>
481
						</tr>
482
					</table>
483

    
484
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
485
						<tr>
486
							<td width="22%" valign="top">&nbsp;</td>
487
							<td width="78%">
488
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
489
								<?php if (isset($id) && $a_ca[$id]): ?>
490
								<input name="id" type="hidden" value="<?=$id;?>" />
491
								<?php endif;?>
492
							</td>
493
						</tr>
494
					</table>
495
				</form>
496

    
497
				<?php else: ?>
498

    
499
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
500
					<tr>
501
						<td width="20%" class="listhdrr"><?=gettext("Name");?></td>
502
						<td width="10%" class="listhdrr"><?=gettext("Internal");?></td>
503
						<td width="10%" class="listhdrr"><?=gettext("Issuer");?></td>
504
						<td width="10%" class="listhdrr"><?=gettext("Certificates");?></td>
505
						<td width="40%" class="listhdrr"><?=gettext("Distinguished Name");?></td>
506
						<td width="10%" class="list"></td>
507
					</tr>
508
					<?php
509
						$i = 0;
510
						foreach($a_ca as $ca):
511
							$name = htmlspecialchars($ca['descr']);
512
							$subj = cert_get_subject($ca['crt']);
513
							$issuer = cert_get_issuer($ca['crt']);
514
							if($subj == $issuer)
515
							  $issuer_name = "<em>" . gettext("self-signed") . "</em>";
516
							else
517
							  $issuer_name = "<em>" . gettext("external") . "</em>";
518
							$subj = htmlspecialchars($subj);
519
							$issuer = htmlspecialchars($issuer);
520
							$certcount = 0;
521

    
522
							$issuer_ca = lookup_ca($ca['caref']);
523
							if ($issuer_ca)
524
								$issuer_name = $issuer_ca['descr'];
525

    
526
							// TODO : Need gray certificate icon
527

    
528
							if($ca['prv']) {
529
								$caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
530
								$internal = "YES";
531

    
532
							} else {
533
								$caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
534
								$internal = "NO";
535
							}
536
							foreach ($a_cert as $cert)
537
								if ($cert['caref'] == $ca['refid'])
538
									$certcount++;
539
  						foreach ($a_ca as $cert)
540
  							if ($cert['caref'] == $ca['refid'])
541
  								$certcount++;
542
					?>
543
					<tr>
544
						<td class="listlr">
545
							<table border="0" cellpadding="0" cellspacing="0">
546
								<tr>
547
									<td align="left" valign="center">
548
										<img src="<?=$caimg;?>" alt="CA" title="CA" border="0" height="16" width="16" />
549
									</td>
550
									<td align="left" valign="middle">
551
										<?=$name;?>
552
									</td>
553
								</tr>
554
							</table>
555
						</td>
556
						<td class="listr"><?=$internal;?>&nbsp;</td>
557
						<td class="listr"><?=$issuer_name;?>&nbsp;</td>
558
						<td class="listr"><?=$certcount;?>&nbsp;</td>
559
						<td class="listr"><?=$subj;?>&nbsp;</td>
560
						<td valign="middle" nowrap class="list">
561
							<a href="system_camanager.php?act=edit&id=<?=$i;?>")">
562
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("export ca");?>" alt="<?=gettext("edit ca");?>" width="17" height="17" border="0" />
563
							</a>
564
							<a href="system_camanager.php?act=exp&id=<?=$i;?>")">
565
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export ca");?>" alt="<?=gettext("export ca");?>" width="17" height="17" border="0" />
566
							</a>
567
							<?php if ($ca['prv']): ?>
568
							<a href="system_camanager.php?act=expkey&id=<?=$i;?>")">
569
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export ca private key");?>" alt="<?=gettext("export ca private key");?>" width="17" height="17" border="0" />
570
							</a>
571
							<?php endif; ?>
572
							<a href="system_camanager.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate Authority and its CRLs, and unreference any associated certificates?");?>')">
573
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete ca");?>" alt="<?=gettext("delete ca"); ?>" width="17" height="17" border="0" />
574
							</a>
575
						</td>
576
					</tr>
577
					<?php
578
							$i++;
579
						endforeach;
580
					?>
581
					<tr>
582
						<td class="list" colspan="5"></td>
583
						<td class="list">
584
							<a href="system_camanager.php?act=new">
585
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("add or import ca");?>" alt="<?=gettext("add ca");?>" width="17" height="17" border="0" />
586
							</a>
587
						</td>
588
					</tr>
589
					<tr>
590
						<td colspan="5">
591
							<p>
592
								<?=gettext("Additional trusted Certificate Authorities can be added here.");?>
593
							</p>
594
						</td>
595
					</tr>
596
				</table>
597

    
598
				<?php endif; ?>
599

    
600
			</div>
601
		</td>
602
	</tr>
603
</table>
604
<?php include("fend.inc");?>
605
<script type="text/javascript">
606
<!--
607

    
608
method_change();
609

    
610
//-->
611
</script>
612

    
613
</body>
(184-184/226)