inserimento gestione utenze VPN

This commit is contained in:
cmaffio
2016-06-17 12:28:11 +02:00
parent 848720f5c5
commit 3b97704f6d
3 changed files with 118 additions and 14 deletions

View File

@@ -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,