Commit f57d3eba authored by Ad Schellevis's avatar Ad Schellevis

(legacy) remove redirects from "easyrules"

parent 86a87273
...@@ -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") ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment