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
566fe52e
Commit
566fe52e
authored
Jul 22, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
etc: last batch for #1733
parent
b0aa1be3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
104 deletions
+37
-104
console.inc
src/etc/inc/console.inc
+18
-38
interfaces.inc
src/etc/inc/interfaces.inc
+1
-3
plugins.inc
src/etc/inc/plugins.inc
+0
-3
ntpd.inc
src/etc/inc/plugins.inc.d/ntpd.inc
+1
-3
wizard.inc
src/etc/inc/plugins.inc.d/openvpn/wizard.inc
+8
-18
webgui.inc
src/etc/inc/plugins.inc.d/webgui.inc
+0
-6
services.inc
src/etc/inc/services.inc
+4
-13
rc.initial.password
src/etc/rc.initial.password
+2
-4
rc.initial.setlanip
src/etc/rc.initial.setlanip
+0
-4
system.xml
src/wizard/system.xml
+3
-12
No files found.
src/etc/inc/console.inc
View file @
566fe52e
...
...
@@ -302,10 +302,11 @@ EOD;
if
(
$lanif
)
{
$new
=
false
;
if
(
!
is_array
(
$config
[
'interfaces'
][
'lan'
]))
{
$config
[
'interfaces'
][
'lan'
]
=
array
();
if
(
!
isset
(
$config
[
'interfaces'
][
'lan'
]))
{
$new
=
true
;
}
config_read_array
(
'interfaces'
,
'lan'
);
$config
[
'interfaces'
][
'lan'
][
'if'
]
=
$lanif
;
$config
[
'interfaces'
][
'lan'
][
'enable'
]
=
true
;
...
...
@@ -319,31 +320,19 @@ EOD;
$config
[
'interfaces'
][
'lan'
][
'subnetv6'
]
=
'64'
;
}
if
(
!
isset
(
$config
[
'dhcpd'
][
'lan'
]))
{
$config
[
'dhcpd'
][
'lan'
]
=
array
();
$config
[
'dhcpd'
][
'lan'
][
'range'
]
=
array
();
}
config_read_array
(
'dhcpd'
,
'lan'
,
'range'
);
$config
[
'dhcpd'
][
'lan'
][
'enable'
]
=
true
;
$config
[
'dhcpd'
][
'lan'
][
'range'
][
'from'
]
=
'192.168.1.100'
;
$config
[
'dhcpd'
][
'lan'
][
'range'
][
'to'
]
=
'192.168.1.199'
;
if
(
!
is_array
(
$config
[
'nat'
]))
{
$config
[
'nat'
]
=
array
();
}
if
(
!
is_array
(
$config
[
'nat'
][
'outbound'
]))
{
$config
[
'nat'
][
'outbound'
]
=
array
();
}
config_read_array
(
'nat'
,
'outbound'
);
$config
[
'nat'
][
'outbound'
][
'mode'
]
=
'automatic'
;
}
if
(
match_wireless_interface
(
$lanif
))
{
if
(
is_array
(
$config
[
'interfaces'
][
'lan'
])
&&
(
!
is_array
(
$config
[
'interfaces'
][
'lan'
][
'wireless'
])))
{
$config
[
'interfaces'
][
'lan'
][
'wireless'
]
=
array
();
}
}
else
{
if
(
isset
(
$config
[
'interfaces'
][
'lan'
]))
{
unset
(
$config
[
'interfaces'
][
'lan'
][
'wireless'
]);
}
config_read_array
(
'interfaces'
,
'lan'
,
'wireless'
);
}
elseif
(
isset
(
$config
[
'interfaces'
][
'lan'
][
'wireless'
]))
{
unset
(
$config
[
'interfaces'
][
'lan'
][
'wireless'
]);
}
}
else
{
if
(
isset
(
$config
[
'interfaces'
][
'lan'
][
'if'
]))
{
...
...
@@ -364,9 +353,7 @@ EOD;
}
if
(
$wanif
)
{
if
(
!
is_array
(
$config
[
'interfaces'
][
'wan'
]))
{
$config
[
'interfaces'
][
'wan'
]
=
array
();
}
config_read_array
(
'interfaces'
,
'wan'
);
$config
[
'interfaces'
][
'wan'
][
'if'
]
=
$wanif
;
$config
[
'interfaces'
][
'wan'
][
'enable'
]
=
true
;
$config
[
'interfaces'
][
'wan'
][
'ipaddr'
]
=
'dhcp'
;
...
...
@@ -377,14 +364,9 @@ EOD;
}
if
(
match_wireless_interface
(
$wanif
))
{
if
(
is_array
(
$config
[
'interfaces'
][
'wan'
])
&&
(
!
is_array
(
$config
[
'interfaces'
][
'wan'
][
'wireless'
])))
{
$config
[
'interfaces'
][
'wan'
][
'wireless'
]
=
array
();
}
}
else
{
if
(
isset
(
$config
[
'interfaces'
][
'wan'
]))
{
unset
(
$config
[
'interfaces'
][
'wan'
][
'wireless'
]);
}
config_read_array
(
'interfaces'
,
'wan'
,
'wireless'
);
}
elseif
(
isset
(
$config
[
'interfaces'
][
'wan'
][
'wireless'
]))
{
unset
(
$config
[
'interfaces'
][
'wan'
][
'wireless'
]);
}
}
else
{
if
(
isset
(
$config
[
'interfaces'
][
'wan'
]))
{
...
...
@@ -393,15 +375,12 @@ EOD;
}
for
(
$i
=
0
;
$i
<
count
(
$optif
);
$i
++
)
{
if
(
!
is_array
(
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)]))
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)]
=
array
();
config_read_array
(
'interfaces'
,
'opt'
.
(
$i
+
1
));
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)][
'if'
]
=
$optif
[
$i
];
if
(
match_wireless_interface
(
$optif
[
$i
]))
{
if
(
!
is_array
(
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)][
'wireless'
]))
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)][
'wireless'
]
=
array
();
}
else
{
config_read_array
(
'interfaces'
,
'opt'
.
(
$i
+
1
),
'wireless'
);
}
elseif
(
isset
(
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)][
'wireless'
]))
{
unset
(
$config
[
'interfaces'
][
'opt'
.
(
$i
+
1
)][
'wireless'
]);
}
...
...
@@ -474,7 +453,8 @@ EOD;
}
}
$config
[
'vlans'
][
'vlan'
]
=
array
();
config_read_array
(
'vlans'
,
'vlan'
);
echo
"
\n
"
;
$vlanif
=
0
;
...
...
src/etc/inc/interfaces.inc
View file @
566fe52e
...
...
@@ -4444,9 +4444,7 @@ function is_interface_wireless($interface)
$friendly
=
convert_real_interface_to_friendly_interface_name
(
$interface
);
if
(
!
isset
(
$config
[
'interfaces'
][
$friendly
][
'wireless'
]))
{
if
(
match_wireless_interface
(
$interface
))
{
if
(
isset
(
$config
[
'interfaces'
][
$friendly
]))
{
$config
[
'interfaces'
][
$friendly
][
'wireless'
]
=
array
();
}
config_read_array
(
'interfaces'
,
$friendly
,
'wireless'
);
return
true
;
}
return
false
;
...
...
src/etc/inc/plugins.inc
View file @
566fe52e
...
...
@@ -148,9 +148,6 @@ function plugins_interfaces()
if
(
isset
(
$stale_interfaces
[
$intf_ref
]))
{
unset
(
$stale_interfaces
[
$intf_ref
]);
}
if
(
empty
(
$config
[
'interfaces'
][
$intf_ref
]))
{
$config
[
'interfaces'
][
$intf_ref
]
=
array
();
}
if
(
isset
(
$config
[
'interfaces'
][
$intf_ref
][
0
]))
{
// undo stupid listags() turning our item into a new array, see src/etc/inc/xmlparse.inc
$intf_config
=
&
config_read_array
(
'interfaces'
,
$intf_ref
,
0
);
...
...
src/etc/inc/plugins.inc.d/ntpd.inc
View file @
566fe52e
...
...
@@ -174,9 +174,7 @@ function ntpd_configure_do($start_ntpd = true, $verbose = false)
@
mkdir
(
$statsdir
,
0755
);
if
(
!
isset
(
$config
[
'ntpd'
])
||
!
is_array
(
$config
[
'ntpd'
]))
{
$config
[
'ntpd'
]
=
array
();
}
config_read_array
(
'ntpd'
);
$ntpcfg
=
"#
\n
"
;
$ntpcfg
.=
"# Autogenerated configuration file
\n
"
;
...
...
src/etc/inc/plugins.inc.d/openvpn/wizard.inc
View file @
566fe52e
...
...
@@ -514,11 +514,9 @@ function step12_submitphpaction()
$auth
[
'radius_secret'
]
=
$pconfig
[
'step2'
][
'password'
];
$auth
[
'radius_srvcs'
]
=
"auth"
;
}
if
(
!
is_array
(
$config
[
'system'
][
'authserver'
]))
{
$config
[
'system'
][
'authserver'
]
=
array
();
}
$config
[
'system'
][
'authserver'
][]
=
$auth
;
$a_auth
=
&
config_read_array
(
'system'
,
'authserver'
);
$a_auth
[]
=
$auth
;
}
elseif
(
!
isset
(
$pconfig
[
'step2'
][
'uselist'
])
&&
empty
(
$pconfig
[
'step2'
][
'authserv'
]))
{
$message
=
"Please choose an authentication server."
;
header
(
url_safe
(
'Location: /wizard.php?xml=openvpn&stepid=1&message=%s'
,
array
(
$message
)));
...
...
@@ -542,11 +540,9 @@ function step12_submitphpaction()
'commonName'
=>
$pconfig
[
'step6'
][
'certca'
]);
ca_create
(
$ca
,
$pconfig
[
'step6'
][
'keylength'
],
$pconfig
[
'step6'
][
'lifetime'
],
$dn
,
"sha256"
);
if
(
!
is_array
(
$config
[
'ca'
]))
{
$config
[
'ca'
]
=
array
();
}
$config
[
'ca'
][]
=
$ca
;
$a_ca
=
&
config_read_array
(
'ca'
);
$a_ca
[]
=
$ca
;
}
elseif
(
!
isset
(
$pconfig
[
'step6'
][
'uselist'
])
&&
empty
(
$pconfig
[
'step6'
][
'authcertca'
]))
{
$message
=
"Please choose a Certificate Authority."
;
header
(
url_safe
(
'Location: /wizard.php?xml=openvpn&stepid=5&message=%s'
,
array
(
$message
)));
...
...
@@ -572,11 +568,8 @@ function step12_submitphpaction()
cert_create
(
$cert
,
$ca
[
'refid'
],
$pconfig
[
'step9'
][
'keylength'
],
$pconfig
[
'step9'
][
'lifetime'
],
$dn
,
'sha256'
,
'server_cert'
);
if
(
!
is_array
(
$config
[
'cert'
]))
{
$config
[
'cert'
]
=
array
();
}
$config
[
'cert'
][]
=
$cert
;
$a_cert
=
&
config_read_array
(
'cert'
);
$a_cert
[]
=
$cert
;
}
elseif
(
!
isset
(
$pconfig
[
'step9'
][
'uselist'
])
&&
empty
(
$pconfig
[
'step9'
][
'authcertname'
]))
{
$message
=
"Please choose a Certificate."
;
header
(
url_safe
(
'Location: /wizard.php?xml=openvpn&stepid=7&message=%s'
,
array
(
$message
)));
...
...
@@ -725,11 +718,8 @@ function step12_submitphpaction()
$config
[
'filter'
][
'rule'
][]
=
$rule
;
}
if
(
!
isset
(
$config
[
'openvpn'
][
'openvpn-server'
]))
{
$config
[
'openvpn'
][
'openvpn-server'
]
=
array
();
}
$config
[
'openvpn'
][
'openvpn-server'
][]
=
$server
;
$a_server
=
&
config_read_array
(
'openvpn'
,
'openvpn-server'
);
$a_server
[]
=
$server
;
write_config
();
...
...
src/etc/inc/plugins.inc.d/webgui.inc
View file @
566fe52e
...
...
@@ -61,13 +61,7 @@ function webgui_configure_do($verbose = false)
if
(
$config
[
'system'
][
'webgui'
][
'protocol'
]
==
"https"
)
{
$cert
=&
lookup_cert
(
$config
[
'system'
][
'webgui'
][
'ssl-certref'
]);
if
(
!
is_array
(
$cert
)
&&
!
$cert
[
'crt'
]
&&
!
$cert
[
'prv'
])
{
if
(
!
is_array
(
$config
[
'ca'
]))
{
$config
[
'ca'
]
=
array
();
}
$a_ca
=
&
config_read_array
(
'ca'
);
if
(
!
is_array
(
$config
[
'cert'
]))
{
$config
[
'cert'
]
=
array
();
}
$a_cert
=
&
config_read_array
(
'cert'
);
log_error
(
"Creating SSL certificate for this host"
);
$cert
=
array
();
...
...
src/etc/inc/services.inc
View file @
566fe52e
...
...
@@ -104,9 +104,7 @@ function services_radvd_configure($blacklist = array())
killbypid
(
'/var/run/radvd.pid'
,
'TERM'
,
true
);
if
(
!
isset
(
$config
[
'dhcpdv6'
])
||
!
is_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
config_read_array
(
'dhcpdv6'
);
$radvdconf
=
"# Automatically Generated, do not edit
\n
"
;
...
...
@@ -1016,11 +1014,8 @@ function services_dhcpdv6_configure($blacklist = array(), $verbose = false)
return
;
}
$syscfg
=
$config
[
'system'
];
if
(
!
isset
(
$config
[
'dhcpdv6'
])
||
!
is_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
$dhcpdv6cfg
=
$config
[
'dhcpdv6'
];
$syscfg
=
config_read_array
(
'system'
);
$dhcpdv6cfg
=
config_read_array
(
'dhcpdv6'
);
$Iflist
=
get_configured_interface_list
();
if
(
$verbose
)
{
...
...
@@ -1818,11 +1813,7 @@ function is_radvd_enabled()
{
global
$config
;
if
(
!
isset
(
$config
[
'dhcpdv6'
])
||
!
is_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
$dhcpdv6cfg
=
$config
[
'dhcpdv6'
];
$dhcpdv6cfg
=
config_read_array
(
'dhcpdv6'
);
$Iflist
=
get_configured_interface_list
();
/* handle manually configured DHCP6 server settings first */
...
...
src/etc/rc.initial.password
View file @
566fe52e
...
...
@@ -81,10 +81,8 @@ $admin_user = &getUserEntryByUID(0);
if
(
!
$admin_user
)
{
$admin_user
=
array
();
$admin_user
[
'uid'
]
=
0
;
if
(
!
isset
(
$config
[
'system'
][
'user'
]))
{
$config
[
'system'
][
'user'
]
=
array
();
}
$config
[
'system'
][
'user'
][]
=
$admin_user
;
$a_users
=
&
config_read_array
(
'system'
,
'user'
);
$a_users
[]
=
$admin_user
;
echo
"
\n
Restored missing root user.
\n
"
;
}
...
...
src/etc/rc.initial.setlanip
View file @
566fe52e
...
...
@@ -210,10 +210,6 @@ function add_gateway_to_config($interface, $gatewayip, $inet_type, $is_in_subnet
$label_IPvX
=
$inet_type
==
'inet6'
?
'IPv6'
:
'IPv4'
;
if
(
!
isset
(
$config
[
'gateways'
][
'gateway_item'
]))
{
$config
[
'gateways'
][
'gateway_item'
]
=
array
();
}
$a_gateways
=
&
config_read_array
(
'gateways'
,
'gateway_item'
);
$is_default
=
true
;
$new_name
=
''
;
...
...
src/wizard/system.xml
View file @
566fe52e
...
...
@@ -434,12 +434,8 @@
}
$type = $_POST['selectedtype'];
if (!is_array($config['ppps'])) {
$config['ppps'] = array();
}
if (!is_array($config['ppps']['ppp'])) {
$config['ppps']['ppp'] = array();
}
config_read_array('ppps', 'ppp');
foreach ($config['ppps']['ppp'] as $pppid =>
$ppp) {
if ($ppp['ptpid'] == "0") {
if ((substr($config['interfaces']['wan']['if'],0,5) == "pppoe") || (substr($config['interfaces']['wan']['if'],0,4) == "pptp")) {
...
...
@@ -588,12 +584,7 @@
$config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
$config['system']['domain'] = $config['wizardtemp']['system']['domain'];
if (!empty($config['wizardtemp']['wangateway'])) {
if (!is_array($config['gateways'])) {
$config['gateways'] = array();
}
if (!isset($config['gateways']['gateway_item'])) {
$config['gateways']['gateway_item'] = array();
}
config_read_array('gateways', 'gateway_item');
$found = false;
$defaultgw_found = false;
foreach ($config['gateways']['gateway_item'] as & $gw) {
...
...
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