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
b5af0b45
Commit
b5af0b45
authored
Jan 19, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy/ipsec) re-add toggle feature, lost during cleanups
parent
a8982f02
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
vpn_ipsec.php
src/www/vpn_ipsec.php
+30
-4
No files found.
src/www/vpn_ipsec.php
View file @
b5af0b45
...
...
@@ -166,6 +166,30 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
header
(
"Location: vpn_ipsec.php"
);
exit
;
}
elseif
(
!
empty
(
$_POST
[
'act'
])
&&
$_POST
[
'act'
]
==
"togglep1"
&&
isset
(
$a_phase1
[
$_POST
[
'id'
]])
)
{
// toggle phase 1 record
if
(
isset
(
$a_phase1
[
$_POST
[
'id'
]][
'disabled'
]))
{
unset
(
$a_phase1
[
$_POST
[
'id'
]][
'disabled'
]);
}
else
{
$a_phase1
[
$_POST
[
'id'
]][
'disabled'
]
=
true
;
}
if
(
write_config
())
{
mark_subsystem_dirty
(
'ipsec'
);
}
header
(
"Location: vpn_ipsec.php"
);
exit
;
}
elseif
(
!
empty
(
$_POST
[
'act'
])
&&
$_POST
[
'act'
]
==
"togglep2"
&&
isset
(
$a_phase2
[
$_POST
[
'id'
]])
)
{
// toggle phase 2 record
if
(
isset
(
$a_phase2
[
$_POST
[
'id'
]][
'disabled'
]))
{
unset
(
$a_phase2
[
$_POST
[
'id'
]][
'disabled'
]);
}
else
{
$a_phase2
[
$_POST
[
'id'
]][
'disabled'
]
=
true
;
}
if
(
write_config
())
{
mark_subsystem_dirty
(
'ipsec'
);
}
header
(
"Location: vpn_ipsec.php"
);
exit
;
}
}
...
...
@@ -182,7 +206,7 @@ include("head.inc");
<body>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
// link move buttons (phase 1 and phase 2)
// link move
/toggle
buttons (phase 1 and phase 2)
$
(
"
.act_move
"
).
click
(
function
(
event
){
event
.
preventDefault
();
$
(
"
#id
"
).
val
(
$
(
this
).
data
(
"
id
"
));
...
...
@@ -190,6 +214,7 @@ $( document ).ready(function() {
$
(
"
#iform
"
).
submit
();
});
// link delete phase 1 buttons
$
(
"
.act_delete_p1
"
).
click
(
function
(
event
){
event
.
preventDefault
();
...
...
@@ -329,7 +354,8 @@ $( document ).ready(function() {
<
input
type
=
"checkbox"
name
=
"p1entry[]"
value
=
"<?=
$i
;?>"
/>
</
td
>
<
td
>
<
button
name
=
"toggle_<?=
$i
; ?>_x"
type
=
"submit"
class
="
btn
btn
-<?=
isset
(
$ph1ent
[
'disabled'
])
?
"default"
:
"success"
?>
btn-xs"
<
button
data
-
id
=
"<?=
$i
; ?>"
data
-
act
=
"togglep1"
type
=
"submit"
type
=
"submit"
class
="
act_move
btn
btn
-<?=
isset
(
$ph1ent
[
'disabled'
])
?
"default"
:
"success"
?>
btn-xs"
title="
<?=
(
isset
(
$ph1ent
[
'disabled'
]))
?
gettext
(
"enable phase 1 entry"
)
:
gettext
(
"disable phase 1 entry"
);
?>
" data-toggle="tooltip">
<span
class=
"glyphicon glyphicon-play"
></span>
</button>
...
...
@@ -488,9 +514,9 @@ $( document ).ready(function() {
<input
type=
"checkbox"
name=
"p2entry[]"
value=
"
<?=
$ph2index
;
?>
"
/>
</td>
<td>
<button
name=
"togglep2_
<?=
$ph2index
;
?>
_x
"
<button
data-id=
"
<?=
$ph2index
;
?>
"
data-act=
"togglep2"
type=
"submit
"
title=
"
<?=
(
isset
(
$ph2ent
[
'disabled'
]))
?
gettext
(
"enable phase 2 entry"
)
:
gettext
(
"disable phase 2 entry"
);
?>
"
data-toggle=
"tooltip"
type=
"submit"
class=
"
btn btn-
<?=
isset
(
$ph2ent
[
'disabled'
])
?
"default"
:
"success"
;
?>
btn-xs"
>
class=
"act_move
btn btn-
<?=
isset
(
$ph2ent
[
'disabled'
])
?
"default"
:
"success"
;
?>
btn-xs"
>
<span
class=
"glyphicon glyphicon-play"
></span>
</button>
</td>
...
...
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