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
39273699
Commit
39273699
authored
Jan 25, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) regression rc.filter_synchronize
parent
2de32e8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
rc.filter_synchronize
src/etc/rc.filter_synchronize
+6
-16
No files found.
src/etc/rc.filter_synchronize
View file @
39273699
...
...
@@ -133,12 +133,10 @@ function remove_nosync(&$cnf_structure)
* for example system.user.0 points to the first enty in <system><user> xml config section
* @param array $cnf_structure pointer to config data
* @param string $reference reference pointer (system.user for example)
* @return
bool data found and copied yes/no
* @return
null
*/
function
copy_conf_section
(
&
$cnf_structure_in
,
&
$cnf_structure_out
,
$reference
)
{
$cnf_out_root
=
array
();
$cnf_out
=
&
$cnf_out_root
;
$cnf_path
=
explode
(
'.'
,
$reference
);
$cnf_path_depth
=
1
;
foreach
(
$cnf_path
as
$cnf_section
)
{
...
...
@@ -147,22 +145,16 @@ function copy_conf_section(&$cnf_structure_in, &$cnf_structure_out, $reference)
// for example wireless.clone.0 would only copy the first wireless clone, returns false on not found
$cnf_structure_in
=
&
$cnf_structure_in
[
$cnf_section
];
if
(
$cnf_path_depth
<
count
(
$cnf_path
))
{
if
(
!
isset
(
$cnf_out
[
$cnf_section
]))
{
$cnf_out
[
$cnf_section
]
=
array
();
if
(
!
isset
(
$cnf_
structure_
out
[
$cnf_section
]))
{
$cnf_
structure_
out
[
$cnf_section
]
=
array
();
}
$cnf_
out
=
&
$cnf
_out
[
$cnf_section
];
$cnf_
structure_out
=
&
$cnf_structure
_out
[
$cnf_section
];
}
else
{
$cnf_out
[
$cnf_section
]
=
$cnf_structure_in
;
$cnf_
structure_
out
[
$cnf_section
]
=
$cnf_structure_in
;
}
}
else
{
// reference not found
return
false
;
}
$cnf_path_depth
++
;
}
// only merge result if input data was found
$cnf_structure_out
=
array_merge
(
$cnf_structure_out
,
$cnf_out_root
);
return
true
;
}
/**
...
...
@@ -188,7 +180,6 @@ function carp_sync_xml($url, $username, $password, $sections, $method = 'opnsens
break
;
default
:
copy_conf_section
(
$config
,
$transport_data
,
$section
);
$transport_data
[
$section
]
=
$config
[
$section
];
}
}
...
...
@@ -216,7 +207,6 @@ function carp_sync_xml($url, $username, $password, $sections, $method = 'opnsens
$transport_data
[
'system'
][
'nextgid'
]
=
$config
[
'system'
][
'nextgid'
];
}
$client
=
new
SimpleXMLRPC_Client
(
$url
,
240
);
$client
->
setCredentials
(
$username
,
$password
);
if
(
$client
->
query
(
$method
,
$transport_data
))
{
...
...
@@ -253,7 +243,7 @@ if (isset($config['hasync']) && is_array($config['hasync'])) {
log_error
(
"Config sync not being done because of missing sync IP (this is normal on secondary systems)."
);
exit
;
}
if
(
is_ipaddrv6
(
$hasync
[
'synchronizetoip'
]))
{
if
(
is_ipaddrv6
(
$hasync
[
'synchronizetoip'
]))
{
$hasync
[
'synchronizetoip'
]
=
"[
{
$hasync
[
'synchronizetoip'
]
}
]"
;
}
...
...
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