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
01a83d07
Commit
01a83d07
authored
Jul 06, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) more cleanups
parent
0017f80d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
50 deletions
+42
-50
rc.filter_synchronize
src/etc/rc.filter_synchronize
+23
-22
fbegin.inc
src/www/fbegin.inc
+1
-1
system_hasync.php
src/www/system_hasync.php
+18
-27
No files found.
src/etc/rc.filter_synchronize
View file @
01a83d07
...
@@ -249,6 +249,7 @@ if (file_exists('/var/run/booting')) {
...
@@ -249,6 +249,7 @@ if (file_exists('/var/run/booting')) {
}
}
if
(
is_array
(
$config
[
'hasync'
]))
{
if
(
is_array
(
$config
[
'hasync'
]))
{
$sections
=
array
();
update_filter_reload_status
(
"Building high availability information"
);
update_filter_reload_status
(
"Building high availability information"
);
$hasync
=
$config
[
'hasync'
];
$hasync
=
$config
[
'hasync'
];
...
@@ -273,59 +274,59 @@ if (is_array($config['hasync'])) {
...
@@ -273,59 +274,59 @@ if (is_array($config['hasync'])) {
}
}
if
(
$hasync
[
'synchronizerules'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizerules'
])
)
{
if
(
!
is_array
(
$config
[
'filter'
]))
if
(
!
is_array
(
$config
[
'filter'
]))
$config
[
'filter'
]
=
array
();
$config
[
'filter'
]
=
array
();
$sections
[]
=
'filter'
;
$sections
[]
=
'filter'
;
}
}
if
(
$hasync
[
'synchronizenat'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizenat'
])
)
{
if
(
!
is_array
(
$config
[
'nat'
]))
if
(
!
is_array
(
$config
[
'nat'
]))
$config
[
'nat'
]
=
array
();
$config
[
'nat'
]
=
array
();
$sections
[]
=
'nat'
;
$sections
[]
=
'nat'
;
}
}
if
(
$hasync
[
'synchronizealiases'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizealiases'
])
)
{
if
(
!
is_array
(
$config
[
'aliases'
]))
if
(
!
is_array
(
$config
[
'aliases'
]))
$config
[
'aliases'
]
=
array
();
$config
[
'aliases'
]
=
array
();
$sections
[]
=
'aliases'
;
$sections
[]
=
'aliases'
;
}
}
if
(
$hasync
[
'synchronizedhcpd'
]
!=
""
and
is_array
(
$config
[
'dhcpd'
]))
if
(
isset
(
$hasync
[
'synchronizedhcpd'
])
&&
is_array
(
$config
[
'dhcpd'
]))
$sections
[]
=
'dhcpd'
;
$sections
[]
=
'dhcpd'
;
if
(
$hasync
[
'synchronizewol'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizewol'
])
)
{
if
(
!
is_array
(
$config
[
'wol'
]))
if
(
!
is_array
(
$config
[
'wol'
]))
$config
[
'wol'
]
=
array
();
$config
[
'wol'
]
=
array
();
$sections
[]
=
'wol'
;
$sections
[]
=
'wol'
;
}
}
if
(
$hasync
[
'synchronizestaticroutes'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizestaticroutes'
])
)
{
if
(
!
is_array
(
$config
[
'staticroutes'
]))
if
(
!
is_array
(
$config
[
'staticroutes'
]))
$config
[
'staticroutes'
]
=
array
();
$config
[
'staticroutes'
]
=
array
();
if
(
!
is_array
(
$config
[
'staticroutes'
][
'route'
]))
if
(
!
is
set
(
$config
[
'staticroutes'
][
'route'
])
||
!
is
_array
(
$config
[
'staticroutes'
][
'route'
]))
$config
[
'staticroutes'
][
'route'
]
=
array
();
$config
[
'staticroutes'
][
'route'
]
=
array
();
$sections
[]
=
'staticroutes'
;
$sections
[]
=
'staticroutes'
;
if
(
!
is_array
(
$config
[
'gateways'
]))
if
(
!
is_array
(
$config
[
'gateways'
]))
$config
[
'gateways'
]
=
array
();
$config
[
'gateways'
]
=
array
();
$sections
[]
=
'gateways'
;
$sections
[]
=
'gateways'
;
}
}
if
(
$hasync
[
'synchronizevirtualip'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizevirtualip'
])
)
{
if
(
!
is_array
(
$config
[
'virtualip'
]))
if
(
!
is
set
(
$config
[
'virtualip'
])
||
!
is
_array
(
$config
[
'virtualip'
]))
$config
[
'virtualip'
]
=
array
();
$config
[
'virtualip'
]
=
array
();
$sections
[]
=
'virtualip'
;
$sections
[]
=
'virtualip'
;
}
}
if
(
$hasync
[
'synchronizelb'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizelb'
])
)
{
if
(
!
is_array
(
$config
[
'load_balancer'
]))
if
(
!
is_array
(
$config
[
'load_balancer'
]))
$config
[
'load_balancer'
]
=
array
();
$config
[
'load_balancer'
]
=
array
();
$sections
[]
=
'load_balancer'
;
$sections
[]
=
'load_balancer'
;
}
}
if
(
$hasync
[
'synchronizeipsec'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeipsec'
])
)
{
if
(
!
is_array
(
$config
[
'ipsec'
]))
if
(
!
is_array
(
$config
[
'ipsec'
]))
$config
[
'ipsec'
]
=
array
();
$config
[
'ipsec'
]
=
array
();
$sections
[]
=
'ipsec'
;
$sections
[]
=
'ipsec'
;
}
}
if
(
$hasync
[
'synchronizeopenvpn'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeopenvpn'
])
)
{
if
(
!
is_array
(
$config
[
'openvpn'
]))
if
(
!
is
set
(
$config
[
'openvpn'
])
||
!
is
_array
(
$config
[
'openvpn'
]))
$config
[
'openvpn'
]
=
array
();
$config
[
'openvpn'
]
=
array
();
$sections
[]
=
'openvpn'
;
$sections
[]
=
'openvpn'
;
}
}
if
(
$hasync
[
'synchronizecerts'
]
!=
""
||
$hasync
[
'synchronizeopenvpn'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizecerts'
])
||
isset
(
$hasync
[
'synchronizeopenvpn'
])
)
{
if
(
!
is_array
(
$config
[
'cert'
]))
if
(
!
is_array
(
$config
[
'cert'
]))
$config
[
'cert'
]
=
array
();
$config
[
'cert'
]
=
array
();
$sections
[]
=
'cert'
;
$sections
[]
=
'cert'
;
...
@@ -334,27 +335,27 @@ if (is_array($config['hasync'])) {
...
@@ -334,27 +335,27 @@ if (is_array($config['hasync'])) {
$config
[
'ca'
]
=
array
();
$config
[
'ca'
]
=
array
();
$sections
[]
=
'ca'
;
$sections
[]
=
'ca'
;
if
(
!
is_array
(
$config
[
'crl'
]))
if
(
!
is
set
(
$config
[
'crl'
])
||
!
is
_array
(
$config
[
'crl'
]))
$config
[
'crl'
]
=
array
();
$config
[
'crl'
]
=
array
();
$sections
[]
=
'crl'
;
$sections
[]
=
'crl'
;
}
}
if
(
$hasync
[
'synchronizeusers'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeusers'
])
)
{
$sections
[]
=
'user'
;
$sections
[]
=
'user'
;
$sections
[]
=
'group'
;
$sections
[]
=
'group'
;
}
}
if
(
$hasync
[
'synchronizeauthservers'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeauthservers'
])
)
{
$sections
[]
=
'authserver'
;
$sections
[]
=
'authserver'
;
}
}
if
(
$hasync
[
'synchronizednsforwarder'
]
!=
""
and
is_array
(
$config
[
'dnsmasq'
]))
if
(
isset
(
$hasync
[
'synchronizednsforwarder'
])
&&
is_array
(
$config
[
'dnsmasq'
]))
$sections
[]
=
'dnsmasq'
;
$sections
[]
=
'dnsmasq'
;
if
(
$hasync
[
'synchronizeschedules'
]
!=
""
||
$hasync
[
'synchronizerules'
]
!=
""
)
{
if
(
isset
(
$hasync
[
'synchronizeschedules'
])
||
isset
(
$hasync
[
'synchronizerules'
])
)
{
if
(
!
is_array
(
$config
[
'schedules'
]))
if
(
!
is
set
(
$config
[
'schedules'
])
||
!
is
_array
(
$config
[
'schedules'
]))
$config
[
'schedules'
]
=
array
();
$config
[
'schedules'
]
=
array
();
$sections
[]
=
'schedules'
;
$sections
[]
=
'schedules'
;
}
}
if
(
$hasync
[
'synchronizecaptiveportal'
]
!=
""
and
is_array
(
$config
[
'captiveportal'
]))
if
(
isset
(
$hasync
[
'synchronizecaptiveportal'
])
&&
isset
(
$config
[
'captiveportal'
])
&&
is_array
(
$config
[
'captiveportal'
]))
$sections
[]
=
'captiveportal'
;
$sections
[]
=
'captiveportal'
;
if
(
$hasync
[
'synchronizecaptiveportal'
]
!=
""
and
is_array
(
$config
[
'vouchers'
]))
if
(
isset
(
$hasync
[
'synchronizecaptiveportal'
])
&&
isset
(
$config
[
'vouchers'
])
&&
is_array
(
$config
[
'vouchers'
]))
$sections
[]
=
'vouchers'
;
$sections
[]
=
'vouchers'
;
if
(
count
(
$sections
)
<=
0
)
{
if
(
count
(
$sections
)
<=
0
)
{
...
...
src/www/fbegin.inc
View file @
01a83d07
...
@@ -180,7 +180,7 @@ $pgtitle_output = true;
...
@@ -180,7 +180,7 @@ $pgtitle_output = true;
<?php
<?php
if
(
isset
(
$shortcut_section
)
&&
!
$hide_service_status
&&
!
empty
(
$shortcuts
[
$shortcut_section
][
'service'
]))
{
if
(
isset
(
$shortcut_section
)
&&
!
empty
(
$shortcuts
[
$shortcut_section
][
'service'
]))
{
$ssvc
=
array
();
$ssvc
=
array
();
switch
(
$shortcut_section
)
{
switch
(
$shortcut_section
)
{
case
"openvpn"
:
case
"openvpn"
:
...
...
src/www/system_hasync.php
View file @
01a83d07
...
@@ -31,7 +31,7 @@ require_once("guiconfig.inc");
...
@@ -31,7 +31,7 @@ require_once("guiconfig.inc");
$referer
=
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
'/system_hasync.php'
);
$referer
=
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
'/system_hasync.php'
);
if
(
!
is_array
(
$config
[
'hasync'
]))
{
if
(
!
is
set
(
$config
[
'hasync'
])
||
!
is
_array
(
$config
[
'hasync'
]))
{
$config
[
'hasync'
]
=
array
();
$config
[
'hasync'
]
=
array
();
}
}
...
@@ -52,14 +52,17 @@ $checkbox_names = array('pfsyncenabled',
...
@@ -52,14 +52,17 @@ $checkbox_names = array('pfsyncenabled',
'synchronizestaticroutes'
,
'synchronizestaticroutes'
,
'synchronizelb'
,
'synchronizelb'
,
'synchronizevirtualip'
,
'synchronizevirtualip'
,
'synchronizetrafficshaper'
,
'synchronizednsforwarder'
,
'synchronizednsforwarder'
,
'synchronizecaptiveportal'
);
'synchronizecaptiveportal'
);
if
(
$_POST
)
{
if
(
$_POST
)
{
$pconfig
=
$_POST
;
$pconfig
=
$_POST
;
foreach
(
$checkbox_names
as
$name
)
{
foreach
(
$checkbox_names
as
$name
)
{
$a_hasync
[
$name
]
=
$pconfig
[
$name
]
?
$pconfig
[
$name
]
:
false
;
if
(
isset
(
$pconfig
[
$name
]))
{
$a_hasync
[
$name
]
=
$pconfig
[
$name
];
}
else
{
$a_hasync
[
$name
]
=
false
;
}
}
}
$a_hasync
[
'pfsyncpeerip'
]
=
$pconfig
[
'pfsyncpeerip'
];
$a_hasync
[
'pfsyncpeerip'
]
=
$pconfig
[
'pfsyncpeerip'
];
$a_hasync
[
'pfsyncinterface'
]
=
$pconfig
[
'pfsyncinterface'
];
$a_hasync
[
'pfsyncinterface'
]
=
$pconfig
[
'pfsyncinterface'
];
...
@@ -73,13 +76,19 @@ if ($_POST) {
...
@@ -73,13 +76,19 @@ if ($_POST) {
}
}
foreach
(
$checkbox_names
as
$name
)
{
foreach
(
$checkbox_names
as
$name
)
{
$pconfig
[
$name
]
=
$a_hasync
[
$name
];
if
(
isset
(
$a_hasync
[
$name
]))
{
$pconfig
[
$name
]
=
$a_hasync
[
$name
];
}
else
{
$pconfig
[
$name
]
=
null
;
}
}
foreach
(
array
(
'pfsyncpeerip'
,
'pfsyncinterface'
,
'synchronizetoip'
,
'username'
,
'password'
)
as
$tag
)
{
if
(
isset
(
$a_hasync
[
$tag
]))
{
$pconfig
[
$tag
]
=
$a_hasync
[
$tag
];
}
else
{
$pconfig
[
$tag
]
=
null
;
}
}
}
$pconfig
[
'pfsyncpeerip'
]
=
$a_hasync
[
'pfsyncpeerip'
];
$pconfig
[
'pfsyncinterface'
]
=
$a_hasync
[
'pfsyncinterface'
];
$pconfig
[
'synchronizetoip'
]
=
$a_hasync
[
'synchronizetoip'
];
$pconfig
[
'username'
]
=
$a_hasync
[
'username'
];
$pconfig
[
'password'
]
=
$a_hasync
[
'password'
];
$ifaces
=
get_configured_interface_with_descr
();
$ifaces
=
get_configured_interface_with_descr
();
$ifaces
[
"lo0"
]
=
"loopback"
;
$ifaces
[
"lo0"
]
=
"loopback"
;
...
@@ -331,24 +340,6 @@ include("head.inc");
...
@@ -331,24 +340,6 @@ include("head.inc");
Automatically sync the CARP Virtual IPs to the other HA host when changes are made.
Automatically sync the CARP Virtual IPs to the other HA host when changes are made.
</td>
</td>
</tr>
</tr>
<tr
valign=
"top"
>
<td
width=
"22%"
class=
"vncell"
>
Synchronize traffic shaper(queues)
</td>
<td
class=
"vtable"
>
<input
id=
'synchronizetrafficshaper'
type=
'checkbox'
name=
'synchronizetrafficshaper'
value=
'on'
<?php
if
(
$pconfig
[
'synchronizetrafficshaper'
]
===
"on"
)
{
echo
"checked='checked'"
;
}
?>
/>
Automatically sync the traffic shaper configuration for queues to the other HA host when changes are made.
</td>
</tr>
<tr
valign=
"top"
>
<td
width=
"22%"
class=
"vncell"
>
Synchronize traffic shaper(limiter)
</td>
<td
class=
"vtable"
>
<input
id=
'synchronizetrafficshaperlimiter'
type=
'checkbox'
name=
'synchronizetrafficshaperlimiter'
value=
'on'
<?php
if
(
$pconfig
[
'synchronizetrafficshaperlimiter'
]
===
"on"
)
{
echo
"checked='checked'"
;
}
?>
/>
Automatically sync the traffic shaper configuration for limiters to the other HA host when changes are made.
</td>
</tr>
<tr
valign=
"top"
>
<tr
valign=
"top"
>
<td
width=
"22%"
class=
"vncell"
>
Synchronize DNS Forwarder
</td>
<td
width=
"22%"
class=
"vncell"
>
Synchronize DNS Forwarder
</td>
<td
class=
"vtable"
>
<td
class=
"vtable"
>
...
...
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