From 491ad48f7126a7b429277ab2fc2836b340a2fe51 Mon Sep 17 00:00:00 2001 From: Claudio Maffioletti Date: Mon, 24 Jul 2017 12:28:44 +0200 Subject: [PATCH] fix per proxy --- condes/index.php | 9 ++- firewall/firewall_regole_versointerno.php | 2 +- firewall/firewall_regoleinterno.php | 11 ++- firewall/index.php | 5 +- proxy/pool_ip.php | 96 ++++++++++++++--------- 5 files changed, 80 insertions(+), 43 deletions(-) diff --git a/condes/index.php b/condes/index.php index 6296e7e..24f020b 100644 --- a/condes/index.php +++ b/condes/index.php @@ -85,6 +85,12 @@ $tabella = new html (0,"90%",array(15,2,20,2,15,2,5,0)); riga (); +if ($DIRITTI < 10) { + $admin = " AND utenti.id = ".$UTENTE['id']; +} else { + $admin = ""; +} + $query = " SELECT condes_regole.id, condes_regole.stato, @@ -98,8 +104,7 @@ $query = " SELECT utenti ON condes_regole.id_utenti = utenti.id - AND - utenti.id = ".$UTENTE['id']." + $admin JOIN condes_macchine ON diff --git a/firewall/firewall_regole_versointerno.php b/firewall/firewall_regole_versointerno.php index 86ab79a..d40f9fb 100755 --- a/firewall/firewall_regole_versointerno.php +++ b/firewall/firewall_regole_versointerno.php @@ -62,7 +62,7 @@ $query = " SELECT "; $res_macchine = mysql_query( $query, $DB_ID ); -$tabella = new html (0,"90%",array(3,3,2,15,2,15,2,5,0)); +$tabella = new html (0,"90%",array(3,3,2,15,2,30,2,5,0)); ?>
diff --git a/firewall/firewall_regoleinterno.php b/firewall/firewall_regoleinterno.php index 480ab67..c145e3f 100755 --- a/firewall/firewall_regoleinterno.php +++ b/firewall/firewall_regoleinterno.php @@ -65,7 +65,7 @@ $query = " SELECT $res_ip = mysql_query( $query, $DB_ID ); while( $row = mysql_fetch_assoc( $res_ip) ) { $listaportefw[] = $row['fw_port']; } -$tabella = new html (0,"90%",array(3,3,2,15,2,15,5,2,15,5,2,5,2,15,0)); +$tabella = new html (0,"90%",array(3,3,2,15,2,15,8,2,15,5,2,5,2,15,0)); ?> @@ -96,8 +96,13 @@ $tabella = new html (0,"90%",array(3,3,2,15,2,15,5,2,15,5,2,5,2,15,0)); diff --git a/firewall/index.php b/firewall/index.php index 97d24fe..4da6e77 100755 --- a/firewall/index.php +++ b/firewall/index.php @@ -103,7 +103,7 @@ if (isset($_POST['regola'])) { if ($modificato) attiva_aggiornamento(); } -$tabella = new html (0,"90%",array(15,2,30,2,5,0)); +$tabella = new html (0,"90%",array(15,2,50,2,5,0)); ?> @@ -163,6 +163,7 @@ $query = " SELECT ORDER BY firewall_versointerno.nome "; + $res = mysql_query( $query, $DB_ID ); while ($dato = mysql_fetch_array ( $res )) { ?> @@ -192,7 +193,7 @@ while ($dato = mysql_fetch_array ( $res )) { ?> } else { print $dato['int_ip']; } - print ":".$dato['fw_port']." (".$dato['proto'].")";; + print ":".$dato['int_port']." (".$dato['proto'].")";; ?> diff --git a/proxy/pool_ip.php b/proxy/pool_ip.php index 1975d24..87c2142 100755 --- a/proxy/pool_ip.php +++ b/proxy/pool_ip.php @@ -7,7 +7,7 @@ view_top(); = DATE_SUB(NOW(), INTERVAL 1 $tempo) - UNION SELECT - proxy_pool.attivo, - proxy_dati_storico.ip, - proxy_pool.nome, + proxy_dati.data_destroy >= DATE_SUB(NOW(), INTERVAL 1 $tempo) + "; + + $query2 = " SELECT MIN(proxy_dati_storico.data_destroy) AS first, MAX(proxy_dati_storico.data_destroy) AS last, SUM(proxy_dati_storico.inviati) AS inviati, SUM(proxy_dati_storico.ricevuti) AS ricevuti FROM proxy_dati_storico - JOIN - proxy_pool - ON - proxy_dati_storico.ip = proxy_pool.ip WHERE - proxy_pool.id = $id + ip = '".$pool['ip']."' AND proxy_dati_storico.data_destroy >= DATE_SUB(NOW(), INTERVAL 1 $tempo) "; - $res = mysql_query( $query, $DB_ID ); - $dato1 = mysql_fetch_array ( $res ); - $dato2 = mysql_fetch_array ( $res ); + $res1 = mysql_query( $query1, $DB_ID ); + $data1 = mysql_fetch_array ( $res1 ); + $res2 = mysql_query( $query2, $DB_ID ); + $data2 = mysql_fetch_array ( $res2 ); + + if (is_null ($data1['first'])) { + $first = $data2['first']; + } elseif (is_null ($data2['first'])) { + $first = $data1['first']; + } else { + $first = min ($data1['first'], $data2['first']); + } + + if (is_null ($data1['last'])) { + $last = $data2['last']; + } elseif (is_null ($data2['last'])) { + $last = $data1['last']; + } else { + $last = max ($data1['last'], $data2['last']); + } ?> @@ -88,34 +106,34 @@ $tabella->intestazione (array("", "IP", "", "Nome", "", "", "Inizio dati", "", " ?> - Utente limitato + Utente limitato - Utente non limitato + Utente non limitato - + - - + + - + - + - + - + riga(); ?> - &tempo="> + riga(); } else { @@ -144,9 +162,17 @@ $tabella->riga(); if ($error_code == 1062) { ?>
Indirizzo IP gia' esistente
+ } else { + $query = "SELECT id FROM proxy_pool WHERE ip = '$ip'"; + $res = mysql_query( $query, $DB_ID ); + $ritorno = mysql_fetch_array ( $res ); + + + + +?>