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
b0aa1be3
Commit
b0aa1be3
authored
Jul 22, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
www: more cleanups possible for #1733
parent
8ad27fbe
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
43 additions
and
180 deletions
+43
-180
carp_status.php
src/www/carp_status.php
+0
-4
diag_logs_filter.php
src/www/diag_logs_filter.php
+8
-24
firewall_aliases_import.php
src/www/firewall_aliases_import.php
+1
-6
index.php
src/www/index.php
+2
-4
interfaces_bridge_edit.php
src/www/interfaces_bridge_edit.php
+0
-7
services_dhcp.php
src/www/services_dhcp.php
+1
-12
services_dhcp_edit.php
src/www/services_dhcp_edit.php
+2
-9
services_dhcpv6.php
src/www/services_dhcpv6.php
+1
-6
services_dhcpv6_edit.php
src/www/services_dhcpv6_edit.php
+4
-9
services_dnsmasq.php
src/www/services_dnsmasq.php
+2
-7
services_ntpd_gps.php
src/www/services_ntpd_gps.php
+1
-3
services_ntpd_pps.php
src/www/services_ntpd_pps.php
+1
-6
services_opendns.php
src/www/services_opendns.php
+1
-3
services_router_advertisements.php
src/www/services_router_advertisements.php
+1
-3
services_unbound_advanced.php
src/www/services_unbound_advanced.php
+1
-3
services_unbound_overrides.php
src/www/services_unbound_overrides.php
+2
-4
system_authservers.php
src/www/system_authservers.php
+3
-7
system_gateways.php
src/www/system_gateways.php
+0
-6
system_gateways_edit.php
src/www/system_gateways_edit.php
+0
-7
vpn_ipsec_keys.php
src/www/vpn_ipsec_keys.php
+2
-9
vpn_ipsec_keys_edit.php
src/www/vpn_ipsec_keys_edit.php
+2
-9
vpn_ipsec_mobile.php
src/www/vpn_ipsec_mobile.php
+2
-11
vpn_ipsec_phase2.php
src/www/vpn_ipsec_phase2.php
+2
-11
vpn_ipsec_settings.php
src/www/vpn_ipsec_settings.php
+1
-3
carp_status.widget.php
src/www/widgets/widgets/carp_status.widget.php
+1
-3
thermal_sensors.widget.php
src/www/widgets/widgets/thermal_sensors.widget.php
+2
-4
No files found.
src/www/carp_status.php
View file @
b0aa1be3
...
...
@@ -30,10 +30,6 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"interfaces.inc"
);
// init $config['virtualip']['vip']
if
(
!
isset
(
$config
[
'virtualip'
][
'vip'
])
||
!
is_array
(
$config
[
'virtualip'
][
'vip'
]))
{
$config
[
'virtualip'
][
'vip'
]
=
array
();
}
$a_vip
=
&
config_read_array
(
'virtualip'
,
'vip'
);
$act
=
null
;
...
...
src/www/diag_logs_filter.php
View file @
b0aa1be3
...
...
@@ -100,8 +100,8 @@ function easyrule_block_rule_exists($int = 'wan', $ipproto = "inet") {
return
false
;
}
function
easyrule_block_rule_create
(
$int
=
'wan'
,
$ipproto
=
"inet"
)
{
global
$config
;
function
easyrule_block_rule_create
(
$int
=
'wan'
,
$ipproto
=
"inet"
)
{
$blockaliasname
=
'EasyRuleBlockHosts'
;
/* If the alias doesn't exist, exit.
* Can't create an empty alias, and we don't know a host */
...
...
@@ -114,13 +114,9 @@ function easyrule_block_rule_create($int = 'wan', $ipproto = "inet") {
return
true
;
}
/* No rules, start a new array */
if
(
!
is_array
(
$config
[
'filter'
][
'rule'
]))
{
$config
[
'filter'
][
'rule'
]
=
array
();
}
$a_filter
=
&
config_read_array
(
'filter'
,
'rule'
);
filter_rules_sort
();
$a_filter
=
&
config_read_array
(
'filter'
,
'rule'
);
/* Make up a new rule */
$filterent
=
array
();
...
...
@@ -157,8 +153,8 @@ function easyrule_block_alias_getid($int = 'wan')
return
false
;
}
function
easyrule_block_alias_add
(
$host
,
$int
=
'wan'
)
{
global
$config
;
function
easyrule_block_alias_add
(
$host
,
$int
=
'wan'
)
{
$blockaliasname
=
'EasyRuleBlockHosts'
;
/* If the host isn't a valid IP address, bail */
$host
=
trim
(
$host
,
"[]"
);
...
...
@@ -166,13 +162,6 @@ function easyrule_block_alias_add($host, $int = 'wan') {
return
false
;
}
/* If there are no aliases, start an array */
if
(
!
isset
(
$config
[
'aliases'
])
||
!
is_array
(
$config
[
'aliases'
]))
{
$config
[
'aliases'
]
=
array
();
}
if
(
!
isset
(
$config
[
'aliases'
][
'alias'
]))
{
$config
[
'aliases'
][
'alias'
]
=
array
();
}
$a_aliases
=
&
config_read_array
(
'aliases'
,
'alias'
);
/* Try to get the ID if the alias already exists */
...
...
@@ -269,16 +258,11 @@ function easyrule_block_host_add($host, $int = 'wan', $ipproto = "inet") {
}
}
function
easyrule_pass_rule_add
(
$int
,
$proto
,
$srchost
,
$dsthost
,
$dstport
,
$ipproto
)
{
global
$config
;
/* No rules, start a new array */
if
(
!
isset
(
$config
[
'filter'
][
'rule'
]))
{
$config
[
'filter'
][
'rule'
]
=
array
();
}
function
easyrule_pass_rule_add
(
$int
,
$proto
,
$srchost
,
$dsthost
,
$dstport
,
$ipproto
)
{
$a_filter
=
&
config_read_array
(
'filter'
,
'rule'
);
filter_rules_sort
();
$a_filter
=
&
config_read_array
(
'filter'
,
'rule'
);
/* Make up a new rule */
$filterent
=
array
();
...
...
src/www/firewall_aliases_import.php
View file @
b0aa1be3
...
...
@@ -29,12 +29,7 @@
require_once
(
"guiconfig.inc"
);
if
(
!
isset
(
$config
[
'aliases'
])
||
!
is_array
(
$config
[
'aliases'
]))
{
$config
[
'aliases'
]
=
array
();
}
if
(
!
isset
(
$config
[
'aliases'
][
'alias'
]))
{
$config
[
'aliases'
][
'alias'
]
=
array
();
}
config_read_array
(
'aliases'
,
'alias'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
// initialize form vars
...
...
src/www/index.php
View file @
b0aa1be3
...
...
@@ -37,10 +37,8 @@ if (isset($_REQUEST['closenotice'])) {
exit
;
}
##if no config entry found, initialize config entry
if
(
empty
(
$config
[
'widgets'
])
||
!
is_array
(
$config
[
'widgets'
]))
{
$config
[
'widgets'
]
=
array
();
}
// if no config entry found, initialize config entry
config_read_array
(
'widgets'
);
$widgetCollection
=
array
();
...
...
src/www/interfaces_bridge_edit.php
View file @
b0aa1be3
...
...
@@ -32,13 +32,6 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"services.inc"
);
if
(
!
isset
(
$config
[
'bridges'
])
||
!
is_array
(
$config
[
'bridges'
]))
{
$config
[
'bridges'
]
=
array
();
}
if
(
!
isset
(
$config
[
'bridges'
][
'bridged'
])
||
!
is_array
(
$config
[
'bridges'
][
'bridged'
]))
{
$config
[
'bridges'
][
'bridged'
]
=
array
();
}
$a_bridges
=
&
config_read_array
(
'bridges'
,
'bridged'
);
// interface list
...
...
src/www/services_dhcp.php
View file @
b0aa1be3
...
...
@@ -121,12 +121,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
if
(
empty
(
$config
[
'dhcpd'
][
$if
]))
{
$config
[
'dhcpd'
][
$if
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpd'
][
$if
][
'pool'
]))
{
$config
[
'dhcpd'
][
$if
][
'pool'
]
=
array
();
}
$a_pools
=
&
config_read_array
(
'dhcpd'
,
$if
,
'pool'
);
if
(
!
empty
(
$_GET
[
'act'
]))
{
...
...
@@ -179,12 +173,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pool
=
$_POST
[
'pool'
];
}
}
if
(
empty
(
$config
[
'dhcpd'
][
$if
]))
{
$config
[
'dhcpd'
][
$if
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpd'
][
$if
][
'pool'
]))
{
$config
[
'dhcpd'
][
$if
][
'pool'
]
=
array
();
}
$a_pools
=
&
config_read_array
(
'dhcpd'
,
$if
,
'pool'
);
if
(
!
empty
(
$_POST
[
'act'
]))
{
...
...
src/www/services_dhcp_edit.php
View file @
b0aa1be3
...
...
@@ -86,6 +86,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
elseif
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
$pconfig
=
$_POST
;
// handle identifiers and actions
if
(
!
empty
(
$pconfig
[
'if'
])
&&
!
empty
(
$config
[
'interfaces'
][
$pconfig
[
'if'
]]))
{
$if
=
$pconfig
[
'if'
];
...
...
@@ -93,15 +94,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
!
empty
(
$config
[
'dhcpd'
][
$if
][
'staticmap'
][
$pconfig
[
'id'
]]))
{
$id
=
$pconfig
[
'id'
];
}
if
(
empty
(
$config
[
'dhcpd'
]))
{
$config
[
'dhcpd'
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpd'
][
$if
]))
{
$config
[
'dhcpd'
][
$if
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpd'
][
$if
][
'staticmap'
]))
{
$config
[
'dhcpd'
][
$if
][
'staticmap'
]
=
array
();
}
$a_maps
=
&
config_read_array
(
'dhcpd'
,
$if
,
'staticmap'
);
$input_errors
=
array
();
...
...
src/www/services_dhcpv6.php
View file @
b0aa1be3
...
...
@@ -237,13 +237,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
if
(
count
(
$input_errors
)
==
0
)
{
config_read_array
(
'dhcpdv6'
,
$if
);
$dhcpdconf
=
array
();
if
(
empty
(
$config
[
'dhcpdv6'
])
||
!
is_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpdv6'
][
$if
])
||
!
is_array
(
$config
[
'dhcpdv6'
][
$if
]))
{
$config
[
'dhcpdv6'
][
$if
]
=
array
();
}
// simple 1-on-1 copy
$config_copy_fieldsnames
=
array
(
'defaultleasetime'
,
'maxleasetime'
,
'netmask'
,
'domain'
,
'domainsearchlist'
,
...
...
src/www/services_dhcpv6_edit.php
View file @
b0aa1be3
...
...
@@ -64,6 +64,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
elseif
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
$input_errors
=
array
();
$pconfig
=
$_POST
;
// handle identifiers and actions
if
(
!
empty
(
$pconfig
[
'if'
])
&&
!
empty
(
$config
[
'interfaces'
][
$pconfig
[
'if'
]]))
{
$if
=
$pconfig
[
'if'
];
...
...
@@ -71,15 +72,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
!
empty
(
$config
[
'dhcpdv6'
][
$if
][
'staticmap'
][
$pconfig
[
'id'
]]))
{
$id
=
$pconfig
[
'id'
];
}
if
(
empty
(
$config
[
'dhcpdv6'
])
||
!
is_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpdv6'
][
$if
])
||
!
is_array
(
$config
[
'dhcpdv6'
][
$if
]))
{
$config
[
'dhcpdv6'
][
$if
]
=
array
();
}
if
(
empty
(
$config
[
'dhcpdv6'
][
$if
][
'staticmap'
])
||
!
is_array
(
$config
[
'dhcpdv6'
][
$if
][
'staticmap'
]))
{
$config
[
'dhcpdv6'
][
$if
][
'staticmap'
]
=
array
();
}
config_read_array
(
'dhcpdv6'
,
$if
,
'staticmap'
);
/* input validation */
$reqdfields
=
explode
(
" "
,
"duid"
);
$reqdfieldsn
=
array
(
gettext
(
"DUID Identifier"
));
...
...
src/www/services_dnsmasq.php
View file @
b0aa1be3
...
...
@@ -33,13 +33,8 @@ require_once("filter.inc");
require_once
(
"services.inc"
);
require_once
(
"system.inc"
);
if
(
empty
(
$config
[
'dnsmasq'
][
'hosts'
])
||
!
is_array
(
$config
[
'dnsmasq'
][
'hosts'
]))
{
$config
[
'dnsmasq'
][
'hosts'
]
=
array
();
}
if
(
empty
(
$config
[
'dnsmasq'
][
'domainoverrides'
])
||
!
is_array
(
$config
[
'dnsmasq'
][
'domainoverrides'
]))
{
$config
[
'dnsmasq'
][
'domainoverrides'
]
=
array
();
}
config_read_array
(
'dnsmasq'
,
'hosts'
);
config_read_array
(
'dnsmasq'
,
'domainoverrides'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
=
array
();
...
...
src/www/services_ntpd_gps.php
View file @
b0aa1be3
...
...
@@ -34,9 +34,7 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"plugins.inc.d/ntpd.inc"
);
if
(
!
isset
(
$config
[
'ntpd'
][
'gps'
]))
{
$config
[
'ntpd'
][
'gps'
]
=
array
();
}
config_read_array
(
'ntpd'
,
'gps'
);
$copy_fields
=
array
(
'port'
,
'type'
,
'speed'
,
'nmea'
,
'fudge1'
,
'fudge2'
,
'stratum'
,
'prefer'
,
'noselect'
,
'flag1'
,
'flag2'
,
'flag3'
,
'flag4'
,
'subsec'
,
'refid'
,
'initcmd'
);
...
...
src/www/services_ntpd_pps.php
View file @
b0aa1be3
...
...
@@ -33,12 +33,7 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"plugins.inc.d/ntpd.inc"
);
if
(
!
isset
(
$config
[
'ntpd'
])
||
!
is_array
(
$config
[
'ntpd'
]))
{
$config
[
'ntpd'
]
=
array
();
}
if
(
!
isset
(
$config
[
'ntpd'
][
'pps'
]))
{
$config
[
'ntpd'
][
'pps'
]
=
array
();
}
config_read_array
(
'ntpd'
,
'pps'
);
$copy_fields
=
array
(
'port'
,
'fudge1'
,
'stratum'
,
'flag2'
,
'flag3'
,
'flag4'
,
'refid'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
...
...
src/www/services_opendns.php
View file @
b0aa1be3
...
...
@@ -32,9 +32,7 @@ require_once("system.inc");
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
if
(
empty
(
$config
[
'opendns'
])
||
!
is_array
(
$config
[
'opendns'
]))
{
$config
[
'opendns'
]
=
array
();
}
config_read_array
(
'opendns'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
[
'enable'
]
=
isset
(
$config
[
'opendns'
][
'enable'
]);
...
...
src/www/services_router_advertisements.php
View file @
b0aa1be3
...
...
@@ -120,9 +120,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
if
(
count
(
$input_errors
)
==
0
)
{
if
(
!
is_array
(
$config
[
'dhcpdv6'
][
$if
]))
{
$config
[
'dhcpdv6'
][
$if
]
=
array
();
}
config_read_array
(
'dhcpdv6'
,
$if
);
$config
[
'dhcpdv6'
][
$if
][
'ramode'
]
=
$pconfig
[
'ramode'
];
$config
[
'dhcpdv6'
][
$if
][
'rapriority'
]
=
$pconfig
[
'rapriority'
];
...
...
src/www/services_unbound_advanced.php
View file @
b0aa1be3
...
...
@@ -31,9 +31,7 @@ require_once("guiconfig.inc");
require_once
(
"system.inc"
);
require_once
(
"services.inc"
);
if
(
empty
(
$config
[
'unbound'
])
||
!
is_array
(
$config
[
'unbound'
]))
{
$config
[
'unbound'
]
=
array
();
}
config_read_array
(
'unbound'
);
$copy_fields
=
array
(
'cache_max_ttl'
,
...
...
src/www/services_unbound_overrides.php
View file @
b0aa1be3
...
...
@@ -34,6 +34,8 @@ require_once("system.inc");
require_once
(
"interfaces.inc"
);
$a_hosts
=
&
config_read_array
(
'unbound'
,
'hosts'
);
config_read_array
(
'unbound'
,
'domainoverrides'
);
/* Backwards compatibility for records created before introducing RR types. */
foreach
(
$a_hosts
as
$i
=>
$hostent
)
{
if
(
!
isset
(
$hostent
[
'rr'
]))
{
...
...
@@ -41,10 +43,6 @@ foreach ($a_hosts as $i => $hostent) {
}
}
if
(
empty
(
$config
[
'unbound'
][
'domainoverrides'
])
||
!
is_array
(
$config
[
'unbound'
][
'domainoverrides'
]))
{
$config
[
'unbound'
][
'domainoverrides'
]
=
array
();
}
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
$pconfig
=
$_POST
;
if
(
!
empty
(
$pconfig
[
'apply'
]))
{
...
...
src/www/system_authservers.php
View file @
b0aa1be3
...
...
@@ -27,19 +27,15 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"guiconfig.inc"
);
require_once
(
"auth.inc"
);
$authFactory
=
new
\OPNsense\Auth\AuthenticationFactory
();
$authCNFOptions
=
$authFactory
->
listConfigOptions
();
if
(
!
isset
(
$config
[
'system'
][
'authserver'
]))
{
$config
[
'system'
][
'authserver'
]
=
array
();
}
if
(
empty
(
$config
[
'ca'
])
||
!
is_array
(
$config
[
'ca'
]))
{
$config
[
'ca'
]
=
array
();
}
config_read_array
(
'system'
,
'authserver'
);
config_read_array
(
'ca'
);
$a_servers
=
auth_get_authserver_list
();
$a_server
=
array
();
...
...
src/www/system_gateways.php
View file @
b0aa1be3
...
...
@@ -150,12 +150,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
elseif
(
isset
(
$id
)
&&
isset
(
$pconfig
[
'act'
])
&&
$pconfig
[
'act'
]
==
"toggle"
)
{
// Toggle active/in-active
$realid
=
$a_gateways
[
$id
][
'attribute'
];
if
(
!
is_array
(
$config
[
'gateways'
]))
{
$config
[
'gateways'
]
=
array
();
}
if
(
!
is_array
(
$config
[
'gateways'
][
'gateway_item'
]))
{
$config
[
'gateways'
][
'gateway_item'
]
=
array
();
}
$a_gateway_item
=
&
config_read_array
(
'gateways'
,
'gateway_item'
);
if
(
isset
(
$a_gateway_item
[
$realid
][
'disabled'
]))
{
...
...
src/www/system_gateways_edit.php
View file @
b0aa1be3
...
...
@@ -321,13 +321,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
if
(
count
(
$input_errors
)
==
0
)
{
if
(
!
isset
(
$config
[
'gateways'
])
||
!
is_array
(
$config
[
'gateways'
]))
{
$config
[
'gateways'
]
=
array
();
}
if
(
!
isset
(
$config
[
'gateways'
][
'gateway_item'
])
||
!
is_array
(
$config
[
'gateways'
][
'gateway_item'
]))
{
$config
[
'gateways'
][
'gateway_item'
]
=
array
();
}
// A result of obfuscating the list of gateways is that over here we need to map things back that should
// be aligned with the configuration. Not going to fix this now.
if
(
isset
(
$a_gateways
[
$id
][
'attribute'
])
&&
is_numeric
(
$a_gateways
[
$id
][
'attribute'
])
)
{
...
...
src/www/vpn_ipsec_keys.php
View file @
b0aa1be3
...
...
@@ -33,15 +33,8 @@ require_once("filter.inc");
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
if
(
!
isset
(
$config
[
'ipsec'
])
||
!
is_array
(
$config
[
'ipsec'
]))
{
$config
[
'ipsec'
]
=
array
();
}
if
(
!
is_array
(
$config
[
'ipsec'
][
'mobilekey'
]))
{
$config
[
'ipsec'
][
'mobilekey'
]
=
array
();
}
else
{
ipsec_mobilekey_sort
();
}
config_read_array
(
'ipsec'
,
'mobilekey'
);
ipsec_mobilekey_sort
();
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
if
(
isset
(
$_POST
[
'act'
])
&&
isset
(
$_POST
[
'id'
])
&&
is_numericint
(
$_POST
[
'id'
])
&&
$_POST
[
'act'
]
==
"del"
)
{
...
...
src/www/vpn_ipsec_keys_edit.php
View file @
b0aa1be3
...
...
@@ -32,15 +32,8 @@ require_once("interfaces.inc");
require_once
(
"services.inc"
);
require_once
(
"plugins.inc.d/ipsec.inc"
);
if
(
!
isset
(
$config
[
'ipsec'
])
||
!
is_array
(
$config
[
'ipsec'
]))
{
$config
[
'ipsec'
]
=
array
();
}
if
(
!
isset
(
$config
[
'ipsec'
][
'mobilekey'
]))
{
$config
[
'ipsec'
][
'mobilekey'
]
=
array
();
}
else
{
ipsec_mobilekey_sort
();
}
config_read_aray
(
'ipsec'
,
'mobilekey'
);
ipsec_mobilekey_sort
();
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$pconfig
=
array
();
...
...
src/www/vpn_ipsec_mobile.php
View file @
b0aa1be3
...
...
@@ -33,17 +33,8 @@ require_once("filter.inc");
require_once
(
"services.inc"
);
require_once
(
"plugins.inc.d/ipsec.inc"
);
if
(
!
isset
(
$config
[
'ipsec'
])
||
!
is_array
(
$config
[
'ipsec'
]))
{
$config
[
'ipsec'
]
=
array
();
}
if
(
!
isset
(
$config
[
'ipsec'
][
'phase1'
]))
{
$config
[
'ipsec'
][
'phase1'
]
=
array
();
}
if
(
!
isset
(
$config
[
'ipsec'
][
'client'
]))
{
$config
[
'ipsec'
][
'client'
]
=
array
();
}
config_read_array
(
'ipsec'
,
'client'
);
config_read_array
(
'ipsec'
,
'phase1'
);
// define formfields
$form_fields
=
"user_source,group_source,pool_address,pool_netbits,net_list
...
...
src/www/vpn_ipsec_phase2.php
View file @
b0aa1be3
...
...
@@ -130,17 +130,8 @@ function getIndexByUniqueId($uniqid)
return
$p2index
;
}
if
(
!
isset
(
$config
[
'ipsec'
])
||
!
is_array
(
$config
[
'ipsec'
]))
{
$config
[
'ipsec'
]
=
array
();
}
if
(
!
isset
(
$config
[
'ipsec'
][
'client'
]))
{
$config
[
'ipsec'
][
'client'
]
=
array
();
}
if
(
!
isset
(
$config
[
'ipsec'
][
'phase2'
]))
{
$config
[
'ipsec'
][
'phase2'
]
=
array
();
}
config_read_array
(
'ipsec'
,
'client'
);
config_read_array
(
'ipsec'
,
'phase2'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
// lookup p2index
...
...
src/www/vpn_ipsec_settings.php
View file @
b0aa1be3
...
...
@@ -33,9 +33,7 @@ require_once("plugins.inc.d/ipsec.inc");
require_once
(
"services.inc"
);
require_once
(
"interfaces.inc"
);
if
(
!
isset
(
$config
[
'ipsec'
])
||
!
is_array
(
$config
[
'ipsec'
]))
{
$config
[
'ipsec'
]
=
array
();
}
config_read_array
(
'ipsec'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
// fetch form data
...
...
src/www/widgets/widgets/carp_status.widget.php
View file @
b0aa1be3
...
...
@@ -31,9 +31,7 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"interfaces.inc"
);
if
(
!
isset
(
$config
[
'virtualip'
][
'vip'
]))
{
$config
[
'virtualip'
][
'vip'
]
=
array
();
}
config_read_array
(
'virtualip'
,
'vip'
);
?>
<table
class=
"table table-striped table-condensed"
>
...
...
src/www/widgets/widgets/thermal_sensors.widget.php
View file @
b0aa1be3
...
...
@@ -27,6 +27,8 @@
require_once
(
"guiconfig.inc"
);
config_read_array
(
'widgets'
,
'thermal_sensors_widget'
);
function
validate_temp_value
(
$value
)
{
if
(
is_numeric
(
$value
)
&&
(
int
)
$value
==
$value
&&
$value
>=
0
and
$value
<=
100
)
{
...
...
@@ -45,10 +47,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
$fieldname
]
=
!
empty
(
$config
[
'widgets'
][
'thermal_sensors_widget'
][
$fieldname
])
?
$config
[
'widgets'
][
'thermal_sensors_widget'
][
$fieldname
]
:
$defaultValue
;
}
}
elseif
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
// save widget config
if
(
empty
(
$config
[
'widgets'
][
'thermal_sensors_widget'
])
||
!
is_array
(
$config
[
'widgets'
][
'thermal_sensors_widget'
]))
{
$config
[
'widgets'
][
'thermal_sensors_widget'
]
=
array
();
}
foreach
(
$fieldnames
as
$fieldname
)
{
$defaultValue
=
strpos
(
$fieldname
,
'critical'
)
!==
false
?
80
:
70
;
$newValue
=
!
empty
(
$_POST
[
$fieldname
])
?
$_POST
[
$fieldname
]
:
""
;
...
...
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