Commit d63f538f authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor diag_ipsec_spd.php

parent 0c031c25
...@@ -37,86 +37,67 @@ $shortcut_section = "ipsec"; ...@@ -37,86 +37,67 @@ $shortcut_section = "ipsec";
include("head.inc"); include("head.inc");
$spd = ipsec_dump_spd(); $spd = ipsec_dump_spd();
legacy_html_escape_form_data($spd);
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<section class="col-xs-12">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <? $active_tab = "/diag_ipsec_spd.php"; include('diag_ipsec_tabs.inc'); ?>
<section class="col-xs-12">
<? $active_tab = "/diag_ipsec_spd.php"; include('diag_ipsec_tabs.inc'); ?>
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table class="table table-striped">
<div class="table-responsive">
<table class="table table-striped table-sort __nomb">
<?php if (count($spd)): ?> <?php if (count($spd)): ?>
<tr> <tr>
<td class="listhdrr nowrap"><?= gettext("Source"); ?></td> <td><?= gettext("Source"); ?></td>
<td class="listhdrr nowrap"><?= gettext("Destination"); ?></td> <td><?= gettext("Destination"); ?></td>
<td class="listhdrr nowrap"><?= gettext("Direction"); ?></td> <td><?= gettext("Direction"); ?></td>
<td class="listhdrr nowrap"><?= gettext("Protocol"); ?></td> <td><?= gettext("Protocol"); ?></td>
<td class="listhdrr nowrap"><?= gettext("Tunnel endpoints"); ?></td> <td><?= gettext("Tunnel endpoints"); ?></td>
<td class="list nowrap"></td>
</tr> </tr>
<?php foreach ($spd as $sp): ?> <?php foreach ($spd as $sp): ?>
<tr> <tr>
<td class="listlr" valign="top"><?=htmlspecialchars($sp['srcid']);?></td> <td class="listlr" valign="top"><?=$sp['srcid'];?></td>
<td class="listr" valign="top"><?=htmlspecialchars($sp['dstid']);?></td> <td class="listr" valign="top"><?=$sp['dstid'];?></td>
<td class="listr" valign="top"> <span class="glyphicon glyphicon-arrow-<?php if($sp['dir'] == "in" ) echo "right"; else echo "left";?> aria-hidden="true"></span> <td class="listr" valign="top">
</td> <span class="glyphicon glyphicon-arrow-<?= $sp['dir'] == "in" ? "right" : "left";?>" aria-hidden="true"></span>
<td class="listr" valign="top"><?=htmlspecialchars(strtoupper($sp['proto']));?></td>
<td class="listr" valign="top"><?=htmlspecialchars($sp['src']);?> -> <?=htmlspecialchars($sp['dst']);?></td>
<td class="list nowrap">
<?php
$args = "srcid=".rawurlencode($sp['srcid']);
$args .= "&amp;dstid=".rawurlencode($sp['dstid']);
$args .= "&amp;dir=".rawurlencode($sp['dir']);
?>
</td> </td>
<td class="listr" valign="top"><?=strtoupper($sp['proto']);?></td>
<td class="listr" valign="top"><?=$sp['src'];?> -> <?=$sp['dst'];?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table>
<br />
<table class="tabcont" border="0" cellspacing="0" cellpadding="6" summary="policies">
<tr> <tr>
<td width="16"> <span class="glyphicon glyphicon-arrow-right" aria-hidden="true" alt="in"></span></td> <td colspan="2">
<td><?= gettext("incoming (as seen by firewall)"); ?></td> <span class="text-danger"><strong><?= gettext("Note:"); ?><br /></strong></span>
</tr> <?= gettext("You can configure your IPsec"); ?> <a href="vpn_ipsec.php"><?= gettext("here."); ?></a>
<tr> </td>
<td colspan="5" height="4"></td> <td colspan="3">
</tr> <span class="glyphicon glyphicon-arrow-right" aria-hidden="true" alt="in"></span>
<tr> <?= gettext("incoming (as seen by firewall)"); ?> <br/>
<td><span class="glyphicon glyphicon-arrow-left" aria-hidden="true" alt="out"></span></td> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true" alt="out"></span>
<td><?= gettext("outgoing (as seen by firewall)"); ?></td> <?= gettext("outgoing (as seen by firewall)"); ?>
</td>
</tr> </tr>
<?php else: ?> <?php else: ?>
<tr> <tr>
<td> <td colspan="5">
<p><strong><?= gettext("No IPsec security policies."); ?></strong></p> <p><strong><?= gettext("No IPsec security policies."); ?></strong></p>
</td> </td>
</tr> </tr>
<tr>
<td colspan="5">
<span class="text-danger"><strong><?= gettext("Note:"); ?><br /></strong></span>
<?= gettext("You can configure your IPsec"); ?> <a href="vpn_ipsec.php"><?= gettext("here."); ?></a>
</td>
</tr>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>
<div class="container-fluid">
<p class="vexpl">
<span class="text-danger"><strong><?= gettext("Note:"); ?><br /></strong></span>
<?= gettext("You can configure your IPsec"); ?> <a href="vpn_ipsec.php"><?= gettext("here."); ?></a>
</p>
</div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment