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
4e7b6d48
Commit
4e7b6d48
authored
May 30, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: remove more migration code related to old cp
(cherry picked from commit
cf41a413
)
parent
ced1ab98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
154 deletions
+0
-154
upgrade_config.inc
src/etc/inc/upgrade_config.inc
+0
-154
No files found.
src/etc/inc/upgrade_config.inc
View file @
4e7b6d48
...
...
@@ -2100,37 +2100,6 @@ function upgrade_055_to_056() {
}
}
function
upgrade_056_to_057
()
{
global
$config
;
if
(
!
is_array
(
$config
[
'system'
][
'user'
]))
$config
[
'system'
][
'user'
]
=
array
();
/* migrate captivate portal to user manager */
if
(
is_array
(
$config
[
'captiveportal'
][
'user'
]))
{
foreach
(
$config
[
'captiveportal'
][
'user'
]
as
$user
)
{
// avoid user conflicts
$found
=
false
;
foreach
(
$config
[
'system'
][
'user'
]
as
$userent
)
{
if
(
$userent
[
'name'
]
==
$user
[
'name'
])
{
$found
=
true
;
break
;
}
}
if
(
$found
)
continue
;
$user
[
'scope'
]
=
"user"
;
if
(
isset
(
$user
[
'expirationdate'
]))
{
$user
[
'expires'
]
=
$user
[
'expirationdate'
];
unset
(
$user
[
'expirationdate'
]);
}
$user
[
'uid'
]
=
$config
[
'system'
][
'nextuid'
]
++
;
$config
[
'system'
][
'user'
][]
=
$user
;
}
unset
(
$config
[
'captiveportal'
][
'user'
]);
}
}
function
upgrade_057_to_058
()
{
global
$config
;
/* set all phase2 entries to tunnel mode */
...
...
@@ -2515,11 +2484,6 @@ function upgrade_077_to_078() {
$config
[
'pptpd'
][
'n_pptp_units'
]
=
empty
(
$config
[
'pptpd'
][
'n_pptp_units'
])
?
16
:
$config
[
'pptpd'
][
'n_pptp_units'
];
}
}
function
upgrade_078_to_079
()
{
/* Delete old and unused RRD file */
@
unlink
(
'/var/db/rrd/captiveportal-totalusers.rrd'
);
}
function
upgrade_079_to_080
()
{
global
$config
;
...
...
@@ -2693,28 +2657,6 @@ function upgrade_080_to_081()
unset
(
$rule
);
}
function
upgrade_082_to_083
()
{
global
$config
;
/* Upgrade captiveportal config */
if
(
!
empty
(
$config
[
'captiveportal'
]))
{
$tmpcp
=
$config
[
'captiveportal'
];
$config
[
'captiveportal'
]
=
array
();
$config
[
'captiveportal'
][
'cpzone'
]
=
array
();
$config
[
'captiveportal'
][
'cpzone'
]
=
$tmpcp
;
$config
[
'captiveportal'
][
'cpzone'
][
'zoneid'
]
=
8000
;
$config
[
'captiveportal'
][
'cpzone'
][
'zone'
]
=
"cpzone"
;
if
(
$config
[
'captiveportal'
][
'cpzone'
][
'auth_method'
]
==
"radius"
)
$config
[
'captiveportal'
][
'cpzone'
][
'radius_protocol'
]
=
"PAP"
;
}
if
(
!
empty
(
$config
[
'voucher'
]))
{
$tmpcp
=
$config
[
'voucher'
];
$config
[
'voucher'
]
=
array
();
$config
[
'voucher'
][
'cpzone'
]
=
array
();
$config
[
'voucher'
][
'cpzone'
]
=
$tmpcp
;
}
}
function
upgrade_083_to_084
()
{
global
$config
;
if
(
!
isset
(
$config
[
'hasync'
]))
{
...
...
@@ -2838,42 +2780,6 @@ function upgrade_088_to_089() {
$config
[
'ca'
]
=
array
();
if
(
!
is_array
(
$config
[
'cert'
]))
$config
[
'cert'
]
=
array
();
/* migrate captive portal ssl to certifcate mngr */
if
(
is_array
(
$config
[
'captiveportal'
]))
{
foreach
(
$config
[
'captiveportal'
]
as
$id
=>
&
$setting
)
{
if
(
isset
(
$setting
[
'httpslogin'
]))
{
/* create cert entry */
$cert
=
array
();
$cert
[
'refid'
]
=
uniqid
();
$cert
[
'descr'
]
=
"Captive Portal Cert -
{
$setting
[
'zone'
]
}
"
;
$cert
[
'crt'
]
=
$setting
[
'certificate'
];
$cert
[
'prv'
]
=
$setting
[
'private-key'
];
if
(
!
empty
(
$setting
[
'cacertificate'
]))
{
/* create ca entry */
$ca
=
array
();
$ca
[
'refid'
]
=
uniqid
();
$ca
[
'descr'
]
=
"Captive Portal CA -
{
$setting
[
'zone'
]
}
"
;
$ca
[
'crt'
]
=
$setting
[
'cacertificate'
];
$config
[
'ca'
][]
=
$ca
;
/* add ca reference to certificate */
$cert
[
'caref'
]
=
$ca
[
'refid'
];
}
$config
[
'cert'
][]
=
$cert
;
/* create cert reference */
$setting
[
'certref'
]
=
$cert
[
'refid'
];
unset
(
$setting
[
'certificate'
]);
unset
(
$setting
[
'private-key'
]);
unset
(
$setting
[
'cacertificate'
]);
}
}
}
}
function
upgrade_089_to_090
()
{
...
...
@@ -2923,22 +2829,6 @@ function upgrade_091_to_092() {
}
}
function
upgrade_092_to_093
()
{
$suffixes
=
array
(
"concurrent"
,
"loggedin"
);
foreach
(
$suffixes
as
$suffix
)
{
if
(
file_exists
(
"/var/db/rrd/captiveportal-
{
$suffix
}
.rrd"
))
{
rename
(
"/var/db/rrd/captiveportal-
{
$suffix
}
.rrd"
,
"/var/db/rrd/captiveportal-cpZone-
{
$suffix
}
.rrd"
);
}
}
enable_rrd_graphing
();
}
function
upgrade_093_to_094
()
{
global
$config
;
...
...
@@ -3022,37 +2912,10 @@ function upgrade_098_to_099() {
}
}
function
upgrade_100_to_101
()
{
global
$config
;
if
(
!
is_array
(
$config
[
'voucher'
]))
return
;
foreach
(
$config
[
'voucher'
]
as
$cpzone
=>
$cp
)
{
if
(
!
is_array
(
$cp
[
'roll'
]))
continue
;
foreach
(
$cp
[
'roll'
]
as
$ridx
=>
$rcfg
)
{
if
(
!
empty
(
$rcfg
[
'comment'
]))
$config
[
'voucher'
][
$cpzone
][
'roll'
][
$ridx
][
'descr'
]
=
$rcfg
[
'comment'
];
}
}
}
function
upgrade_101_to_102
()
{
global
$config
;
if
(
is_array
(
$config
[
'captiveportal'
]))
{
foreach
(
$config
[
'captiveportal'
]
as
$cpzone
=>
$cp
)
{
if
(
!
is_array
(
$cp
[
'passthrumac'
]))
continue
;
foreach
(
$cp
[
'passthrumac'
]
as
$idx
=>
$passthrumac
)
$config
[
'captiveportal'
][
$cpzone
][
'passthrumac'
][
$idx
][
'action'
]
=
'pass'
;
}
}
/* Convert OpenVPN Compression option to the new style */
// Nothing to do if there is no OpenVPN tag
if
(
isset
(
$config
[
'openvpn'
])
&&
is_array
(
$config
[
'openvpn'
]))
{
...
...
@@ -3120,23 +2983,6 @@ function upgrade_103_to_104() {
local_sync_accounts
();
}
function
upgrade_104_to_105
()
{
global
$config
;
if
(
is_array
(
$config
[
'captiveportal'
]))
{
$zoneid
=
2
;
foreach
(
$config
[
'captiveportal'
]
as
$cpzone
=>
$cpcfg
)
{
if
(
empty
(
$cpfg
[
'zoneid'
]))
{
$config
[
'captiveportal'
][
$cpzone
][
'zoneid'
]
=
$zoneid
;
$zoneid
+=
2
;
}
else
if
(
$cpcfg
[
'zoneid'
]
>
4000
)
{
$config
[
'captiveportal'
][
$cpzone
][
'zoneid'
]
=
$zoneid
;
$zoneid
+=
2
;
}
}
}
}
function
upgrade_105_to_106
()
{
global
$config
;
...
...
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