Commit a039ad4d authored by Franco Fichtner's avatar Franco Fichtner

ipsec: fix widget count after 5.5.2 update

parent 0e9b8f16
......@@ -34,7 +34,6 @@ require_once("guiconfig.inc");
$ipsec_detail_array = array();
$ipsec_tunnels = array();
$ipsec_leases = array();
$activetunnels = 0;
if (isset($config['ipsec']['phase1'])) {
$ipsec_leases = json_decode(configd_run("ipsec list leases"), true);
......@@ -67,7 +66,6 @@ if (isset($config['ipsec']['phase1'])) {
}
if (isset($ipsec_tunnels[$child_sa_key])) {
$ipsec_tunnels[$child_sa_key]['active'] = true;
$activetunnels++;
}
}
}
......@@ -111,7 +109,15 @@ if (isset($config['ipsec']['phase2'])) {
</thead>
<tbody>
<tr>
<td><?= $activetunnels; ?></td>
<td>
<?php
$activetunnels = 0;
foreach ($ipsec_tunnels as $ipsec_key => $ipsec) {
$activetunnels += $ipsec['active'] === true;
}
echo $activetunnels;
?>
</td>
<td><?= (count($ipsec_tunnels) - $activetunnels); ?></td>
<td>
<?php
......
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