Revision c86c14dc
Added by Phil Davis over 9 years ago
src/usr/local/www/vpn_ipsec.php | ||
---|---|---|
314 | 314 |
</td> |
315 | 315 |
<td onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>"> |
316 | 316 |
<?php |
317 |
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1") |
|
317 |
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1") {
|
|
318 | 318 |
echo "V1"; |
319 |
else
|
|
319 |
} else {
|
|
320 | 320 |
echo "V2"; |
321 |
} |
|
321 | 322 |
?> |
322 | 323 |
</td> |
323 | 324 |
<td> |
... | ... | |
326 | 327 |
$iflabels = get_configured_interface_with_descr(); |
327 | 328 |
|
328 | 329 |
$carplist = get_configured_carp_interface_list(); |
329 |
foreach ($carplist as $cif => $carpip) |
|
330 |
foreach ($carplist as $cif => $carpip) {
|
|
330 | 331 |
$iflabels[$cif] = $carpip." (".get_vip_descr($carpip).")"; |
332 |
} |
|
331 | 333 |
|
332 | 334 |
$aliaslist = get_configured_ip_aliases_list(); |
333 |
foreach ($aliaslist as $aliasip => $aliasif) |
|
335 |
foreach ($aliaslist as $aliasip => $aliasif) {
|
|
334 | 336 |
$iflabels[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")"; |
337 |
} |
|
335 | 338 |
|
336 | 339 |
$grouplist = return_gateway_groups_array(); |
337 | 340 |
foreach ($grouplist as $name => $group) { |
338 |
if($group[0]['vip'] != "")
|
|
341 |
if ($group[0]['vip'] != "") {
|
|
339 | 342 |
$vipif = $group[0]['vip']; |
340 |
else
|
|
343 |
} else {
|
|
341 | 344 |
$vipif = $group[0]['int']; |
345 |
} |
|
342 | 346 |
$iflabels[$name] = "GW Group {$name}"; |
343 | 347 |
} |
344 | 348 |
$if = htmlspecialchars($iflabels[$ph1ent['interface']]); |
345 |
} |
|
346 |
else |
|
349 |
} else { |
|
347 | 350 |
$if = "WAN"; |
351 |
} |
|
348 | 352 |
|
349 |
if (!isset($ph1ent['mobile'])) |
|
353 |
if (!isset($ph1ent['mobile'])) {
|
|
350 | 354 |
echo $if."<br />".$ph1ent['remote-gateway']; |
351 |
else
|
|
355 |
} else {
|
|
352 | 356 |
echo $if."<br /><strong>" . gettext("Mobile Client") . "</strong>"; |
357 |
} |
|
353 | 358 |
?> |
354 | 359 |
</td> |
355 | 360 |
<td onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>"> |
356 | 361 |
<?=$spans?> |
357 | 362 |
<?php |
358 |
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1") |
|
363 |
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1") {
|
|
359 | 364 |
echo "{$ph1ent['mode']}"; |
365 |
} |
|
360 | 366 |
?> |
361 | 367 |
<?=$spane?> |
362 | 368 |
</td> |
... | ... | |
364 | 370 |
<?=$p1_ealgos[$ph1ent['encryption-algorithm']['name']]['name']?> |
365 | 371 |
<?php |
366 | 372 |
if ($ph1ent['encryption-algorithm']['keylen']) { |
367 |
if ($ph1ent['encryption-algorithm']['keylen']=="auto")
|
|
373 |
if ($ph1ent['encryption-algorithm']['keylen'] == "auto") {
|
|
368 | 374 |
echo " (" . gettext("auto") . ")"; |
369 |
else
|
|
375 |
} else {
|
|
370 | 376 |
echo " ({$ph1ent['encryption-algorithm']['keylen']} " . gettext("bits") . ")"; |
377 |
} |
|
371 | 378 |
} |
372 | 379 |
?> |
373 | 380 |
</td> |
... | ... | |
393 | 400 |
<td colspan="2"></td> |
394 | 401 |
<td colspan="7" class="contains-table"> |
395 | 402 |
<?php |
396 |
if (isset($_POST["tdph2-{$i}-visible"])) |
|
403 |
if (isset($_POST["tdph2-{$i}-visible"])) {
|
|
397 | 404 |
$tdph2_visible = htmlspecialchars($_POST["tdph2-{$i}-visible"]); |
398 |
else
|
|
405 |
} else {
|
|
399 | 406 |
$tdph2_visible = 0; |
407 |
} |
|
400 | 408 |
?> |
401 | 409 |
<input type="hidden" name="tdph2-<?=$i?>-visible" id="tdph2-<?=$i?>-visible" value="<?=$tdph2_visible?>" /> |
402 | 410 |
<div id="shph2but-<?=$i?>" <?=($tdph2_visible == '1' ? 'style="display:none"' : '')?>> |
... | ... | |
404 | 412 |
$phase2count=0; |
405 | 413 |
|
406 | 414 |
foreach ($a_phase2 as $ph2ent) { |
407 |
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) |
|
415 |
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) {
|
|
408 | 416 |
continue; |
417 |
} |
|
409 | 418 |
$phase2count++; |
410 | 419 |
} |
411 | 420 |
$fr_prefix = "frp2{$i}"; |
... | ... | |
431 | 440 |
<tbody class="p2-entries"> |
432 | 441 |
<?php $j = 0; foreach ($a_phase2 as $ph2index => $ph2ent): ?> |
433 | 442 |
<?php |
434 |
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) |
|
443 |
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) {
|
|
435 | 444 |
continue; |
445 |
} |
|
436 | 446 |
|
437 | 447 |
$fr_c = $fr_prefix . "c" . $j; |
438 | 448 |
$fr_d = $fr_prefix . "d" . $j; |
... | ... | |
440 | 450 |
$iconfn = "pass"; |
441 | 451 |
$entryStatus = (isset($ph2ent['disabled']) || isset($ph1ent['disabled']) ? 'disabled' : 'enabled'); |
442 | 452 |
|
443 |
if ($entryStatus == 'disabled') |
|
453 |
if ($entryStatus == 'disabled') {
|
|
444 | 454 |
$iconfn .= "_d"; |
445 |
|
|
455 |
} |
|
446 | 456 |
?> |
447 | 457 |
<tr id="<?=$fr_prefix . $j?>" ondblclick="document.location='vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid']?>'" class="<?= $entryStatus ?>"> |
448 | 458 |
<td> |
... | ... | |
455 | 465 |
<td id="<?=$fr_d?>" onclick="fr_toggle('<?=$j?>', '<?=$fr_prefix?>')"> |
456 | 466 |
<?=$ph2ent['mode']?> |
457 | 467 |
</td> |
458 |
<?php if(($ph2ent['mode'] == "tunnel") or ($ph2ent['mode'] == "tunnel6")): ?> |
|
468 |
<?php if (($ph2ent['mode'] == "tunnel") or ($ph2ent['mode'] == "tunnel6")): ?>
|
|
459 | 469 |
<td id="<?=$fr_d?>" onclick="fr_toggle('<?=$j?>', '<?=$fr_prefix?>')"> |
460 | 470 |
<?=ipsec_idinfo_to_text($ph2ent['localid']); ?> |
461 | 471 |
</td> |
... | ... | |
471 | 481 |
<td id="<?=$fr_d?>" onclick="fr_toggle('<?=$j?>', '<?=$fr_prefix?>')"> |
472 | 482 |
<?php |
473 | 483 |
foreach ($ph2ent['encryption-algorithm-option'] as $k => $ph2ea) { |
474 |
if ($k) |
|
484 |
if ($k) {
|
|
475 | 485 |
echo ", "; |
486 |
} |
|
476 | 487 |
echo $p2_ealgos[$ph2ea['name']]['name']; |
477 | 488 |
if ($ph2ea['keylen']) { |
478 |
if ($ph2ea['keylen']=="auto")
|
|
489 |
if ($ph2ea['keylen'] == "auto") {
|
|
479 | 490 |
echo " (" . gettext("auto") . ")"; |
480 |
else
|
|
491 |
} else {
|
|
481 | 492 |
echo " ({$ph2ea['keylen']} " . gettext("bits") . ")"; |
493 |
} |
|
482 | 494 |
} |
483 | 495 |
} |
484 | 496 |
?> |
... | ... | |
487 | 499 |
<?php |
488 | 500 |
if (!empty($ph2ent['hash-algorithm-option']) && is_array($ph2ent['hash-algorithm-option'])) { |
489 | 501 |
foreach ($ph2ent['hash-algorithm-option'] as $k => $ph2ha) { |
490 |
if ($k) |
|
502 |
if ($k) {
|
|
491 | 503 |
echo ", "; |
504 |
} |
|
492 | 505 |
echo $p2_halgos[$ph2ha]; |
493 | 506 |
} |
494 | 507 |
} |
... | ... | |
570 | 583 |
}); |
571 | 584 |
|
572 | 585 |
$('[id^=Xdel_]').click(function (event) { |
573 |
if(confirm("<?=gettext('Are you sure you wish to delete this P1 entry?')?>")) { |
|
586 |
if (confirm("<?=gettext('Are you sure you wish to delete this P1 entry?')?>")) {
|
|
574 | 587 |
$('#' + event.target.id.slice(1)).click(); |
575 | 588 |
} |
576 | 589 |
}); |
577 | 590 |
|
578 | 591 |
$('[id^=Xdelp2_]').click(function (event) { |
579 |
if(confirm("<?=gettext('Are you sure you wish to delete this P2 entry?')?>")) { |
|
592 |
if (confirm("<?=gettext('Are you sure you wish to delete this P2 entry?')?>")) {
|
|
580 | 593 |
$('#' + event.target.id.slice(1)).click(); |
581 | 594 |
} |
582 | 595 |
}); |
Also available in: Unified diff
Code style v w