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
0145541f
Commit
0145541f
authored
Jul 06, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) fix more php issues in etc/inc
parent
8d561f62
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
132 additions
and
71 deletions
+132
-71
auth.inc
src/etc/inc/auth.inc
+1
-1
certs.inc
src/etc/inc/certs.inc
+21
-12
filter.inc
src/etc/inc/filter.inc
+34
-9
gwlb.inc
src/etc/inc/gwlb.inc
+19
-17
interfaces.inc
src/etc/inc/interfaces.inc
+23
-12
openvpn.inc
src/etc/inc/openvpn.inc
+2
-2
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+6
-4
service-utils.inc
src/etc/inc/service-utils.inc
+3
-3
system.inc
src/etc/inc/system.inc
+1
-1
util.inc
src/etc/inc/util.inc
+5
-1
vslb.inc
src/etc/inc/vslb.inc
+17
-9
No files found.
src/etc/inc/auth.inc
View file @
0145541f
...
...
@@ -1228,7 +1228,7 @@ function auth_get_authserver_list() {
$list
=
array
();
if
(
is_array
(
$config
[
'system'
][
'authserver'
]))
{
if
(
is
set
(
$config
[
'system'
][
'authserver'
])
&&
is
_array
(
$config
[
'system'
][
'authserver'
]))
{
foreach
(
$config
[
'system'
][
'authserver'
]
as
$authcfg
)
{
/* Add support for disabled entries? */
$list
[
$authcfg
[
'name'
]]
=
$authcfg
;
...
...
src/etc/inc/certs.inc
View file @
0145541f
...
...
@@ -48,17 +48,18 @@ $openssl_crl_status = array(
function
&
lookup_ca
(
$refid
)
{
global
$config
;
$false
=
false
;
if
(
is_array
(
$config
[
'ca'
]))
foreach
(
$config
[
'ca'
]
as
&
$ca
)
if
(
$ca
[
'refid'
]
==
$refid
)
return
$ca
;
return
false
;
return
$false
;
}
function
&
lookup_ca_by_subject
(
$subject
)
{
global
$config
;
$false
=
false
;
if
(
is_array
(
$config
[
'ca'
]))
foreach
(
$config
[
'ca'
]
as
&
$ca
)
...
...
@@ -68,37 +69,41 @@ function & lookup_ca_by_subject($subject) {
return
$ca
;
}
return
false
;
return
$
false
;
}
function
&
lookup_cert
(
$refid
)
{
global
$config
;
$false
=
false
;
if
(
is_array
(
$config
[
'cert'
]))
foreach
(
$config
[
'cert'
]
as
&
$cert
)
if
(
$cert
[
'refid'
]
==
$refid
)
return
$cert
;
return
false
;
return
$
false
;
}
function
&
lookup_cert_by_name
(
$name
)
{
global
$config
;
$null
=
null
;
if
(
is_array
(
$config
[
'cert'
]))
foreach
(
$config
[
'cert'
]
as
&
$cert
)
if
(
$cert
[
'descr'
]
==
$name
)
return
$cert
;
return
$null
;
}
function
&
lookup_crl
(
$refid
)
{
global
$config
;
$false
=
false
;
if
(
is_array
(
$config
[
'crl'
]))
foreach
(
$config
[
'crl'
]
as
&
$crl
)
if
(
$crl
[
'refid'
]
==
$refid
)
return
$crl
;
return
false
;
return
$
false
;
}
function
ca_chain_array
(
&
$cert
)
{
...
...
@@ -395,11 +400,11 @@ function cert_get_subject($str_crt, $decode = true) {
ksort
(
$v
);
foreach
(
$v
as
$w
)
{
$asubject
=
"
{
$a
}
=
{
$w
}
"
;
$subject
=
(
strlen
(
$subject
))
?
"
{
$asubject
}
,
{
$subject
}
"
:
$asubject
;
$subject
=
(
isset
(
$subject
))
?
"
{
$asubject
}
,
{
$subject
}
"
:
$asubject
;
}
}
else
{
$asubject
=
"
{
$a
}
=
{
$v
}
"
;
$subject
=
(
strlen
(
$subject
))
?
"
{
$asubject
}
,
{
$subject
}
"
:
$asubject
;
$subject
=
(
isset
(
$subject
))
?
"
{
$asubject
}
,
{
$subject
}
"
:
$asubject
;
}
}
...
...
@@ -445,11 +450,11 @@ function cert_get_issuer($str_crt, $decode = true) {
ksort
(
$v
);
foreach
(
$v
as
$w
)
{
$aissuer
=
"
{
$a
}
=
{
$w
}
"
;
$issuer
=
(
strlen
(
$issuer
))
?
"
{
$aissuer
}
,
{
$issuer
}
"
:
$aissuer
;
$issuer
=
(
isset
(
$issuer
))
?
"
{
$aissuer
}
,
{
$issuer
}
"
:
$aissuer
;
}
}
else
{
$aissuer
=
"
{
$a
}
=
{
$v
}
"
;
$issuer
=
(
strlen
(
$issuer
))
?
"
{
$aissuer
}
,
{
$issuer
}
"
:
$aissuer
;
$issuer
=
(
isset
(
$issuer
))
?
"
{
$aissuer
}
,
{
$issuer
}
"
:
$aissuer
;
}
}
...
...
@@ -490,7 +495,11 @@ function cert_get_purpose($str_crt, $decode = true) {
$crt_details
=
openssl_x509_parse
(
$str_crt
);
$purpose
=
array
();
$purpose
[
'ca'
]
=
(
stristr
(
$crt_details
[
'extensions'
][
'basicConstraints'
],
'CA:TRUE'
)
===
false
)
?
'No'
:
'Yes'
;
$purpose
[
'server'
]
=
(
$crt_details
[
'extensions'
][
'nsCertType'
]
==
"SSL Server"
)
?
'Yes'
:
'No'
;
if
(
isset
(
$crt_details
[
'extensions'
][
'nsCertType'
])
&&
$crt_details
[
'extensions'
][
'nsCertType'
]
==
"SSL Server"
)
{
$purpose
[
'server'
]
=
'Yes'
;
}
else
{
$purpose
[
'server'
]
=
'No'
;
}
return
$purpose
;
}
...
...
@@ -524,7 +533,7 @@ function is_user_cert($certref)
}
foreach
(
$config
[
'system'
][
'user'
]
as
$user
)
{
if
(
!
is_array
(
$user
[
'cert'
]))
{
if
(
!
is
set
(
$user
[
'cert'
])
||
!
is
_array
(
$user
[
'cert'
]))
{
continue
;
}
foreach
(
$user
[
'cert'
]
as
$cert
)
{
...
...
@@ -696,7 +705,7 @@ function cert_compare($cert1, $cert2) {
function
is_cert_revoked
(
$cert
,
$crlref
=
""
)
{
global
$config
;
if
(
!
is_array
(
$config
[
'crl'
]))
if
(
!
is
set
(
$config
[
'crl'
])
||
!
is
_array
(
$config
[
'crl'
]))
return
false
;
if
(
!
empty
(
$crlref
))
{
...
...
src/etc/inc/filter.inc
View file @
0145541f
...
...
@@ -838,8 +838,13 @@ function filter_generate_optcfg_array()
$oic
[
'ipv6'
]
=
get_interface_ipv6
(
$if
);
if
(
!
is_ipaddrv4
(
$oc
[
'ipaddr'
])
&&
!
empty
(
$oc
[
'ipaddr'
]))
$oic
[
'type'
]
=
$oc
[
'ipaddr'
];
if
(
!
is_ipaddrv6
(
$oc
[
'ipaddrv6'
])
&&
!
empty
(
$oc
[
'ipaddrv6'
]))
$oic
[
'type6'
]
=
$oc
[
'ipaddrv6'
];
if
(
isset
(
$oc
[
'ipaddrv6'
]))
{
if
(
!
is_ipaddrv6
(
$oc
[
'ipaddrv6'
])
&&
!
empty
(
$oc
[
'ipaddrv6'
]))
{
$oic
[
'type6'
]
=
$oc
[
'ipaddrv6'
];
}
}
else
{
$oic
[
'type6'
]
=
null
;
}
if
(
!
empty
(
$oc
[
'track6-interface'
]))
$oic
[
'track6-interface'
]
=
$oc
[
'track6-interface'
];
$oic
[
'sn'
]
=
get_interface_subnet
(
$if
);
...
...
@@ -849,11 +854,31 @@ function filter_generate_optcfg_array()
$oic
[
'descr'
]
=
$ifdetail
;
$oic
[
'sa'
]
=
gen_subnet
(
$oic
[
'ip'
],
$oic
[
'sn'
]);
$oic
[
'sav6'
]
=
gen_subnetv6
(
$oic
[
'ipv6'
],
$oic
[
'snv6'
]);
$oic
[
'nonat'
]
=
$oc
[
'nonat'
];
$oic
[
'alias-address'
]
=
$oc
[
'alias-address'
];
$oic
[
'alias-subnet'
]
=
$oc
[
'alias-subnet'
];
$oic
[
'gateway'
]
=
$oc
[
'gateway'
];
$oic
[
'gatewayv6'
]
=
$oc
[
'gatewayv6'
];
if
(
isset
(
$oc
[
'nonat'
]))
{
$oic
[
'nonat'
]
=
$oc
[
'nonat'
];
}
else
{
$oic
[
'nonat'
]
=
null
;
}
if
(
isset
(
$oc
[
'alias-address'
]))
{
$oic
[
'alias-address'
]
=
$oc
[
'alias-address'
];
}
else
{
$oic
[
'alias-address'
]
=
null
;
}
if
(
isset
(
$oc
[
'alias-subnet'
]))
{
$oic
[
'alias-subnet'
]
=
$oc
[
'alias-subnet'
];
}
else
{
$oc
[
'alias-subnet'
]
=
null
;
}
if
(
isset
(
$oc
[
'gateway'
]))
{
$oic
[
'gateway'
]
=
$oc
[
'gateway'
];
}
else
{
$oic
[
'gateway'
]
=
null
;
}
if
(
isset
(
$oc
[
'gatewayv6'
]))
{
$oic
[
'gatewayv6'
]
=
$oc
[
'gatewayv6'
];
}
else
{
$oic
[
'gatewayv6'
]
=
null
;
}
$oic
[
'spoofcheck'
]
=
"yes"
;
$oic
[
'bridge'
]
=
link_interface_to_bridge
(
$if
);
$vips
=
link_interface_to_vips
(
$if
);
...
...
@@ -896,7 +921,7 @@ function filter_generate_optcfg_array()
$oic
[
'sn'
]
=
"32"
;
$FilterIflist
[
'pptp'
]
=
$oic
;
}
if
(
$config
[
'l2tp'
][
'mode'
]
==
"server"
)
{
if
(
isset
(
$config
[
'l2tp'
][
'mode'
])
&&
$config
[
'l2tp'
][
'mode'
]
==
"server"
)
{
$oic
=
array
();
$oic
[
'if'
]
=
'l2tp'
;
$oic
[
'descr'
]
=
'L2TP'
;
...
...
@@ -910,7 +935,7 @@ function filter_generate_optcfg_array()
$oic
[
'virtual'
]
=
true
;
$FilterIflist
[
'l2tp'
]
=
$oic
;
}
if
(
is_array
(
$config
[
'pppoes'
][
'pppoe'
])
&&
(
count
(
$config
[
'pppoes'
][
'pppoe'
])
>
0
))
{
if
(
is
set
(
$config
[
'pppoes'
][
'pppoe'
])
&&
is
_array
(
$config
[
'pppoes'
][
'pppoe'
])
&&
(
count
(
$config
[
'pppoes'
][
'pppoe'
])
>
0
))
{
$pppoeifs
=
array
();
foreach
(
$config
[
'pppoes'
][
'pppoe'
]
as
$pppoe
)
{
if
(
$pppoe
[
'mode'
]
==
"server"
)
{
...
...
src/etc/inc/gwlb.inc
View file @
0145541f
...
...
@@ -388,7 +388,7 @@ function return_gateways_status($byname = false)
foreach
(
$gateways_arr
as
$gwitem
)
{
if
(
!
isset
(
$gwitem
[
'monitor_disable'
]))
continue
;
if
(
!
is_ipaddr
(
$gwitem
[
'monitorip'
]))
{
if
(
!
is
set
(
$gwitem
[
'monitorip'
])
||
!
is
_ipaddr
(
$gwitem
[
'monitorip'
]))
{
$realif
=
$gwitem
[
'interface'
];
$tgtip
=
get_interface_gateway
(
$realif
);
if
(
!
is_ipaddr
(
$tgtip
))
...
...
@@ -943,26 +943,28 @@ function get_interface_gateway($interface, &$dynamic = false)
$gw
=
NULL
;
$gwcfg
=
$config
[
'interfaces'
][
$interface
];
if
(
!
empty
(
$gwcfg
[
'gateway'
])
&&
is_array
(
$config
[
'gateways'
][
'gateway_item'
]))
{
foreach
(
$config
[
'gateways'
][
'gateway_item'
]
as
$gateway
)
{
if
((
$gateway
[
'name'
]
==
$gwcfg
[
'gateway'
])
&&
(
is_ipaddrv4
(
$gateway
[
'gateway'
])))
{
$gw
=
$gateway
[
'gateway'
];
break
;
if
(
isset
(
$config
[
'interfaces'
][
$interface
]))
{
$gwcfg
=
$config
[
'interfaces'
][
$interface
];
if
(
isset
(
$gwcfg
[
'gateway'
])
&&
is_array
(
$config
[
'gateways'
][
'gateway_item'
]))
{
foreach
(
$config
[
'gateways'
][
'gateway_item'
]
as
$gateway
)
{
if
((
$gateway
[
'name'
]
==
$gwcfg
[
'gateway'
])
&&
(
is_ipaddrv4
(
$gateway
[
'gateway'
])))
{
$gw
=
$gateway
[
'gateway'
];
break
;
}
}
}
}
// for dynamic interfaces we handle them through the $interface_router file.
if
(
!
is_ipaddrv4
(
$gw
)
&&
!
is_ipaddrv4
(
$gwcfg
[
'ipaddr'
]))
{
$realif
=
get_real_interface
(
$interface
);
if
(
file_exists
(
"/tmp/
{
$realif
}
_router"
))
{
// for dynamic interfaces we handle them through the $interface_router file.
if
(
!
is_ipaddrv4
(
$gw
)
&&
!
is_ipaddrv4
(
$gwcfg
[
'ipaddr'
]))
{
$realif
=
get_real_interface
(
$interface
);
if
(
file_exists
(
"/tmp/
{
$realif
}
_router"
))
{
$gw
=
trim
(
file_get_contents
(
"/tmp/
{
$realif
}
_router"
),
"
\n
"
);
$dynamic
=
true
;
$dynamic
=
true
;
}
if
(
file_exists
(
"/tmp/
{
$realif
}
_defaultgw"
))
{
$dynamic
=
"default"
;
}
}
if
(
file_exists
(
"/tmp/
{
$realif
}
_defaultgw"
))
$dynamic
=
"default"
;
}
/* return gateway */
...
...
@@ -985,7 +987,7 @@ function get_interface_gateway_v6($interface, &$dynamic = false)
}
// for dynamic interfaces we handle them through the $interface_router file.
if
(
!
is_ipaddrv6
(
$gw
)
&&
!
is_ipaddrv6
(
$gwcfg
[
'ipaddrv6'
]
))
{
if
(
!
is_ipaddrv6
(
$gw
)
&&
(
!
isset
(
$gwcfg
[
'ipaddrv6'
])
||
!
is_ipaddrv6
(
$gwcfg
[
'ipaddrv6'
])
))
{
$realif
=
get_real_interface
(
$interface
);
if
(
file_exists
(
"/tmp/
{
$realif
}
_routerv6"
))
{
$gw
=
trim
(
file_get_contents
(
"/tmp/
{
$realif
}
_routerv6"
),
"
\n
"
);
...
...
src/etc/inc/interfaces.inc
View file @
0145541f
...
...
@@ -4146,6 +4146,7 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") {
/* attempt to resolve interface to friendly descr */
function
convert_friendly_interface_to_friendly_descr
(
$interface
)
{
global
$config
;
$ifdesc
=
null
;
switch
(
$interface
)
{
case
"l2tp"
:
...
...
@@ -4752,8 +4753,9 @@ function find_interface_ipv6($interface, $flush = false) {
$interface_ipv6_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr6'
];
$interface_snv6_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits6'
];
}
return
$interface_ipv6_arr_cache
[
$interface
];
}
return
$interface_ipv6_arr_cache
[
$interface
]
;
return
;
}
/*
...
...
@@ -4794,11 +4796,13 @@ function find_interface_subnet($interface, $flush = false) {
if
(
!
isset
(
$interface_sn_arr_cache
[
$interface
])
or
$flush
)
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
$interface_ip_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr'
];
$interface_sn_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits'
];
if
(
isset
(
$ifinfo
[
'ipaddr'
]))
{
$interface_ip_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr'
];
$interface_sn_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits'
];
return
$interface_sn_arr_cache
[
$interface
];
}
}
return
$interface_sn_arr_cache
[
$interface
];
return
;
}
function
find_interface_subnetv6
(
$interface
,
$flush
=
false
)
{
...
...
@@ -4811,11 +4815,13 @@ function find_interface_subnetv6($interface, $flush = false) {
if
(
!
isset
(
$interface_snv6_arr_cache
[
$interface
])
or
$flush
)
{
$ifinfo
=
pfSense_get_interface_addresses
(
$interface
);
$interface_ipv6_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr6'
];
$interface_snv6_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits6'
];
if
(
isset
(
$ifinfo
[
'ipaddr6'
]))
{
$interface_ipv6_arr_cache
[
$interface
]
=
$ifinfo
[
'ipaddr6'
];
$interface_snv6_arr_cache
[
$interface
]
=
$ifinfo
[
'subnetbits6'
];
return
$interface_snv6_arr_cache
[
$interface
];
}
}
return
$interface_snv6_arr_cache
[
$interface
];
return
;
}
function
ip_in_interface_alias_subnet
(
$interface
,
$ipalias
)
{
...
...
@@ -4984,7 +4990,12 @@ function interface_has_gatewayv6($friendly) {
if
(
!
empty
(
$config
[
'interfaces'
][
$friendly
]))
{
$ifname
=
&
$config
[
'interfaces'
][
$friendly
];
switch
(
$ifname
[
'ipaddrv6'
])
{
if
(
isset
(
$ifname
[
'ipaddrv6'
]))
{
$ipaddrv6
=
$ifname
[
'ipaddrv6'
];
}
else
{
$ipaddrv6
=
""
;
}
switch
(
$ipaddrv6
)
{
case
"slaac"
:
case
"dhcp6"
:
case
"6to4"
:
...
...
@@ -5227,13 +5238,13 @@ function get_failover_interface($interface, $family = "all") {
global
$config
;
/* shortcut to get_real_interface if we find it in the config */
if
(
is_array
(
$config
[
'interfaces'
][
$interface
]))
{
if
(
is
set
(
$config
[
'interfaces'
][
$interface
])
&&
is
_array
(
$config
[
'interfaces'
][
$interface
]))
{
return
get_real_interface
(
$interface
,
$family
);
}
/* compare against gateway groups */
$a_groups
=
return_gateway_groups_array
();
if
(
is_array
(
$a_groups
[
$interface
]))
{
if
(
is
set
(
$a_groups
[
$interface
])
&&
is
_array
(
$a_groups
[
$interface
]))
{
/* we found a gateway group, fetch the interface or vip */
if
(
$a_groups
[
$interface
][
0
][
'vip'
]
<>
""
)
return
$a_groups
[
$interface
][
0
][
'vip'
];
...
...
src/etc/inc/openvpn.inc
View file @
0145541f
...
...
@@ -1016,7 +1016,7 @@ function openvpn_get_active_servers($type="multipoint") {
global
$config
,
$g
;
$servers
=
array
();
if
(
is_array
(
$config
[
'openvpn'
][
'openvpn-server'
]))
{
if
(
is
set
(
$config
[
'openvpn'
][
'openvpn-server'
])
&&
is
_array
(
$config
[
'openvpn'
][
'openvpn-server'
]))
{
foreach
(
$config
[
'openvpn'
][
'openvpn-server'
]
as
&
$settings
)
{
if
(
empty
(
$settings
)
||
isset
(
$settings
[
'disable'
]))
continue
;
...
...
@@ -1118,7 +1118,7 @@ function openvpn_get_active_clients() {
global
$config
,
$g
;
$clients
=
array
();
if
(
is_array
(
$config
[
'openvpn'
][
'openvpn-client'
]))
{
if
(
is
set
(
$config
[
'openvpn'
][
'openvpn-client'
])
&&
is
_array
(
$config
[
'openvpn'
][
'openvpn-client'
]))
{
foreach
(
$config
[
'openvpn'
][
'openvpn-client'
]
as
&
$settings
)
{
if
(
empty
(
$settings
)
||
isset
(
$settings
[
'disable'
]))
...
...
src/etc/inc/pfsense-utils.inc
View file @
0145541f
...
...
@@ -37,7 +37,7 @@
******/
function
have_natpfruleint_access
(
$if
)
{
$security_url
=
"firewall_nat_edit.php?if="
.
strtolower
(
$if
);
if
(
isAllowedPage
(
$security_url
,
$allowed
))
if
(
isAllowedPage
(
$security_url
))
return
true
;
return
false
;
}
...
...
@@ -810,8 +810,9 @@ function is_dhcpv6_server_enabled() {
function
is_radvd_enabled
()
{
global
$config
;
if
(
!
is
_array
(
$config
[
'dhcpdv6'
]))
if
(
!
is
set
(
$config
[
'dhcpdv6'
])
||
!
is_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
$dhcpdv6cfg
=
$config
[
'dhcpdv6'
];
$Iflist
=
get_configured_interface_list
();
...
...
@@ -1905,8 +1906,9 @@ function is_ipaddr_configured($ipaddr, $ignore_if = "", $check_localip = false,
function calculate_ipv6_delegation_length(
$if
) {
global
$config
;
if(!is
_array(
$config['interfaces'][$if]
))
if(!is
set(
$config['interfaces'][$if]
) || !is_array(
$config['interfaces'][$if]
)) {
return false;
}
switch(
$config['interfaces'][$if]['ipaddrv6']
) {
case "
6
to4
":
...
...
@@ -2027,7 +2029,7 @@ function zte_simstate_to_string($state) {
function get_configured_pppoe_server_interfaces() {
global
$config
;
$iflist
= array();
if (is_array(
$config['pppoes']['pppoe']
)) {
if (is
set(
$config['pppoes']['pppoe']
) && is
_array(
$config['pppoes']['pppoe']
)) {
foreach(
$config['pppoes']['pppoe']
as
$pppoe
) {
if (
$pppoe['mode']
== "
server
") {
$int
= "
poes
".
$pppoe['pppoeid']
;
...
...
src/etc/inc/service-utils.inc
View file @
0145541f
...
...
@@ -69,7 +69,7 @@ if (!function_exists('get_services')) {
$pconfig
[
'description'
]
=
gettext
(
"NTP clock sync"
);
$services
[]
=
$pconfig
;
if
(
is_array
(
$config
[
'captiveportal'
]))
{
if
(
is
set
(
$config
[
'captiveportal'
])
&&
is
_array
(
$config
[
'captiveportal'
]))
{
foreach
(
$config
[
'captiveportal'
]
as
$zone
=>
$setting
)
{
if
(
isset
(
$setting
[
'enable'
]))
{
$pconfig
=
array
();
...
...
@@ -125,7 +125,7 @@ if (!function_exists('get_services')) {
$services
[]
=
$pconfig
;
}
if
(
is_array
(
$config
[
'igmpproxy'
][
'igmpentry'
])
&&
(
count
(
$config
[
'igmpproxy'
][
'igmpentry'
])
>
0
))
{
if
(
is
set
(
$config
[
'igmpproxy'
][
'igmpentry'
])
&&
is
_array
(
$config
[
'igmpproxy'
][
'igmpentry'
])
&&
(
count
(
$config
[
'igmpproxy'
][
'igmpentry'
])
>
0
))
{
$pconfig
=
array
();
$pconfig
[
'name'
]
=
"igmpproxy"
;
$pconfig
[
'description'
]
=
gettext
(
"IGMP proxy"
);
...
...
@@ -169,7 +169,7 @@ if (!function_exists('get_services')) {
}
}
if
(
count
(
$config
[
'load_balancer'
][
'virtual_server'
])
&&
count
(
$config
[
'load_balancer'
][
'lbpool'
]))
{
if
(
isset
(
$config
[
'load_balancer'
][
'virtual_server'
])
&&
isset
(
$config
[
'load_balancer'
][
'lbpool'
])
&&
count
(
$config
[
'load_balancer'
][
'virtual_server'
])
&&
count
(
$config
[
'load_balancer'
][
'lbpool'
]))
{
$pconfig
=
array
();
$pconfig
[
'name'
]
=
"relayd"
;
$pconfig
[
'description'
]
=
gettext
(
"Server load balancing daemon"
);
...
...
src/etc/inc/system.inc
View file @
0145541f
...
...
@@ -1728,7 +1728,7 @@ function get_possible_traffic_source_addresses($include_ipv6_link_local=false) {
global
$config
;
$sourceips
=
get_possible_listen_ips
(
$include_ipv6_link_local
);
foreach
(
array
(
'server'
,
'client'
)
as
$mode
)
{
if
(
is_array
(
$config
[
'openvpn'
][
"openvpn-
{
$mode
}
"
]))
{
if
(
is
set
(
$config
[
'openvpn'
][
"openvpn-
{
$mode
}
"
])
&&
is
_array
(
$config
[
'openvpn'
][
"openvpn-
{
$mode
}
"
]))
{
foreach
(
$config
[
'openvpn'
][
"openvpn-
{
$mode
}
"
]
as
$id
=>
$setting
)
{
if
(
!
isset
(
$setting
[
'disable'
]))
{
$vpn
=
array
();
...
...
src/etc/inc/util.inc
View file @
0145541f
...
...
@@ -942,7 +942,11 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "")
$dmesg_arr
=
array
();
exec
(
"/sbin/dmesg |grep
$ifname
| head -n1"
,
$dmesg_arr
);
preg_match_all
(
"/<(.*?)>/i"
,
$dmesg_arr
[
0
],
$dmesg
);
$toput
[
'dmesg'
]
=
$dmesg
[
1
][
0
];
if
(
isset
(
$dmesg
[
1
][
0
]))
{
$toput
[
'dmesg'
]
=
$dmesg
[
1
][
0
];
}
else
{
$toput
[
'dmesg'
]
=
null
;
}
$iflist
[
$ifname
]
=
$toput
;
break
;
case
"ppp"
:
...
...
src/etc/inc/vslb.inc
View file @
0145541f
...
...
@@ -464,15 +464,23 @@ function get_lb_summary() {
$relay_hosts
=
Array
();
foreach
(
(
array
)
$relayctl
as
$line
)
{
$t
=
explode
(
"
\t
"
,
$line
);
switch
(
trim
(
$t
[
1
]))
{
case
"table"
:
$curpool
=
trim
(
$t
[
2
]);
break
;
case
"host"
:
$curhost
=
trim
(
$t
[
2
]);
$relay_hosts
[
$curpool
][
$curhost
][
'avail'
]
=
trim
(
$t
[
3
]);
$relay_hosts
[
$curpool
][
$curhost
][
'state'
]
=
trim
(
$t
[
4
]);
break
;
if
(
isset
(
$t
[
1
]))
{
switch
(
trim
(
$t
[
1
]))
{
case
"table"
:
$curpool
=
trim
(
$t
[
2
]);
break
;
case
"host"
:
$curhost
=
trim
(
$t
[
2
]);
if
(
!
isset
(
$relay_hosts
[
$curpool
]))
{
$relay_hosts
[
$curpool
]
=
array
();
}
if
(
!
isset
(
$relay_hosts
[
$curpool
][
$curhost
]))
{
$relay_hosts
[
$curpool
][
$curhost
][
'avail'
]
=
array
();
}
$relay_hosts
[
$curpool
][
$curhost
][
'avail'
]
=
trim
(
$t
[
3
]);
$relay_hosts
[
$curpool
][
$curhost
][
'state'
]
=
trim
(
$t
[
4
]);
break
;
}
}
}
return
$relay_hosts
;
...
...
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