Project

General

Profile

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

    
54
##|+PRIV
55
##|*IDENT=page-system-crlmanager
56
##|*NAME=System: CRL Manager
57
##|*DESCR=Allow access to the 'System: CRL Manager' page.
58
##|*MATCH=system_crlmanager.php*
59
##|-PRIV
60

    
61
require_once("guiconfig.inc");
62
require_once("certs.inc");
63
require_once("openvpn.inc");
64
require_once("vpn.inc");
65

    
66
global $openssl_crl_status;
67

    
68
$crl_methods = array(
69
	"internal" => gettext("Create an internal Certificate Revocation List"),
70
	"existing" => gettext("Import an existing Certificate Revocation List"));
71

    
72
if (ctype_alnum($_GET['id'])) {
73
	$id = $_GET['id'];
74
}
75
if (isset($_POST['id']) && ctype_alnum($_POST['id'])) {
76
	$id = $_POST['id'];
77
}
78

    
79
if (!is_array($config['ca'])) {
80
	$config['ca'] = array();
81
}
82

    
83
$a_ca =& $config['ca'];
84

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

    
89
$a_cert =& $config['cert'];
90

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

    
95
$a_crl =& $config['crl'];
96

    
97
foreach ($a_crl as $cid => $acrl) {
98
	if (!isset($acrl['refid'])) {
99
		unset ($a_crl[$cid]);
100
	}
101
}
102

    
103
$act = $_GET['act'];
104
if ($_POST['act']) {
105
	$act = $_POST['act'];
106
}
107

    
108
if (!empty($id)) {
109
	$thiscrl =& lookup_crl($id);
110
}
111

    
112
// If we were given an invalid crlref in the id, no sense in continuing as it would only cause errors.
113
if (!$thiscrl && (($act != "") && ($act != "new"))) {
114
	pfSenseHeader("system_crlmanager.php");
115
	$act="";
116
	$savemsg = gettext("Invalid CRL reference.");
117
}
118

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

    
134
if ($act == "new") {
135
	$pconfig['method'] = $_GET['method'];
136
	$pconfig['caref'] = $_GET['caref'];
137
	$pconfig['lifetime'] = "9999";
138
	$pconfig['serial'] = "0";
139
}
140

    
141
if ($act == "exp") {
142
	crl_update($thiscrl);
143
	$exp_name = urlencode("{$thiscrl['descr']}.crl");
144
	$exp_data = base64_decode($thiscrl['text']);
145
	$exp_size = strlen($exp_data);
146

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

    
154
if ($act == "addcert") {
155
	if ($_POST) {
156
		unset($input_errors);
157
		$pconfig = $_POST;
158

    
159
		if (!$pconfig['crlref'] || !$pconfig['certref']) {
160
			pfSenseHeader("system_crlmanager.php");
161
			exit;
162
		}
163

    
164
		// certref, crlref
165
		$crl =& lookup_crl($pconfig['crlref']);
166
		$cert = lookup_cert($pconfig['certref']);
167

    
168
		if (!$crl['caref'] || !$cert['caref']) {
169
			$input_errors[] = gettext("Both the Certificate and CRL must be specified.");
170
		}
171

    
172
		if ($crl['caref'] != $cert['caref']) {
173
			$input_errors[] = gettext("CA mismatch between the Certificate and CRL. Unable to Revoke.");
174
		}
175
		if (!is_crl_internal($crl)) {
176
			$input_errors[] = gettext("Cannot revoke certificates for an imported/external CRL.");
177
		}
178

    
179
		if (!$input_errors) {
180
			$reason = (empty($pconfig['crlreason'])) ? OCSP_REVOKED_STATUS_UNSPECIFIED : $pconfig['crlreason'];
181
			cert_revoke($cert, $crl, $reason);
182
			// refresh IPsec and OpenVPN CRLs
183
			openvpn_refresh_crls();
184
			vpn_ipsec_configure();
185
			write_config("Revoked cert {$cert['descr']} in CRL {$crl['descr']}.");
186
			pfSenseHeader("system_crlmanager.php");
187
			exit;
188
		}
189
	}
190
}
191

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

    
222
if ($_POST) {
223
	$input_errors = array();
224
	$pconfig = $_POST;
225

    
226
	/* input validation */
227
	if (($pconfig['method'] == "existing") || ($act == "editimported")) {
228
		$reqdfields = explode(" ", "descr crltext");
229
		$reqdfieldsn = array(
230
			gettext("Descriptive name"),
231
			gettext("Certificate Revocation List data"));
232
	}
233
	if ($pconfig['method'] == "internal") {
234
		$reqdfields = explode(" ", "descr caref");
235
		$reqdfieldsn = array(
236
			gettext("Descriptive name"),
237
			gettext("Certificate Authority"));
238
	}
239

    
240
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
241

    
242
	if (preg_match("/[\?\>\<\&\/\\\"\']/", $pconfig['descr'])) {
243
		array_push($input_errors, "The field 'Descriptive Name' contains invalid characters.");
244
	}
245

    
246
	/* if this is an AJAX caller then handle via JSON */
247
	if (isAjax() && is_array($input_errors)) {
248
		input_errors2Ajax($input_errors);
249
		exit;
250
	}
251

    
252
	/* save modifications */
253
	if (!$input_errors) {
254
		$result = false;
255

    
256
		if ($thiscrl) {
257
			$crl =& $thiscrl;
258
		} else {
259
			$crl = array();
260
			$crl['refid'] = uniqid();
261
		}
262

    
263
		$crl['descr'] = $pconfig['descr'];
264
		if ($act != "editimported") {
265
			$crl['caref'] = $pconfig['caref'];
266
			$crl['method'] = $pconfig['method'];
267
		}
268

    
269
		if (($pconfig['method'] == "existing") || ($act == "editimported")) {
270
			$crl['text'] = base64_encode($pconfig['crltext']);
271
		}
272

    
273
		if ($pconfig['method'] == "internal") {
274
			$crl['serial'] = empty($pconfig['serial']) ? 9999 : $pconfig['serial'];
275
			$crl['lifetime'] = empty($pconfig['lifetime']) ? 9999 : $pconfig['lifetime'];
276
			$crl['cert'] = array();
277
		}
278

    
279
		if (!$thiscrl) {
280
			$a_crl[] = $crl;
281
		}
282

    
283
		write_config("Saved CRL {$crl['descr']}");
284
		// refresh IPsec and OpenVPN CRLs
285
		openvpn_refresh_crls();
286
		vpn_ipsec_configure();
287
		pfSenseHeader("system_crlmanager.php");
288
	}
289
}
290

    
291
$pgtitle = array(gettext("System"), gettext("Certificate Manager"), gettext("Certificate Revocation"));
292

    
293
if ($act == "new" || $act == gettext("Save") || $input_errors || $act == "edit") {
294
	$pgtitle[] = gettext('Edit');
295
}
296
include("head.inc");
297
?>
298

    
299
<script type="text/javascript">
300
//<![CDATA[
301

    
302
function method_change() {
303

    
304
	method = document.iform.method.value;
305

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

    
318
//]]>
319
</script>
320

    
321
<?php
322

    
323
function build_method_list() {
324
	global $_GET, $crl_methods;
325

    
326
	$list = array();
327

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

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

    
336
	return($list);
337
}
338

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

    
342
	$list = array();
343

    
344
	foreach ($a_ca as $ca) {
345
		$list[$ca['refid']] = $ca['descr'];
346
	}
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

    
360
	return($list);
361
}
362

    
363
if ($input_errors) {
364
	print_input_errors($input_errors);
365
}
366

    
367
if ($savemsg) {
368
	print_info_box($savemsg, 'success');
369
}
370

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

    
377
if ($act == "new" || $act == gettext("Save") || $input_errors) {
378
	if (!isset($id)) {
379
		$form = new Form();
380

    
381
		$section = new Form_Section('Create new Revocation List');
382

    
383
		$section->addInput(new Form_Select(
384
			'method',
385
			'Method',
386
			$pconfig['method'],
387
			build_method_list()
388
		));
389

    
390
	}
391

    
392
	$section->addInput(new Form_Input(
393
		'descr',
394
		'Descriptive name',
395
		'text',
396
		$pconfig['descr']
397
	));
398

    
399
	$section->addInput(new Form_Select(
400
		'caref',
401
		'Certificate Authority',
402
		$pconfig['caref'],
403
		build_ca_list()
404
	));
405

    
406
	$form->add($section);
407

    
408
	$section = new Form_Section('Existing Certificate Revocation List');
409
	$section->addClass('existing');
410

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

    
417
	$form->add($section);
418

    
419
	$section = new Form_Section('Internal Certificate Revocation List');
420
	$section->addClass('internal');
421

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

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

    
438
	$form->add($section);
439

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

    
449
	print($form);
450

    
451
} elseif ($act == "editimported") {
452

    
453
	$form = new Form();
454

    
455
	$section = new Form_Section('Edit Imported Certificate Revocation List');
456

    
457
	$section->addInput(new Form_Input(
458
		'descr',
459
		'Descriptive name',
460
		'text',
461
		$pconfig['descr']
462
	));
463

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

    
470
	$section->addInput(new Form_Input(
471
		'id',
472
		null,
473
		'hidden',
474
		$id
475
	));
476

    
477
	$section->addInput(new Form_Input(
478
		'act',
479
		null,
480
		'hidden',
481
		'editimported'
482
	));
483

    
484
	$form->add($section);
485

    
486
	print($form);
487

    
488
} elseif ($act == "edit") {
489
	$crl = $thiscrl;
490

    
491
	$form = new Form(false);
492
?>
493

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

    
544
	$ca_certs = array();
545
	foreach ($a_cert as $cert) {
546
		if ($cert['caref'] == $crl['caref']) {
547
			$ca_certs[] = $cert;
548
		}
549
	}
550

    
551
	if (count($ca_certs) == 0) {
552
		print_info_box(gettext("No certificates found for this CA."), 'danger');
553
	} else {
554
		$section = new Form_Section('Choose a Certificate to Revoke');
555
		$group = new Form_Group(null);
556

    
557
		$group->add(new Form_Select(
558
			'certref',
559
			null,
560
			$pconfig['certref'],
561
			build_cacert_list()
562
			))->setWidth(4)->setHelp('Certificate');
563

    
564
		$group->add(new Form_Select(
565
			'crlreason',
566
			null,
567
			-1,
568
			$openssl_crl_status
569
			))->setHelp('Reason');
570

    
571
		$group->add(new Form_Button(
572
			'submit',
573
			'Add',
574
			null,
575
			'fa-plus'
576
			))->addClass('btn-success btn-sm');
577

    
578
		$section->add($group);
579

    
580
		$section->addInput(new Form_Input(
581
			'id',
582
			null,
583
			'hidden',
584
			$crl['refid']
585
		));
586

    
587
		$section->addInput(new Form_Input(
588
			'act',
589
			null,
590
			'hidden',
591
			'addcert'
592
		));
593

    
594
		$section->addInput(new Form_Input(
595
			'crlref',
596
			null,
597
			'hidden',
598
			$crl['refid']
599
		));
600

    
601
		$form->add($section);
602
	}
603

    
604
	print($form);
605
} else {
606
?>
607

    
608
	<div class="panel panel-default">
609
		<div class="panel-heading"><h2 class="panel-title"><?=gettext("Additional Certificate Revocation Lists")?></h2></div>
610
		<div class="panel-body table-responsive">
611
			<table class="table table-striped table-hover table-condensed table-rowdblclickedit">
612
				<thead>
613
					<tr>
614
						<th><?=gettext("Name")?></th>
615
						<th><?=gettext("Internal")?></th>
616
						<th><?=gettext("Certificates")?></th>
617
						<th><?=gettext("In Use")?></th>
618
						<th><?=gettext("Actions")?></th>
619
					</tr>
620
				</thead>
621
				<tbody>
622
<?php
623
	// Map CRLs to CAs in one pass
624
	$ca_crl_map = array();
625
	foreach ($a_crl as $crl) {
626
		$ca_crl_map[$crl['caref']][] = $crl['refid'];
627
	}
628

    
629
	$i = 0;
630
	foreach ($a_ca as $ca):
631
		$name = htmlspecialchars($ca['descr']);
632

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

    
705

    
706
<?php
707
}
708
?>
709

    
710
<script>
711
//<![CDATA[
712
events.push(function() {
713

    
714
	// Hides all elements of the specified class. This will usually be a section or group
715
	function hideClass(s_class, hide) {
716
		if (hide) {
717
			$('.' + s_class).hide();
718
		} else {
719
			$('.' + s_class).show();
720
		}
721
	}
722

    
723
	// When the 'method" selector is changed, we show/hide certain sections
724
	$('#method').on('change', function() {
725
		hideClass('internal', ($('#method').val() == 'existing'));
726
		hideClass('existing', ($('#method').val() == 'internal'));
727
	});
728

    
729
	hideClass('internal', ($('#method').val() == 'existing'));
730
	hideClass('existing', ($('#method').val() == 'internal'));
731
});
732
//]]>
733
</script>
734

    
735
<?php include("foot.inc");
736

    
(196-196/227)