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
f57d3eba
Commit
f57d3eba
authored
Jul 08, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) remove redirects from "easyrules"
parent
86a87273
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
diag_logs_filter.php
src/www/diag_logs_filter.php
+6
-18
No files found.
src/www/diag_logs_filter.php
View file @
f57d3eba
...
@@ -45,13 +45,13 @@ function easyrule_find_rule_interface($int) {
...
@@ -45,13 +45,13 @@ function easyrule_find_rule_interface($int) {
/* Borrowed from firewall_rules.php */
/* Borrowed from firewall_rules.php */
$iflist
=
get_configured_interface_with_descr
(
false
,
true
);
$iflist
=
get_configured_interface_with_descr
(
false
,
true
);
if
(
$config
[
'pptpd'
][
'mode'
]
==
"server"
)
if
(
isset
(
$config
[
'pptpd'
][
'mode'
])
&&
$config
[
'pptpd'
][
'mode'
]
==
"server"
)
$iflist
[
'pptp'
]
=
"PPTP VPN"
;
$iflist
[
'pptp'
]
=
"PPTP VPN"
;
if
(
$config
[
'pppoe'
][
'mode'
]
==
"server"
)
if
(
isset
(
$config
[
'pppoe'
][
'mode'
])
&&
$config
[
'pppoe'
][
'mode'
]
==
"server"
)
$iflist
[
'pppoe'
]
=
"PPPoE VPN"
;
$iflist
[
'pppoe'
]
=
"PPPoE VPN"
;
if
(
$config
[
'l2tp'
][
'mode'
]
==
"server"
)
if
(
isset
(
$config
[
'l2tp'
][
'mode'
])
&&
$config
[
'l2tp'
][
'mode'
]
==
"server"
)
$iflist
[
'l2tp'
]
=
"L2TP VPN"
;
$iflist
[
'l2tp'
]
=
"L2TP VPN"
;
/* add ipsec interfaces */
/* add ipsec interfaces */
...
@@ -164,12 +164,11 @@ function easyrule_block_alias_add($host, $int = 'wan') {
...
@@ -164,12 +164,11 @@ function easyrule_block_alias_add($host, $int = 'wan') {
unset
(
$id
);
unset
(
$id
);
$alias
=
array
();
$alias
=
array
();
if
(
is_subnet
(
$host
))
{
if
(
is_subnet
(
$host
))
{
list
(
$host
,
$mask
)
=
explode
(
"/"
,
$host
);
list
(
$host
,
$mask
)
=
explode
(
"/"
,
$host
);
}
elseif
(
is_specialnet
(
$host
))
{
}
elseif
(
is_specialnet
(
$host
))
{
$mask
=
0
;
$mask
=
0
;
}
elseif
(
is_ipaddrv6
(
$host
))
{
}
elseif
(
strpos
(
$host
,
':'
)
!==
false
&&
is_ipaddrv6
(
$host
))
{
$mask
=
128
;
$mask
=
128
;
}
else
{
}
else
{
$mask
=
32
;
$mask
=
32
;
...
@@ -243,12 +242,7 @@ function easyrule_block_host_add($host, $int = 'wan', $ipproto = "inet") {
...
@@ -243,12 +242,7 @@ function easyrule_block_host_add($host, $int = 'wan', $ipproto = "inet") {
if
(
$dirty
)
{
if
(
$dirty
)
{
write_config
();
write_config
();
$retval
=
filter_configure
();
$retval
=
filter_configure
();
if
(
!
empty
(
$_SERVER
[
'DOCUMENT_ROOT'
]))
{
return
true
;
header
(
"Location: firewall_aliases.php"
);
exit
;
}
else
{
return
true
;
}
}
else
{
}
else
{
return
false
;
return
false
;
}
}
...
@@ -313,12 +307,7 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipp
...
@@ -313,12 +307,7 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipp
write_config
(
$filterent
[
'descr'
]);
write_config
(
$filterent
[
'descr'
]);
$retval
=
filter_configure
();
$retval
=
filter_configure
();
if
(
!
empty
(
$_SERVER
[
'DOCUMENT_ROOT'
]))
{
return
true
;
header
(
"Location: firewall_rules.php?if=
{
$int
}
"
);
exit
;
}
else
{
return
true
;
}
}
}
function
easyrule_parse_block
(
$int
,
$src
,
$ipproto
=
"inet"
)
{
function
easyrule_parse_block
(
$int
,
$src
,
$ipproto
=
"inet"
)
{
...
@@ -403,7 +392,6 @@ if (isset($_POST['resolve'])) {
...
@@ -403,7 +392,6 @@ if (isset($_POST['resolve'])) {
}
}
if
(
isset
(
$_POST
[
'easyrule'
]))
{
if
(
isset
(
$_POST
[
'easyrule'
]))
{
require_once
(
"easyrule.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"filter.inc"
);
$response
=
array
(
"status"
=>
"unknown"
)
;
$response
=
array
(
"status"
=>
"unknown"
)
;
...
...
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