* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ function ShowDeleteRuleForm($table,$chain,$ruleid,$id,$lang,$iptables,$iptsave){ echo "
" ."" ."" ."" ."" ."" .""; $rule=split(" ",getrule($table,$chain,$ruleid,$iptsave)); $ruledetails=""; for ($i=1; $i < count($rule); $i++) $ruledetails.=$rule[$i]." "; $rule=$ruledetails; $exclude="-A $chain "; $ruledetails=str_replace($exclude,"",$ruledetails); echo ""; echo ""; echo "" ."" ."" ."" ."" ."" ."
".strtoupper($lang["delruleheader"])."
".$lang["table"].":$table
".$lang["chain"].":$chain
".$lang["ruleid"].":".($id+1)."
".$lang["ruledetails"].":
$ruledetails
".$lang["confirmdelete"]."
" ." " ." " ."
" ."
"; } function DeleteRule($table,$chain,$id,$rule,$lang,$iptables) { $cmd="$iptables -t $table -D $chain $id"; exec("sudo ".$cmd,$output,$return); echo "" .""; if ($return==0) echo ""; else echo ""; echo "" ."" ."" ."
".$lang["delruleheader"]."
".$lang["success"]."
".$lang["failure"]."
".$lang["command"].":
$cmd
".$lang["othercommand"].":
$iptables -t $table ".str_replace("-A","-D",$rule)."
"; echo ""; } ?>