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
d335ebf7
Commit
d335ebf7
authored
May 08, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gateways: allow far gateway outside of interface subnet; closes #880
(cherry picked from commit
ed5c0dde
)
parent
facc5f45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
system_gateways_edit.php
src/www/system_gateways_edit.php
+20
-4
No files found.
src/www/system_gateways_edit.php
View file @
d335ebf7
...
@@ -93,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
...
@@ -93,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
}
}
if
(
!
$found
)
{
if
(
!
$found
&&
!
isset
(
$pconfig
[
'fargw'
])
)
{
$input_errors
[]
=
sprintf
(
gettext
(
"The gateway address %1
\$
s does not lie within one of the chosen interface's subnets."
),
$pconfig
[
'gateway'
]);
$input_errors
[]
=
sprintf
(
gettext
(
"The gateway address %1
\$
s does not lie within one of the chosen interface's subnets."
),
$pconfig
[
'gateway'
]);
}
}
}
}
...
@@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
...
@@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
}
}
if
(
!
$found
)
{
if
(
!
$found
&&
!
isset
(
$pconfig
[
'fargw'
])
)
{
$input_errors
[]
=
sprintf
(
gettext
(
"The gateway address %1
\$
s does not lie within one of the chosen interface's subnets."
),
$pconfig
[
'gateway'
]);
$input_errors
[]
=
sprintf
(
gettext
(
"The gateway address %1
\$
s does not lie within one of the chosen interface's subnets."
),
$pconfig
[
'gateway'
]);
}
}
}
}
...
@@ -402,12 +402,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
...
@@ -402,12 +402,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$gateway
[
$fieldname
]
=
$pconfig
[
$fieldname
];
$gateway
[
$fieldname
]
=
$pconfig
[
$fieldname
];
}
}
}
}
if
(
isset
(
$_POST
[
'disabled'
]))
{
if
(
isset
(
$_POST
[
'disabled'
]))
{
$gateway
[
'disabled'
]
=
true
;
$gateway
[
'disabled'
]
=
true
;
}
else
{
}
else
if
(
isset
(
$gateway
[
'disabled'
]))
{
unset
(
$gateway
[
'disabled'
]);
unset
(
$gateway
[
'disabled'
]);
}
}
if
(
isset
(
$_POST
[
'fargw'
]))
{
$gateway
[
'fargw'
]
=
true
;
}
elseif
(
isset
(
$gateway
[
'fargw'
]))
{
unset
(
$gateway
[
'fargw'
]);
}
/* when saving the manual gateway we use the attribute which has the corresponding id */
/* when saving the manual gateway we use the attribute which has the corresponding id */
if
(
isset
(
$realid
))
{
if
(
isset
(
$realid
))
{
$a_gateway_item
[
$realid
]
=
$gateway
;
$a_gateway_item
[
$realid
]
=
$gateway
;
...
@@ -459,7 +466,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
...
@@ -459,7 +466,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$copy_fields
=
array
(
$copy_fields
=
array
(
'name'
,
'weight'
,
'interval'
,
'avg_delay_samples'
,
'avg_loss_samples'
,
'avg_loss_delay_samples'
,
'name'
,
'weight'
,
'interval'
,
'avg_delay_samples'
,
'avg_loss_samples'
,
'avg_loss_delay_samples'
,
'interface'
,
'friendlyiface'
,
'ipprotocol'
,
'gateway'
,
'latencylow'
,
'latencyhigh'
,
'losslow'
,
'losshigh'
,
'interface'
,
'friendlyiface'
,
'ipprotocol'
,
'gateway'
,
'latencylow'
,
'latencyhigh'
,
'losslow'
,
'losshigh'
,
'down'
,
'monitor'
,
'descr'
,
'avg_delay_samples_calculated'
,
'avg_loss_samples_calculated'
,
'down'
,
'monitor'
,
'descr'
,
'avg_delay_samples_calculated'
,
'avg_loss_samples_calculated'
,
'fargw'
,
'avg_loss_delay_samples_calculated'
,
'monitor_disable'
,
'dynamic'
,
'defaultgw'
,
'force_down'
,
'disabled'
'avg_loss_delay_samples_calculated'
,
'monitor_disable'
,
'dynamic'
,
'defaultgw'
,
'force_down'
,
'disabled'
);
);
foreach
(
$copy_fields
as
$fieldname
)
{
foreach
(
$copy_fields
as
$fieldname
)
{
...
@@ -633,6 +640,15 @@ $( document ).ready(function() {
...
@@ -633,6 +640,15 @@ $( document ).ready(function() {
</div>
</div>
</td>
</td>
</tr>
</tr>
<tr>
<td><a
id=
"help_for_fargw"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Far Gateway"
);
?>
</td>
<td>
<input
name=
"fargw"
type=
"checkbox"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'fargw'
])
?
'checked="checked"'
:
''
;
?>
/>
<div
class=
"hidden"
for=
"help_for_fargw"
>
<?=
gettext
(
"This will allow the gateway to exist outside of the interface subnet."
);
?>
</div>
</td>
</tr>
<tr>
<tr>
<td><a
id=
"help_for_monitor_disable"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Disable Gateway Monitoring"
);
?>
</td>
<td><a
id=
"help_for_monitor_disable"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Disable Gateway Monitoring"
);
?>
</td>
<td>
<td>
...
...
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