diff options
author | Matt Smith <mgsmith@netgate.com> | 2015-10-30 15:51:04 -0500 |
---|---|---|
committer | Matt Smith <mgsmith@netgate.com> | 2015-10-30 15:51:04 -0500 |
commit | 5897e4e397213cc25725e126989c31b8c67575b9 (patch) | |
tree | 40a122a24abc9e85f569a986b674bbe88026971b | |
parent | 9c56811ac69293f208904dcb79170b45d79581af (diff) | |
download | pfsense-5897e4e397213cc25725e126989c31b8c67575b9.zip pfsense-5897e4e397213cc25725e126989c31b8c67575b9.tar.gz |
Remove a redundant if and fix indentation accordingly. Fix is_array that should be an isset on the remote SPI field.
-rw-r--r-- | usr/local/www/diag_ipsec.php | 100 |
1 files changed, 49 insertions, 51 deletions
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(); </thead> <tbody> <?php - if (is_array($ikesa['child-sas'])) { - foreach ($ikesa['child-sas'] as $childid => $childsa) { + foreach ($ikesa['child-sas'] as $childid => $childsa) { ?> <tr valign="top"> <td class="listlr nowrap"> <?php - if (is_array($childsa['local-ts'])) { - foreach ($childsa['local-ts'] as $lnets) { - echo htmlspecialchars(ipsec_fixup_network($lnets)) . "<br />"; - } - } else { - echo gettext("Unknown"); + if (is_array($childsa['local-ts'])) { + foreach ($childsa['local-ts'] as $lnets) { + echo htmlspecialchars(ipsec_fixup_network($lnets)) . "<br />"; } + } else { + echo gettext("Unknown"); + } ?> </td> <td class="listr nowrap"> <?php - if (isset($childsa['spi-in'])) { - echo gettext("Local: ") . htmlspecialchars($childsa['spi-in']); - } - if (is_array($childsa['spi-out'])) { - echo "<br/>" . gettext("Remote: ") . htmlspecialchars($childsa['spi-out']); - } + if (isset($childsa['spi-in'])) { + echo gettext("Local: ") . htmlspecialchars($childsa['spi-in']); + } + if (isset($childsa['spi-out'])) { + echo "<br/>" . gettext("Remote: ") . htmlspecialchars($childsa['spi-out']); + } ?> </td> <td class="listr nowrap"> <?php - if (is_array($childsa['remote-ts'])) { - foreach ($childsa['remote-ts'] as $rnets) { - echo htmlspecialchars(ipsec_fixup_network($rnets)) . "<br />"; - } - } else { - echo gettext("Unknown"); + if (is_array($childsa['remote-ts'])) { + foreach ($childsa['remote-ts'] as $rnets) { + echo htmlspecialchars(ipsec_fixup_network($rnets)) . "<br />"; } + } else { + echo gettext("Unknown"); + } ?> </td> <td class="listr nowrap"> <?php - echo gettext("Rekey: ") . htmlspecialchars($childsa['rekey-time']) . gettext(" seconds"); - echo "<br/>" . gettext("Life: ") . htmlspecialchars($childsa['life-time']) . gettext(" seconds"); - echo "<br/>" . gettext("Install: ") .htmlspecialchars($childsa['install-time']) . gettext(" seconds"); + echo gettext("Rekey: ") . htmlspecialchars($childsa['rekey-time']) . gettext(" seconds"); + echo "<br/>" . gettext("Life: ") . htmlspecialchars($childsa['life-time']) . gettext(" seconds"); + echo "<br/>" . gettext("Install: ") .htmlspecialchars($childsa['install-time']) . gettext(" seconds"); ?> </td> <td class="listr nowrap"> <?php - echo htmlspecialchars($childsa['encr-alg']); + echo htmlspecialchars($childsa['encr-alg']); + echo "<br/>"; + echo htmlspecialchars($childsa['integ-alg']); + echo "<br/>"; + if (!empty($childsa['prf-alg'])) { + echo htmlspecialchars($childsa['prf-alg']); echo "<br/>"; - echo htmlspecialchars($childsa['integ-alg']); + } + if (!empty($childsa['dh-group'])) { + echo htmlspecialchars($childsa['dh-group']); + echo "<br/>"; + } + if (!empty($childsa['esn'])) { + echo htmlspecialchars($childsa['esn']); echo "<br/>"; - if (!empty($childsa['prf-alg'])) { - echo htmlspecialchars($childsa['prf-alg']); - echo "<br/>"; - } - if (!empty($childsa['dh-group'])) { - echo htmlspecialchars($childsa['dh-group']); - echo "<br/>"; - } - if (!empty($childsa['esn'])) { - echo htmlspecialchars($childsa['esn']); - echo "<br/>"; - } - 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"); + } ?> </td> <td class="listr nowrap"> <?php - echo gettext("Bytes-In: ") . htmlspecialchars($childsa['bytes-in']); - echo "<br/>"; - echo gettext("Packets-In: ") . htmlspecialchars($childsa['packets-in']); - echo "<br/>"; - echo gettext("Bytes-Out: ") . htmlspecialchars($childsa['bytes-out']); - echo "<br/>"; - echo gettext("Packets-Out: ") . htmlspecialchars($childsa['packets-out']); + echo gettext("Bytes-In: ") . htmlspecialchars($childsa['bytes-in']); + echo "<br/>"; + echo gettext("Packets-In: ") . htmlspecialchars($childsa['packets-in']); + echo "<br/>"; + echo gettext("Bytes-Out: ") . htmlspecialchars($childsa['bytes-out']); + echo "<br/>"; + echo gettext("Packets-Out: ") . htmlspecialchars($childsa['packets-out']); ?> </td> <td> @@ -422,7 +421,6 @@ $status = pfSense_ipsec_list_sa(); </tr> <?php } - } ?> <tr style="display:none;"><td></td></tr> </tbody> |