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 Rubicon Communications, LLC (Netgate)
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
	$class = "danger";
118
}
119

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

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

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

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

    
157
if ($act == "addcert") {
158
	if ($_POST) {
159
		unset($input_errors);
160
		$pconfig = $_POST;
161

    
162
		if (!$pconfig['crlref'] || !$pconfig['certref']) {
163
			pfSenseHeader("system_crlmanager.php");
164
			exit;
165
		}
166

    
167
		// certref, crlref
168
		$crl =& lookup_crl($pconfig['crlref']);
169
		$cert = lookup_cert($pconfig['certref']);
170

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

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

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

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

    
227
if ($_POST) {
228
	$input_errors = array();
229
	$pconfig = $_POST;
230

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

    
245
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
246

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

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

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

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

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

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

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

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

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

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

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

    
301
function method_change() {
302

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

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

    
317
//]]>
318
</script>
319

    
320
<?php
321

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

    
325
	$list = array();
326

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

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

    
335
	return($list);
336
}
337

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

    
341
	$list = array();
342

    
343
	foreach ($a_ca as $ca) {
344
		$list[$ca['refid']] = $ca['descr'];
345
	}
346

    
347
	return($list);
348
}
349

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

    
353
	$list = array();
354

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

    
359
	return($list);
360
}
361

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

    
366
if ($savemsg) {
367
	print_info_box($savemsg, $class);
368
}
369

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

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

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

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

    
389
	}
390

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

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

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

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

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

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

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

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

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

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

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

    
448
	print($form);
449

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

    
452
	$form = new Form();
453

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

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

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

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

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

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

    
485
	print($form);
486

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

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

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

    
543
	$ca_certs = array();
544
	foreach ($a_cert as $cert) {
545
		if ($cert['caref'] == $crl['caref'] && !is_cert_revoked($cert, $id)) {
546
			$ca_certs[] = $cert;
547
		}
548
	}
549

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

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

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

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

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

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

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

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

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

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

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

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

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

    
704

    
705
<?php
706
}
707
?>
708

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

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

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

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

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

    
(196-196/227)