Example #1
0
function firewall_rule_save()
{
    $tpl = new templates();
    $iptables = new iptables_chains();
    $iptables->localport = $_POST["multiples_ports"];
    $iptables->serverip = $_POST["source_address"];
    $iptables->rulemd5 = $_POST["rulemd5"];
    if (!$iptables->add_chain()) {
        echo $tpl->javascript_parse_text("\n{failed}\n");
        return;
    }
    $sock = new sockets();
    $sock->getFrameWork("network.php?fw-inbound-rules=yes");
}
function firewall_range_save(){
	$iptables=new iptables_chains();
	$iptables->localport=$_POST["multiples_ports"];
	$iptables->serverip="Range:{$_POST["range-from"]}-{$_POST["range-to"]}";
	$iptables->rulemd5=null;
	$iptables->allow=$_POST["allow"];
	writelogs("Adding $ipaddr {$_POST["multiple-ports-fw"]}",__FUNCTION__,__FILE__,__LINE__);
	if(!$iptables->add_chain()){echo $tpl->javascript_parse_text("\n{failed}\n");return;}		
		
	
	$sock=new sockets();
	$sock->getFrameWork("network.php?fw-inbound-rules=yes");	
}