Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
8e3a78bc
Commit
8e3a78bc
authored
Nov 19, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipsec: fix a crash report in widget
Also inline the tab function while there.
parent
6acd4980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
ipsec.widget.php
src/www/widgets/widgets/ipsec.widget.php
+16
-15
No files found.
src/www/widgets/widgets/ipsec.widget.php
View file @
8e3a78bc
<?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> </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
" </b>"
;
echo
" </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> </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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment