Commit 8e3a78bc authored by Franco Fichtner's avatar Franco Fichtner

ipsec: fix a crash report in widget

Also inline the tab function while there.
parent 6acd4980
<?php <?php
/* /*
Copyright (C) 2014 Deciso B.V. Copyright (C) 2014 Deciso B.V.
Copyright (C) 2007 Scott Dale Copyright (C) 2007 Scott Dale
...@@ -32,9 +33,20 @@ $nocsrf = true; ...@@ -32,9 +33,20 @@ $nocsrf = true;
require_once("guiconfig.inc"); require_once("guiconfig.inc");
//function to create widget tabs when called $ipsec_detail_array = array();
function display_widget_tabs(& $tab_array) { $ipsec_tunnels = array();
$mobile = array();
if (isset($config['ipsec']['phase1'])) {
echo "<div>&nbsp;</div>\n";
$tab_array = array();
$tab_array[] = array(gettext("Overview"), true, "ipsec-Overview");
$tab_array[] = array(gettext("Tunnels"), false, "ipsec-tunnel");
$tab_array[] = array(gettext("Mobile"), false, "ipsec-mobile");
echo "<div id=\"tabs\">"; echo "<div id=\"tabs\">";
$tabscounter = 0; $tabscounter = 0;
foreach ($tab_array as $ta) { foreach ($tab_array as $ta) {
$dashpos = strpos($ta[2],'-'); $dashpos = strpos($ta[2],'-');
...@@ -58,23 +70,12 @@ function display_widget_tabs(& $tab_array) { ...@@ -58,23 +70,12 @@ function display_widget_tabs(& $tab_array) {
echo "&nbsp;&nbsp;&nbsp;</b>"; echo "&nbsp;&nbsp;&nbsp;</b>";
echo "</div>"; echo "</div>";
} }
}
$ipsec_detail_array = array();
if (isset($config['ipsec']['phase1'])) { // TODO: temporary disabled ( https://github.com/opnsense/core/issues/139 )
echo "<div>&nbsp;</div>\n"; //$mobile = ipsec_dump_mobile();
$tab_array = array();
$tab_array[0] = array(gettext("Overview"), true, "ipsec-Overview");
$tab_array[1] = array(gettext("Tunnels"), false, "ipsec-tunnel");
$tab_array[2] = array(gettext("Mobile"), false, "ipsec-mobile");
display_widget_tabs($tab_array);
// TODO: temporary disabled ( https://github.com/opnsense/core/issues/139 ) ipsec_dump_mobile();
$mobile = array();
// parse configured tunnels // parse configured tunnels
$ipsec_status = json_decode(configd_run("ipsec list_status"), true); $ipsec_status = json_decode(configd_run("ipsec list_status"), true);
$ipsec_tunnels = array();
$activetunnels = 0; $activetunnels = 0;
if ($ipsec_status != null) { if ($ipsec_status != null) {
foreach ($ipsec_status as $status_key => $status_value) { foreach ($ipsec_status as $status_key => $status_value) {
......
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