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
e5a28134
Commit
e5a28134
authored
Nov 30, 2015
by
Ad Schellevis
Committed by
Franco Fichtner
Dec 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code style
(cherry picked from commit
7413cd78
)
parent
2da1e2f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
74 deletions
+60
-74
vpn_ipsec_phase2.php
src/www/vpn_ipsec_phase2.php
+60
-74
No files found.
src/www/vpn_ipsec_phase2.php
View file @
e5a28134
...
@@ -671,9 +671,9 @@ if (isset($input_errors) && count($input_errors) > 0) {
...
@@ -671,9 +671,9 @@ if (isset($input_errors) && count($input_errors) > 0) {
'transport'
=>
'Transport'
);
'transport'
=>
'Transport'
);
foreach
(
$p2_modes
as
$name
=>
$value
)
:
foreach
(
$p2_modes
as
$name
=>
$value
)
:
?>
?>
<option
value=
"
<?=
$name
;
<option
value=
"
<?=
$name
;
?>
"
?>
"
<?=
$name
==
$pconfig
[
'mode'
]
?
"selected=
\"
selected
\"
"
:
""
;
<?=
$name
==
$pconfig
[
'mode'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$value
;
?>
?>
>
<?=
$value
;
?>
</option>
</option>
<?php
<?php
endforeach
;
endforeach
;
?>
?>
...
@@ -701,14 +701,12 @@ if (isset($input_errors) && count($input_errors) > 0) {
...
@@ -701,14 +701,12 @@ if (isset($input_errors) && count($input_errors) > 0) {
<option
value=
"network"
<?=
$pconfig
[
'localid_type'
]
==
"network"
?
"selected=
\"
selected
\"
"
:
""
?>
>
<?=
gettext
(
"Network"
);
?>
</option>
<option
value=
"network"
<?=
$pconfig
[
'localid_type'
]
==
"network"
?
"selected=
\"
selected
\"
"
:
""
?>
>
<?=
gettext
(
"Network"
);
?>
</option>
<?php
<?php
$iflist
=
get_configured_interface_with_descr
();
$iflist
=
get_configured_interface_with_descr
();
foreach
(
$iflist
as
$ifname
=>
$ifdescr
)
:
foreach
(
$iflist
as
$ifname
=>
$ifdescr
)
:?>
?>
<
option
value
=
"<?=htmlspecialchars(
$ifname
);?>"
<?=
$pconfig
[
'localid_type'
]
==
$ifname
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<option
value=
"
<?=
htmlspecialchars
(
$ifname
);
<?=
sprintf
(
gettext
(
"%s subnet"
),
htmlspecialchars
(
$ifdescr
));
?>
?>
"
<?=
$pconfig
[
'localid_type'
]
==
$ifname
?
"selected=
\"
selected
\"
"
:
""
;
</option>
?>
>
<?=
sprintf
(
gettext
(
"%s subnet"
),
htmlspecialchars
(
$ifdescr
));
?>
</option>
<?php
<?php
endforeach
;
endforeach
;
?>
?>
</select>
</select>
</td>
</td>
</tr>
</tr>
...
@@ -720,12 +718,11 @@ endforeach;
...
@@ -720,12 +718,11 @@ endforeach;
<select
name=
"localid_netbits"
data-network-id=
"localid_address"
class=
"ipv4v6net"
id=
"localid_netbits"
>
<select
name=
"localid_netbits"
data-network-id=
"localid_address"
class=
"ipv4v6net"
id=
"localid_netbits"
>
<?php
for
(
$i
=
128
;
$i
>=
0
;
$i
--
)
:
<?php
for
(
$i
=
128
;
$i
>=
0
;
$i
--
)
:
?>
?>
<option
value=
"
<?=
$i
;
<option
value=
"
<?=
$i
;
?>
"
<?=
isset
(
$pconfig
[
'localid_netbits'
])
&&
$i
==
$pconfig
[
'localid_netbits'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
?>
"
<?=
isset
(
$pconfig
[
'localid_netbits'
])
&&
$i
==
$pconfig
[
'localid_netbits'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$i
;
?>
<?=
$i
;
?>
</option>
</option>
<?php
<?php
endfor
;
?>
endfor
;
?>
</select>
</select>
</td>
</td>
</tr>
</tr>
...
@@ -757,15 +754,13 @@ endfor; ?>
...
@@ -757,15 +754,13 @@ endfor; ?>
<input
name=
"natlocalid_address"
type=
"text"
class=
"formfld unknown ipv4v6"
id=
"natlocalid_address"
size=
"28"
value=
"
<?=
isset
(
$pconfig
[
'natlocalid_address'
])
?
$pconfig
[
'natlocalid_address'
]
:
""
;
?>
"
/>
<input
name=
"natlocalid_address"
type=
"text"
class=
"formfld unknown ipv4v6"
id=
"natlocalid_address"
size=
"28"
value=
"
<?=
isset
(
$pconfig
[
'natlocalid_address'
])
?
$pconfig
[
'natlocalid_address'
]
:
""
;
?>
"
/>
/
/
<select
name=
"natlocalid_netbits"
data-network-id=
"natlocalid_address"
class=
"formselect ipv4v6net"
id=
"natlocalid_netbits"
>
<select
name=
"natlocalid_netbits"
data-network-id=
"natlocalid_address"
class=
"formselect ipv4v6net"
id=
"natlocalid_netbits"
>
<?php
for
(
$i
=
128
;
$i
>=
0
;
$i
--
)
:
<?php
?>
for
(
$i
=
128
;
$i
>=
0
;
$i
--
)
:?>
<option
value=
"
<?=
$i
;
?>
"
<?php
if
(
isset
(
$pconfig
[
'natlocalid_netbits'
])
&&
$i
==
$pconfig
[
'natlocalid_netbits'
])
{
<
option
value
=
"<?=
$i
;?>"
<?=
isset
(
$pconfig
[
'natlocalid_netbits'
])
&&
$i
==
$pconfig
[
'natlocalid_netbits'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
echo
"selected=
\"
selected
\"
"
;
}
?>
>
<?=
$i
;
?>
<?=
$i
;
?>
</option>
</option>
<?php
<?php
endfor
;
?>
endfor
;
?>
</select>
</select>
</td>
</td>
</tr>
</tr>
...
@@ -796,8 +791,7 @@ endfor; ?>
...
@@ -796,8 +791,7 @@ endfor; ?>
<select
name=
"remoteid_netbits"
class=
"formselect ipv4v6"
id=
"remoteid_netbits"
>
<select
name=
"remoteid_netbits"
class=
"formselect ipv4v6"
id=
"remoteid_netbits"
>
<?php
for
(
$i
=
128
;
$i
>=
0
;
$i
--
)
:
<?php
for
(
$i
=
128
;
$i
>=
0
;
$i
--
)
:
?>
?>
<option
value=
"
<?=
$i
;
<option
value=
"
<?=
$i
;
?>
"
<?=
isset
(
$pconfig
[
'remoteid_netbits'
])
&&
$i
==
$pconfig
[
'remoteid_netbits'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
?>
"
<?=
isset
(
$pconfig
[
'remoteid_netbits'
])
&&
$i
==
$pconfig
[
'remoteid_netbits'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$i
;
?>
<?=
$i
;
?>
</option>
</option>
<?php
endfor
;
<?php
endfor
;
...
@@ -817,13 +811,12 @@ endif; ?>
...
@@ -817,13 +811,12 @@ endif; ?>
<td><a
id=
"help_for_proto"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Protocol"
);
?>
</td>
<td><a
id=
"help_for_proto"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Protocol"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<td
width=
"78%"
class=
"vtable"
>
<select
name=
"protocol"
id=
"proto"
class=
"formselect"
onchange=
"change_protocol()"
>
<select
name=
"protocol"
id=
"proto"
class=
"formselect"
onchange=
"change_protocol()"
>
<?php
<?php
foreach
(
array
(
'esp'
=>
'ESP'
,
'ah'
=>
'AH'
)
as
$proto
=>
$protoname
)
:
foreach
(
array
(
'esp'
=>
'ESP'
,
'ah'
=>
'AH'
)
as
$proto
=>
$protoname
)
:?>
?>
<
option
value
=
"<?=
$proto
;?>"
<?=
$proto
==
$pconfig
[
'protocol'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<
option
value
=
"<?=
$proto
;?>"
<?=
$proto
==
$pconfig
[
'protocol'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$protoname
;
?>
<?=
$protoname
;
?>
</option>
</option>
<?php
<?php
endforeach
;
?>
endforeach
;
?>
</select>
</select>
<br
/>
<br
/>
...
@@ -835,33 +828,29 @@ endif; ?>
...
@@ -835,33 +828,29 @@ endif; ?>
<tr
id=
"opt_enc"
>
<tr
id=
"opt_enc"
>
<td><a
id=
"help_for_encalg"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Encryption algorithms"
);
?>
</td>
<td><a
id=
"help_for_encalg"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Encryption algorithms"
);
?>
</td>
<td>
<td>
<?php
<?php
foreach
(
$p2_ealgos
as
$algo
=>
$algodata
)
:
foreach
(
$p2_ealgos
as
$algo
=>
$algodata
)
:?>
?>
<
input
type
=
"checkbox"
name
=
"ealgos[]"
value
=
"<?=
$algo
;?>"
<?=
isset
(
$pconfig
[
'ealgos'
])
&&
in_array
(
$algo
,
$pconfig
[
'ealgos'
])
?
"checked=
\"
checked
\"
"
:
""
;
?>
/>
<input
type=
"checkbox"
name=
"ealgos[]"
value=
"
<?=
$algo
;
?>
"
<?=
isset
(
$pconfig
[
'ealgos'
])
&&
in_array
(
$algo
,
$pconfig
[
'ealgos'
])
?
"checked=
\"
checked
\"
"
:
""
;
?>
/>
<?=
$algodata
[
'name'
];
?>
<?=
$algodata
[
'name'
];
?>
<?php
if
(
isset
(
$algodata
[
'keysel'
]))
:
<?php
?>
if
(
isset
(
$algodata
[
'keysel'
]))
:
?>
<
select
name
=
"keylen_<?=
$algo
;?>"
class
="
formselect
">
<
select
name
=
"keylen_<?=
$algo
;?>"
class
="
formselect
">
<option value="
auto
"><?=gettext("
auto
"); ?></option>
<option value="
auto
"><?=gettext("
auto
"); ?></option>
<?php
<?php
for
(
$keylen
=
$algodata
[
'keysel'
][
'hi'
];
$keylen
>=
$algodata
[
'keysel'
][
'lo'
];
$keylen
-=
$algodata
[
'keysel'
][
'step'
])
:
for (
$keylen
=
$algodata['keysel']['hi']
;
$keylen
>=
$algodata['keysel']['lo']
;
$keylen
-=
$algodata['keysel']['step']
) :?>
?>
<option value="
<?=
$keylen
;
?>
"
<?=
$keylen
==
$pconfig
[
"keylen_"
.
$algo
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<option
value=
"
<?=
$keylen
;
<?=
$keylen
;
?>
<?=
gettext
(
"bits"
);
?>
?>
"
<?=
$keylen
==
$pconfig
[
"keylen_"
.
$algo
]
?
"selected=
\"
selected
\"
"
:
""
;
</option>
?>
>
<?=
$keylen
;
<?php
?>
<?=
gettext
(
"bits"
);
?>
</option>
<?php
endfor
;
?>
endfor
;
?>
</select>
</select>
<?php
<?php
else
:?>
else
:?>
<
br
/>
<
br
/>
<?
php
<?
php
endif
;
?>
endif
;
?>
<?php
<?php
endforeach
;
?>
endforeach
;
?>
<div
class=
"hidden"
for=
"help_for_encalg"
>
<div
class=
"hidden"
for=
"help_for_encalg"
>
...
@@ -874,34 +863,31 @@ endif; ?>
...
@@ -874,34 +863,31 @@ endif; ?>
<tr>
<tr>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"Hash algorithms"
);
?>
</td>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"Hash algorithms"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<td
width=
"78%"
class=
"vtable"
>
<?php
foreach
(
$p2_halgos
as
$algo
=>
$algoname
)
:
<?php
?>
foreach
(
$p2_halgos
as
$algo
=>
$algoname
)
:?>
<input
type=
"checkbox"
name=
"hash-algorithm-option[]"
value=
"
<?=
$algo
;
<
input
type
=
"checkbox"
name
=
"hash-algorithm-option[]"
value
=
"<?=
$algo
;?>"
<?=
isset
(
$pconfig
[
'hash-algorithm-option'
])
&&
in_array
(
$algo
,
$pconfig
[
'hash-algorithm-option'
])
?
'checked="checked"'
:
''
;
?>
/>
?>
"
<?=
isset
(
$pconfig
[
'hash-algorithm-option'
])
&&
in_array
(
$algo
,
$pconfig
[
'hash-algorithm-option'
])
?
'checked="checked"'
:
''
;
?>
/>
<?=
$algoname
;
?>
<?=
$algoname
;
?>
</br>
</br>
<?php
<?php
endforeach
;
?>
endforeach
;
?>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"PFS key group"
);
?>
</td>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"PFS key group"
);
?>
</td>
<td>
<td>
<?php
if
(
!
isset
(
$pconfig
[
'mobile'
])
||
!
isset
(
$config
[
'ipsec'
][
'client'
][
'pfs_group'
]))
:
<?php
?>
if
(
!
isset
(
$pconfig
[
'mobile'
])
||
!
isset
(
$config
[
'ipsec'
][
'client'
][
'pfs_group'
]))
:
?>
<
select
name
=
"pfsgroup"
>
<
select
name
=
"pfsgroup"
>
<?php
foreach
(
$p2_pfskeygroups
as
$keygroup
=>
$keygroupname
)
:
<?
php
?>
foreach
(
$p2_pfskeygroups
as
$keygroup
=>
$keygroupname
)
:?>
<option
value=
"
<?=
$keygroup
;
<
option
value
=
"<?=
$keygroup
;?>"
<?=
$keygroup
==
$pconfig
[
'pfsgroup'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
?>
"
<?=
$keygroup
==
$pconfig
[
'pfsgroup'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$keygroupname
;
?>
<?=
$keygroupname
;
?>
</option>
</option>
<?php
<?php
endforeach
;
?>
endforeach
;
?>
</select>
</select>
<?php
<?php
else
:
else
:?>
?>
<
select
disabled
=
"disabled"
>
<
select
disabled
=
"disabled"
>
<
option
selected
=
"selected"
><?=
$p2_pfskeygroups
[
$config
[
'ipsec'
][
'client'
][
'pfs_group'
]];
?>
</option>
<
option
selected
=
"selected"
><?=
$p2_pfskeygroups
[
$config
[
'ipsec'
][
'client'
][
'pfs_group'
]];
?>
</option>
</select>
</select>
...
@@ -909,7 +895,7 @@ else :
...
@@ -909,7 +895,7 @@ else :
<br
/>
<br
/>
<em>
<?=
gettext
(
"Set globally in mobile client options"
);
?>
</em>
<em>
<?=
gettext
(
"Set globally in mobile client options"
);
?>
</em>
<?php
<?php
endif
;
?>
endif
;
?>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
...
...
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