diff --git a/firewall/firewall_library.php b/firewall/firewall_library.php index f1cf65c..4ac344c 100644 --- a/firewall/firewall_library.php +++ b/firewall/firewall_library.php @@ -2,10 +2,11 @@ function genera () { // $file_in = "/etc/sysconfig/scripts/SuSEfirewall2-custom"; - $file_in = "tmp/fw.new"; - $file_out = "tmp/fw.new"; +// $file_in = "tmp/fw.new"; +// $file_out = "tmp/fw.new"; + $FW_conf = carica_conf ("Firewall"); - $FW = file ($file_in); + $FW = file ($FW_conf['file_in']); $prima = array (); $dopo = array (); $vecchie_u = array (); @@ -51,16 +52,15 @@ function genera () { elimina ($regola); } - $new = array_merge($prima,$nuove_ext[1], $dopo); - file_put_contents ($file_out, $new, LOCK_EX); - + file_put_contents ($FW_conf['file_out'], $new, LOCK_EX); + $comando = "sudo cp ".$FW_conf['file_out']." ".$FW_conf['file_in']; + exec ($comando); } function genera_ext () { - global $UTENTE, $DB_ID, $CONF; + global $UTENTE, $DB_ID, $CONF, $FW_conf; - $FW_conf = carica_conf ("Firewall"); $query = " SELECT firewall_versoesterno_regole.id, diff --git a/firewall/firewall_vpn.php b/firewall/firewall_vpn.php new file mode 100755 index 0000000..14fef75 --- /dev/null +++ b/firewall/firewall_vpn.php @@ -0,0 +1,104 @@ + +
+riga(); +$query = " SELECT + id, + utenza, + tipo, + ip, + DATE_FORMAT(data, '%d.%m.%Y %H:%i:%s') AS data, + attivo + FROM + firewall_vpn + ORDER BY + utenza + "; + +$res = mysql_query( $query, $DB_ID ); +while ($dato = mysql_fetch_array ( $res )) { +?> +
+
+
+
+ 



