From 5897e4e397213cc25725e126989c31b8c67575b9 Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Fri, 30 Oct 2015 15:51:04 -0500 Subject: Remove a redundant if and fix indentation accordingly. Fix is_array that should be an isset on the remote SPI field. --- usr/local/www/diag_ipsec.php | 100 +++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 51 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 2a0262e..528dc4e 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -328,85 +328,84 @@ $status = pfSense_ipsec_list_sa(); $childsa) { + foreach ($ikesa['child-sas'] as $childid => $childsa) { ?> "; - } - } else { - echo gettext("Unknown"); + if (is_array($childsa['local-ts'])) { + foreach ($childsa['local-ts'] as $lnets) { + echo htmlspecialchars(ipsec_fixup_network($lnets)) . "
"; } + } else { + echo gettext("Unknown"); + } ?> " . gettext("Remote: ") . htmlspecialchars($childsa['spi-out']); - } + if (isset($childsa['spi-in'])) { + echo gettext("Local: ") . htmlspecialchars($childsa['spi-in']); + } + if (isset($childsa['spi-out'])) { + echo "
" . gettext("Remote: ") . htmlspecialchars($childsa['spi-out']); + } ?> "; - } - } else { - echo gettext("Unknown"); + if (is_array($childsa['remote-ts'])) { + foreach ($childsa['remote-ts'] as $rnets) { + echo htmlspecialchars(ipsec_fixup_network($rnets)) . "
"; } + } else { + echo gettext("Unknown"); + } ?> " . gettext("Life: ") . htmlspecialchars($childsa['life-time']) . gettext(" seconds"); - echo "
" . gettext("Install: ") .htmlspecialchars($childsa['install-time']) . gettext(" seconds"); + echo gettext("Rekey: ") . htmlspecialchars($childsa['rekey-time']) . gettext(" seconds"); + echo "
" . gettext("Life: ") . htmlspecialchars($childsa['life-time']) . gettext(" seconds"); + echo "
" . gettext("Install: ") .htmlspecialchars($childsa['install-time']) . gettext(" seconds"); ?> "; + echo htmlspecialchars($childsa['integ-alg']); + echo "
"; + if (!empty($childsa['prf-alg'])) { + echo htmlspecialchars($childsa['prf-alg']); echo "
"; - echo htmlspecialchars($childsa['integ-alg']); + } + if (!empty($childsa['dh-group'])) { + echo htmlspecialchars($childsa['dh-group']); + echo "
"; + } + if (!empty($childsa['esn'])) { + echo htmlspecialchars($childsa['esn']); echo "
"; - if (!empty($childsa['prf-alg'])) { - echo htmlspecialchars($childsa['prf-alg']); - echo "
"; - } - if (!empty($childsa['dh-group'])) { - echo htmlspecialchars($childsa['dh-group']); - echo "
"; - } - if (!empty($childsa['esn'])) { - echo htmlspecialchars($childsa['esn']); - echo "
"; - } - echo gettext("IPComp: "); - if (!empty($childsa['cpi-in']) || !empty($childsa['cpi-out'])) { - echo htmlspecialchars($childsa['cpi-in']) . " " . htmlspecialchars($childsa['cpi-out']); - } else { - echo gettext("none"); - } + } + echo gettext("IPComp: "); + if (!empty($childsa['cpi-in']) || !empty($childsa['cpi-out'])) { + echo htmlspecialchars($childsa['cpi-in']) . " " . htmlspecialchars($childsa['cpi-out']); + } else { + echo gettext("none"); + } ?> "; - echo gettext("Packets-In: ") . htmlspecialchars($childsa['packets-in']); - echo "
"; - echo gettext("Bytes-Out: ") . htmlspecialchars($childsa['bytes-out']); - echo "
"; - echo gettext("Packets-Out: ") . htmlspecialchars($childsa['packets-out']); + echo gettext("Bytes-In: ") . htmlspecialchars($childsa['bytes-in']); + echo "
"; + echo gettext("Packets-In: ") . htmlspecialchars($childsa['packets-in']); + echo "
"; + echo gettext("Bytes-Out: ") . htmlspecialchars($childsa['bytes-out']); + echo "
"; + echo gettext("Packets-Out: ") . htmlspecialchars($childsa['packets-out']); ?> @@ -422,7 +421,6 @@ $status = pfSense_ipsec_list_sa(); -- cgit v1.1