Project

General

Profile

Download (17.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	system_crlmanager.php
4
*/
5
/* ====================================================================
6
 *	Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *	Redistribution and use in source and binary forms, with or without modification,
9
 *	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
16
 *		the documentation and/or other materials provided with the
17
 *		distribution.
18
 *
19
 *	3. All advertising materials mentioning features or use of this software
20
 *		must display the following acknowledgment:
21
 *		"This product includes software developed by the pfSense Project
22
 *		 for use in the pfSense software distribution. (http://www.pfsense.org/).
23
 *
24
 *	4. The names "pfSense" and "pfSense Project" must not be used to
25
 *		 endorse or promote products derived from this software without
26
 *		 prior written permission. For written permission, please contact
27
 *		 coreteam@pfsense.org.
28
 *
29
 *	5. Products derived from this software may not be called "pfSense"
30
 *		nor may "pfSense" appear in their names without prior written
31
 *		permission of the Electric Sheep Fencing, LLC.
32
 *
33
 *	6. Redistributions of any form whatsoever must retain the following
34
 *		acknowledgment:
35
 *
36
 *	"This product includes software developed by the pfSense Project
37
 *	for use in the pfSense software distribution (http://www.pfsense.org/).
38
 *
39
 *	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
40
 *	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41
 *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
 *	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
43
 *	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44
 *	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45
 *	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46
 *	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48
 *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49
 *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50
 *	OF THE POSSIBILITY OF SUCH DAMAGE.
51
 *
52
 *	====================================================================
53
 *
54
 */
55
/*
56
	pfSense_MODULE: certificate_manager
57
*/
58

    
59
##|+PRIV
60
##|*IDENT=page-system-crlmanager
61
##|*NAME=System: CRL Manager
62
##|*DESCR=Allow access to the 'System: CRL Manager' page.
63
##|*MATCH=system_crlmanager.php*
64
##|-PRIV
65

    
66
require("guiconfig.inc");
67
require_once("certs.inc");
68
require_once("openvpn.inc");
69
require_once("vpn.inc");
70

    
71
global $openssl_crl_status;
72

    
73
$pgtitle = array(gettext("System"), gettext("Certificate Manager"), gettext("Certificate Revocation Lists"));
74

    
75
$crl_methods = array(
76
	"internal" => gettext("Create an internal Certificate Revocation List"),
77
	"existing" => gettext("Import an existing Certificate Revocation List"));
78

    
79
if (ctype_alnum($_GET['id'])) {
80
	$id = $_GET['id'];
81
}
82
if (isset($_POST['id']) && ctype_alnum($_POST['id'])) {
83
	$id = $_POST['id'];
84
}
85

    
86
if (!is_array($config['ca'])) {
87
	$config['ca'] = array();
88
}
89

    
90
$a_ca =& $config['ca'];
91

    
92
if (!is_array($config['cert'])) {
93
	$config['cert'] = array();
94
}
95

    
96
$a_cert =& $config['cert'];
97

    
98
if (!is_array($config['crl'])) {
99
	$config['crl'] = array();
100
}
101

    
102
$a_crl =& $config['crl'];
103

    
104
foreach ($a_crl as $cid => $acrl) {
105
	if (!isset($acrl['refid'])) {
106
		unset ($a_crl[$cid]);
107
	}
108
}
109

    
110
$act = $_GET['act'];
111
if ($_POST['act']) {
112
	$act = $_POST['act'];
113
}
114

    
115
if (!empty($id)) {
116
	$thiscrl =& lookup_crl($id);
117
}
118

    
119
// If we were given an invalid crlref in the id, no sense in continuing as it would only cause errors.
120
if (!$thiscrl && (($act != "") && ($act != "new"))) {
121
	pfSenseHeader("system_crlmanager.php");
122
	$act="";
123
	$savemsg = gettext("Invalid CRL reference.");
124
}
125

    
126
if ($act == "del") {
127
	$name = htmlspecialchars($thiscrl['descr']);
128
	if (crl_in_use($id)) {
129
		$savemsg = sprintf(gettext("Certificate Revocation List %s is in use and cannot be deleted"), $name) . "<br />";
130
	} else {
131
		foreach ($a_crl as $cid => $acrl) {
132
			if ($acrl['refid'] == $thiscrl['refid']) {
133
				unset($a_crl[$cid]);
134
			}
135
		}
136
		write_config("Deleted CRL {$name}.");
137
		$savemsg = sprintf(gettext("Certificate Revocation List %s successfully deleted"), $name) . "<br />";
138
	}
139
}
140

    
141
if ($act == "new") {
142
	$pconfig['method'] = $_GET['method'];
143
	$pconfig['caref'] = $_GET['caref'];
144
	$pconfig['lifetime'] = "9999";
145
	$pconfig['serial'] = "0";
146
}
147

    
148
if ($act == "exp") {
149
	crl_update($thiscrl);
150
	$exp_name = urlencode("{$thiscrl['descr']}.crl");
151
	$exp_data = base64_decode($thiscrl['text']);
152
	$exp_size = strlen($exp_data);
153

    
154
	header("Content-Type: application/octet-stream");
155
	header("Content-Disposition: attachment; filename={$exp_name}");
156
	header("Content-Length: $exp_size");
157
	echo $exp_data;
158
	exit;
159
}
160

    
161
if ($act == "addcert") {
162
	if ($_POST) {
163
		unset($input_errors);
164
		$pconfig = $_POST;
165

    
166
		if (!$pconfig['crlref'] || !$pconfig['certref']) {
167
			pfSenseHeader("system_crlmanager.php");
168
			exit;
169
		}
170

    
171
		// certref, crlref
172
		$crl =& lookup_crl($pconfig['crlref']);
173
		$cert = lookup_cert($pconfig['certref']);
174

    
175
		if (!$crl['caref'] || !$cert['caref']) {
176
			$input_errors[] = gettext("Both the Certificate and CRL must be specified.");
177
		}
178

    
179
		if ($crl['caref'] != $cert['caref']) {
180
			$input_errors[] = gettext("CA mismatch between the Certificate and CRL. Unable to Revoke.");
181
		}
182
		if (!is_crl_internal($crl)) {
183
			$input_errors[] = gettext("Cannot revoke certificates for an imported/external CRL.");
184
		}
185

    
186
		if (!$input_errors) {
187
			$reason = (empty($pconfig['crlreason'])) ? OCSP_REVOKED_STATUS_UNSPECIFIED : $pconfig['crlreason'];
188
			cert_revoke($cert, $crl, $reason);
189
			// refresh IPsec and OpenVPN CRLs
190
			openvpn_refresh_crls();
191
			vpn_ipsec_configure();
192
			write_config("Revoked cert {$cert['descr']} in CRL {$crl['descr']}.");
193
			pfSenseHeader("system_crlmanager.php");
194
			exit;
195
		}
196
	}
197
}
198

    
199
if ($act == "delcert") {
200
	if (!is_array($thiscrl['cert'])) {
201
		pfSenseHeader("system_crlmanager.php");
202
		exit;
203
	}
204
	$found = false;
205
	foreach ($thiscrl['cert'] as $acert) {
206
		if ($acert['refid'] == $_GET['certref']) {
207
			$found = true;
208
			$thiscert = $acert;
209
		}
210
	}
211
	if (!$found) {
212
		pfSenseHeader("system_crlmanager.php");
213
		exit;
214
	}
215
	$certname = htmlspecialchars($thiscert['descr']);
216
	$crlname = htmlspecialchars($thiscrl['descr']);
217
	if (cert_unrevoke($thiscert, $thiscrl)) {
218
		$savemsg = sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname) . "<br />";
219
		// refresh IPsec and OpenVPN CRLs
220
		openvpn_refresh_crls();
221
		vpn_ipsec_configure();
222
		write_config(sprintf(gettext("Deleted Certificate %s from CRL %s"), $certname, $crlname));
223
	} else {
224
		$savemsg = sprintf(gettext("Failed to delete Certificate %s from CRL %s"), $certname, $crlname) . "<br />";
225
	}
226
	$act="edit";
227
}
228

    
229
if ($_POST) {
230
	$input_errors = array();
231
	$pconfig = $_POST;
232

    
233
	/* input validation */
234
	if (($pconfig['method'] == "existing") || ($act == "editimported")) {
235
		$reqdfields = explode(" ", "descr crltext");
236
		$reqdfieldsn = array(
237
			gettext("Descriptive name"),
238
			gettext("Certificate Revocation List data"));
239
	}
240
	if ($pconfig['method'] == "internal") {
241
		$reqdfields = explode(" ", "descr caref");
242
		$reqdfieldsn = array(
243
			gettext("Descriptive name"),
244
			gettext("Certificate Authority"));
245
	}
246

    
247
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
248

    
249
	if (preg_match("/[\?\>\<\&\/\\\"\']/", $pconfig['descr'])) {
250
		array_push($input_errors, "The field 'Descriptive Name' contains invalid characters.");
251
	}
252

    
253
	/* if this is an AJAX caller then handle via JSON */
254
	if (isAjax() && is_array($input_errors)) {
255
		input_errors2Ajax($input_errors);
256
		exit;
257
	}
258

    
259
	/* save modifications */
260
	if (!$input_errors) {
261
		$result = false;
262

    
263
		if ($thiscrl) {
264
			$crl =& $thiscrl;
265
		} else {
266
			$crl = array();
267
			$crl['refid'] = uniqid();
268
		}
269

    
270
		$crl['descr'] = $pconfig['descr'];
271
		if ($act != "editimported") {
272
			$crl['caref'] = $pconfig['caref'];
273
			$crl['method'] = $pconfig['method'];
274
		}
275

    
276
		if (($pconfig['method'] == "existing") || ($act == "editimported")) {
277
			$crl['text'] = base64_encode($pconfig['crltext']);
278
		}
279

    
280
		if ($pconfig['method'] == "internal") {
281
			$crl['serial'] = empty($pconfig['serial']) ? 9999 : $pconfig['serial'];
282
			$crl['lifetime'] = empty($pconfig['lifetime']) ? 9999 : $pconfig['lifetime'];
283
			$crl['cert'] = array();
284
		}
285

    
286
		if (!$thiscrl) {
287
			$a_crl[] = $crl;
288
		}
289

    
290
		write_config("Saved CRL {$crl['descr']}");
291
		// refresh IPsec and OpenVPN CRLs
292
		openvpn_refresh_crls();
293
		vpn_ipsec_configure();
294
		pfSenseHeader("system_crlmanager.php");
295
	}
296
}
297

    
298
include("head.inc");
299
?>
300

    
301
<script type="text/javascript">
302
//<![CDATA[
303

    
304
function method_change() {
305

    
306
	method = document.iform.method.value;
307

    
308
	switch (method) {
309
		case "internal":
310
			document.getElementById("existing").style.display="none";
311
			document.getElementById("internal").style.display="";
312
			break;
313
		case "existing":
314
			document.getElementById("existing").style.display="";
315
			document.getElementById("internal").style.display="none";
316
			break;
317
	}
318
}
319

    
320
//]]>
321
</script>
322

    
323
<?php
324

    
325
function build_method_list() {
326
	global $_GET, $crl_methods;
327

    
328
	$list = array();
329

    
330
	foreach($crl_methods as $method => $desc) {
331
		if (($_GET['importonly'] == "yes") && ($method != "existing"))
332
			continue;
333

    
334
		$list[$method] = $desc;
335
	}
336

    
337
	return($list);
338
}
339

    
340
function build_ca_list() {
341
	global $a_ca;
342

    
343
	$list = array();
344

    
345
	foreach($a_ca as $ca)
346
		$list[$ca['refid']] = $ca['descr'];
347

    
348
	return($list);
349
}
350

    
351
function build_cacert_list() {
352
	global $ca_certs;
353

    
354
	$list = array();
355

    
356
	foreach($ca_certs as $cert)
357
		$list[$cert['refid']] = $cert['descr'];
358

    
359
	return($list);
360
}
361

    
362
if ($input_errors)
363
	print_input_errors($input_errors);
364

    
365
if ($savemsg)
366
	print_info_box($savemsg, 'sucess');
367

    
368
$tab_array = array();
369
$tab_array[] = array(gettext("CAs"), false, "system_camanager.php");
370
$tab_array[] = array(gettext("Certificates"), false, "system_certmanager.php");
371
$tab_array[] = array(gettext("Certificate Revocation"), true, "system_crlmanager.php");
372
display_top_tabs($tab_array);
373

    
374
if ($act == "new" || $act == gettext("Save") || $input_errors) {
375
	if (!isset($id)) {
376
		$form = new Form();
377

    
378
		$section = new Form_Section('Create new revocation list');
379

    
380
		$section->addInput(new Form_Select(
381
			'method',
382
			'Method',
383
			$pconfig['method'],
384
			build_method_list()
385
		));
386

    
387
	}
388

    
389
	$section->addInput(new Form_Input(
390
		'descr',
391
		'Descriptive name',
392
		'text',
393
		$pconfig['descr']
394
	));
395

    
396
	$section->addInput(new Form_Select(
397
		'caref',
398
		'Certificate Authority',
399
		$pconfig['caref'],
400
		build_ca_list()
401
	));
402

    
403
	$form->add($section);
404

    
405
	$section = new Form_Section('Existing Certificate Revocation List');
406
	$section->addClass('existing');
407

    
408
	$section->addInput(new Form_Textarea(
409
		'crltext',
410
		'CRL data',
411
		$pconfig['crltext']
412
		))->setHelp('Paste a Certificate Revocation List in X.509 CRL format here.');
413

    
414
	$form->add($section);
415

    
416
	$section = new Form_Section('Internal Certificate Revocation List');
417
	$section->addClass('internal');
418

    
419
	$section->addInput(new Form_Input(
420
		'lifetime',
421
		'Lifetime (Days)',
422
		'number',
423
		$pconfig['lifetime'],
424
		[max => '9999']
425
	));
426

    
427
	$section->addInput(new Form_Input(
428
		'serial',
429
		'Serial',
430
		'number',
431
		$pconfig['serial'],
432
		[min => '0', max => '9999']
433
	));
434

    
435
	$form->add($section);
436

    
437
	if (isset($id) && $thiscrl) {
438
		$section->addInput(new Form_Input(
439
			'id',
440
			null,
441
			'hidden',
442
			$id
443
		));
444
	}
445

    
446
	print($form);
447

    
448
} elseif ($act == "editimported") {
449

    
450
	$form = new Form();
451

    
452
	$section = new Form_Section('Edit Imported Certificate Revocation List');
453

    
454
	$section->addInput(new Form_Input(
455
		'descr',
456
		'Descriptive name',
457
		'text',
458
		$pconfig['descr']
459
	));
460

    
461
	$section->addInput(new Form_Textarea(
462
		'crltext',
463
		'CRL data',
464
		$pconfig['crltext']
465
	))->setHelp('Paste a Certificate Revocation List in X.509 CRL format here.');
466

    
467
	$section->addInput(new Form_Input(
468
		'id',
469
		null,
470
		'hidden',
471
		$id
472
	));
473

    
474
	$section->addInput(new Form_Input(
475
		'act',
476
		null,
477
		'hidden',
478
		'editimported'
479
	));
480

    
481
	$form->add($section);
482

    
483
	print($form);
484

    
485
} elseif ($act == "edit") {
486
	$crl = $thiscrl;
487

    
488
	$form = new Form(false);
489
?>
490

    
491
	<div class="panel panel-default">
492
		<div class="panel-heading"><h2 class="panel-title"><?=gettext("Currently Revoked Certificates for CRL") . ': ' . $crl['descr']?></h2></div>
493
		<div class="panel-body table-responsive">
494
<?php
495
	if (!is_array($crl['cert']) || (count($crl['cert']) == 0))
496
		print_info_box(gettext("No Certificates Found for this CRL."), 'danger');
497
	else {
498
?>
499
			<table class="table table-striped table-hover table-condensed">
500
				<thead>
501
					<tr>
502
						<th><?=gettext("Certificate Name")?></th>
503
						<th><?=gettext("Revocation Reason")?></th>
504
						<th><?=gettext("Revoked At")?></th>
505
						<th></th>
506
					</tr>
507
				</thead>
508
				<tbody>
509
<?php
510
		foreach($crl['cert'] as $i => $cert):
511
			$name = htmlspecialchars($cert['descr']);
512
?>
513
					<tr>
514
						<td class="listlr">
515
							<?=$name; ?>
516
						</td>
517
						<td class="listlr">
518
							<?=$openssl_crl_status[$cert["reason"]]; ?>
519
						</td>
520
						<td class="listlr">
521
							<?=date("D M j G:i:s T Y", $cert["revoke_time"]); ?>
522
						</td>
523
						<td class="list">
524
							<a href="system_crlmanager.php?act=delcert&amp;id=<?=$crl['refid']; ?>&amp;certref=<?=$cert['refid']; ?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate from the CRL?")?>')">
525
								<i class="fa fa-times-circle" title="<?=gettext("Delete this certificate from the CRL ")?>" alt="<?=gettext("Delete this certificate from the CRL ")?>"></i>
526
							</a>
527
						</td>
528
					</tr>
529
<?php
530
		endforeach;
531
?>
532
				</tbody>
533
			</table>
534
<?php } ?>
535
		</div>
536
	</div>
537
<?php
538

    
539
	$ca_certs = array();
540
	foreach($a_cert as $cert)
541
		if ($cert['caref'] == $crl['caref'])
542
			$ca_certs[] = $cert;
543

    
544
	if (count($ca_certs) == 0)
545
		print_info_box(gettext("No Certificates Found for this CA."), 'danger');
546
	else
547

    
548
	$section = new Form_Section('Choose a certificate to revoke');
549
	$group = new Form_Group(null);
550

    
551
	$group->add(new Form_Select(
552
		'certref',
553
		null,
554
		$pconfig['certref'],
555
		build_cacert_list()
556
		))->setWidth(4)->setHelp('Certificate');
557

    
558
	$group->add(new Form_Select(
559
		'crlreason',
560
		null,
561
		-1,
562
		$openssl_crl_status
563
		))->setHelp('Reason');
564

    
565
	$group->add(new Form_Button(
566
		'submit',
567
		'Add'
568
		))->removeClass('btn-primary')->addClass('btn-success btn-sm');
569

    
570
	$section->add($group);
571

    
572
	$section->addInput(new Form_Input(
573
		'id',
574
		null,
575
		'hidden',
576
		$crl['refid']
577
	));
578

    
579
	$section->addInput(new Form_Input(
580
		'act',
581
		null,
582
		'hidden',
583
		'addcert'
584
	));
585

    
586
	$section->addInput(new Form_Input(
587
		'crlref',
588
		null,
589
		'hidden',
590
		$crl['refid']
591
	));
592

    
593
	$form->add($section);
594
	print($form);
595
} else {
596
?>
597

    
598
	<div class="panel panel-default">
599
		<div class="panel-heading"><h2 class="panel-title"><?=gettext("Additional Certificate Revocation Lists")?></h2></div>
600
		<div class="panel-body table-responsive">
601
			<table class="table table-striped table-hover table-condensed">
602
				<thead>
603
					<tr>
604
						<th><?=gettext("Name")?></th>
605
						<th><?=gettext("Internal")?></th>
606
						<th><?=gettext("Certificates")?></th>
607
						<th><?=gettext("In Use")?></th>
608
						<th></th>
609
					</tr>
610
				</thead>
611
				<tbody>
612
<?php
613
	// Map CRLs to CAs in one pass
614
	$ca_crl_map = array();
615
	foreach($a_crl as $crl)
616
		$ca_crl_map[$crl['caref']][] = $crl['refid'];
617

    
618
	$i = 0;
619
	foreach($a_ca as $ca):
620
		$name = htmlspecialchars($ca['descr']);
621

    
622
		if($ca['prv']) {
623
			$cainternal = "YES";
624
		} else
625
			$cainternal = "NO";
626
?>
627
					<tr>
628
						<td colspan="4">
629
							<?=$name?>
630
						</td>
631
						<td>
632
<?php
633
		if ($cainternal == "YES"): ?>
634
							<a href="system_crlmanager.php?act=new&amp;caref=<?=$ca['refid']; ?>" class="btn btn-xs btn-success">
635
								<?=gettext("Add or Import CRL")?>
636
							</a>
637
<?php
638
		else: ?>
639
							<a href="system_crlmanager.php?act=new&amp;caref=<?=$ca['refid']; ?>&amp;importonly=yes" class="btn btn-xs btn-success">
640
								<?=gettext("Add or Import CRL")?>
641
							</a>
642
<?php
643
		endif; ?>
644
						</td>
645
					</tr>
646
<?php
647
		if (is_array($ca_crl_map[$ca['refid']])):
648
			foreach($ca_crl_map[$ca['refid']] as $crl):
649
				$tmpcrl = lookup_crl($crl);
650
				$internal = is_crl_internal($tmpcrl);
651
				$inuse = crl_in_use($tmpcrl['refid']);
652
?>
653
					<tr>
654
						<td><?=$tmpcrl['descr']; ?></td>
655
						<td><?=($internal) ? "YES" : "NO"; ?></td>
656
						<td><?=($internal) ? count($tmpcrl['cert']) : "Unknown (imported)"; ?></td>
657
						<td><?=($inuse) ? "YES" : "NO"; ?></td>
658
						<td>
659
							<a href="system_crlmanager.php?act=exp&amp;id=<?=$tmpcrl['refid']?>" class="btn btn-xs btn-success">
660
								<?=gettext("Export CRL")?>
661
							</a>
662
<?php
663
				if ($internal): ?>
664
							<a href="system_crlmanager.php?act=edit&amp;id=<?=$tmpcrl['refid']?>" class="btn btn-xs btn-info">
665
								<?=gettext("Edit CRL")?>
666
							</a>
667
<?php
668
				else: ?>
669
							<a href="system_crlmanager.php?act=editimported&amp;id=<?=$tmpcrl['refid']?>" class="btn btn-xs btn-info">
670
								<?=gettext("Edit CRL")?>
671
							</a>
672
<?php			endif;
673
				if (!$inuse): ?>
674
							<a href="system_crlmanager.php?act=del&amp;id=<?=$tmpcrl['refid']?>" class="btn btn-xs btn-danger">
675
								<?=gettext("Delete CRL")?>
676
							</a>
677
<?php
678
				endif; ?>
679
						</td>
680
					</tr>
681
<?php
682
				$i++;
683
				endforeach;
684
			endif;
685
			$i++;
686
		endforeach;
687
?>
688
				</tbody>
689
			</table>
690
		</div>
691
	</div>
692

    
693

    
694
<?php
695
}
696
?>
697

    
698
<script>
699
//<![CDATA[
700
events.push(function(){
701

    
702
	// Hides all elements of the specified class. This will usually be a section or group
703
	function hideClass(s_class, hide) {
704
		if(hide)
705
			$('.' + s_class).hide();
706
		else
707
			$('.' + s_class).show();
708
	}
709

    
710
	// When the 'method" selector is changed, we show/hide certain sections
711
	$('#method').on('change', function() {
712
		hideClass('internal', ($('#method').val() == 'existing'));
713
		hideClass('existing', ($('#method').val() == 'internal'));
714
	});
715

    
716
	hideClass('internal', ($('#method').val() == 'existing'));
717
	hideClass('existing', ($('#method').val() == 'internal'));
718
});
719
//]]>
720
</script>
721

    
722
<?php include("foot.inc");
723

    
(196-196/228)