diff --git a/DBDiff/condex.sql b/DBDiff/condex.sql new file mode 100644 index 0000000..1a2af9a --- /dev/null +++ b/DBDiff/condex.sql @@ -0,0 +1,43 @@ +ALTER TABLE `proxy_pool` ADD `nome` VARCHAR(64) NULL AFTER `id`; + +CREATE TABLE `condes_utenti` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `utente` varchar(32) NOT NULL, + `pwd` varchar(64) NOT NULL, + `data` datetime NOT NULL, + `attivo` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + +CREATE TABLE `condes_macchine` ( + `id` BIGINT NOT NULL AUTO_INCREMENT , + `id_proxy_pool` BIGINT NOT NULL , + `data` DATETIME NOT NULL , + `attivo` BOOLEAN NOT NULL , + PRIMARY KEY (`id`) +) ENGINE = InnoDB; + +CREATE TABLE `condes_regole` ( + `id` BIGINT NOT NULL AUTO_INCREMENT , + `id_utenti` BIGINT NOT NULL , + `id_condes_macchine` BIGINT NOT NULL , + `id_proxy_acl_list` BIGINT NOT NULL , + `permanente` BOOLEAN NOT NULL , + `data` DATETIME NOT NULL , + `attivo` BOOLEAN NOT NULL , + `stato` int(11) DEFAULT 0 , + `modifica` DATETIME NOT NULL , + PRIMARY KEY (`id`) +) ENGINE = InnoDB; + +CREATE TABLE `condes_logs` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `id_utenti` bigint(20) NOT NULL, + `id_condes_regole` bigint(20) NOT NULL, + `stato` int(11) NOT NULL, + `data` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + +GRANT SELECT, UPDATE (`stato`) ON `pannello_vbc`.`condes_regole` TO 'pannello_proxy'@'%'; +GRANT SELECT ON `pannello_vbc`.`condes_macchine` TO 'pannello_proxy'@'%'; diff --git a/condes/condes_gest.php b/condes/condes_gest.php new file mode 100755 index 0000000..eaf064d --- /dev/null +++ b/condes/condes_gest.php @@ -0,0 +1,118 @@ + + + + + + + + + + + + diff --git a/condes/condes_logs.php b/condes/condes_logs.php new file mode 100755 index 0000000..93a755c --- /dev/null +++ b/condes/condes_logs.php @@ -0,0 +1,162 @@ + 0) { + $idutente = $_POST['idutente']; + $queryutente = "AND utenti.id = $idutente"; +} else { + $idutente = 0; + $queryutente = ""; +} + +if (isset($_POST['idip']) && $_POST['idip'] > 0) { + $idip = $_POST['idip']; + $queryip = "AND proxy_pool.id = $idip"; +} else { + $idip = 0; + $queryip = ""; +} + +$stato = array ("Disattivo", "Attivo", "Permanente"); + +$query_user = " SELECT + utenti.id, + utenti.utente + FROM + utenti + JOIN + permessi + ON + permessi.id_utenti = utenti.id + WHERE + permessi.id_moduli = ".$MODULO['id']." + ORDER BY + utente +"; +$res_user = mysql_query( $query_user, $DB_ID ); + +$query_ip = " SELECT + condes_macchine.id_proxy_pool AS id, + proxy_pool.nome, + proxy_pool.ip + FROM + condes_macchine + JOIN + proxy_pool + ON + condes_macchine.id_proxy_pool = proxy_pool.id + ORDER BY + -proxy_pool.nome DESC, + INET_ATON(proxy_pool.ip) ASC +"; +$res_ip = mysql_query( $query_ip, $DB_ID ); + +?> + +
+ + + + + + + + + + + + + + + + +riga(); +$tabella->intestazione (array("", "Data", "", "Utente", "", "Macchina", "", "ACL", "", "Stato", "")); + +$query = " SELECT + condes_logs.id, + condes_logs.stato, + DATE_FORMAT(condes_logs.data, '%d.%m.%Y %H:%i:%s') AS data, + utenti.utente, + proxy_pool.nome AS nome_pool, + proxy_pool.ip, + proxy_acl_list.nome + FROM + condes_logs + JOIN + utenti + ON + condes_logs.id_utenti = utenti.id + $queryutente + JOIN + condes_regole + ON + condes_logs.id_condes_regole = condes_regole.id + JOIN + proxy_acl_list + ON + condes_regole.id_proxy_acl_list = proxy_acl_list.id + JOIN + condes_macchine + ON + condes_regole.id_condes_macchine = condes_macchine.id + JOIN + proxy_pool + ON + condes_macchine.id_proxy_pool = proxy_pool.id + $queryip + WHERE + condes_logs.data >= DATE_SUB(NOW(), INTERVAL 1 $tempo) + ORDER BY + condes_logs.data DESC +"; + +$res = mysql_query( $query, $DB_ID ); +while ($dato = mysql_fetch_array ( $res )) { +?> + + + + + + + + + + + + + + +close(); +?> +
+ diff --git a/condes/condes_macchine.php b/condes/condes_macchine.php new file mode 100755 index 0000000..8c61fa4 --- /dev/null +++ b/condes/condes_macchine.php @@ -0,0 +1,101 @@ + +
+ + + + + + + + +
+ + + + + Utente attivo + + Utente non attivo + + + + + IP + + Nome + + Ultima Modifica + + + + + + + + + + +riga (); +} +$tabella->close(); +view_footer(); +?> diff --git a/condes/condes_regole.php b/condes/condes_regole.php new file mode 100755 index 0000000..22e9cda --- /dev/null +++ b/condes/condes_regole.php @@ -0,0 +1,194 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + Utente attivo + + Utente non attivo + + + + + Utenza + + Macchina + + ACL + + Perm + + + + + + + + + + + + +riga(); +} +$tabella->close(); +view_footer(); +?> diff --git a/condes/condes_utenti.php b/condes/condes_utenti.php new file mode 100755 index 0000000..93a6f0a --- /dev/null +++ b/condes/condes_utenti.php @@ -0,0 +1,91 @@ + + + + + + + + Utente attivo + + Utente non attivo + + + + Utente + + Creazione + + Ultima Modifica + + Ultimo accesso + + Numero accessi + + Gestione regole + + + + + + + + + + + + + + Grafico Utilizzo + +riga (); +} +$tabella->close (); +view_footer(); +?> diff --git a/condes/index.php b/condes/index.php index e69de29..6296e7e 100644 --- a/condes/index.php +++ b/condes/index.php @@ -0,0 +1,156 @@ + $valore) { + if (preg_match ("/^new-(\d+)/", $id, $ris)) $new[$ris[1]] = $valore; + if (preg_match ("/^old-(\d+)/", $id, $ris)) $old[$ris[1]] = $valore; + } + + foreach ($new as $id => $valore) { + if ($new[$id] == $old[$id]) continue; + + if ($valore >1) + $stato = 1; + else + $stato = $valore; + + $query = " SELECT + condes_regole.id_condes_macchine, + condes_regole.id_proxy_acl_list, + condes_macchine.id_proxy_pool + FROM + condes_regole + JOIN + condes_macchine + ON + condes_regole.id_condes_macchine = condes_macchine.id + WHERE + condes_regole.id = $id + "; + $res = mysql_query( $query, $DB_ID ); + $dato = mysql_fetch_array ( $res ); + + $query = " UPDATE + condes_regole + SET + stato = $valore, + modifica = NOW() + WHERE + id_condes_macchine = ".$dato['id_condes_macchine']." + AND + id_proxy_acl_list = ".$dato['id_proxy_acl_list']; + $res = mysql_query( $query, $DB_ID ); + + $query = " INSERT INTO + proxy_acl_ip + SET + idacllist = ".$dato['id_proxy_acl_list'].", + idpool = ".$dato['id_proxy_pool'].", + stato = $stato, + data = NOW() + ON DUPLICATE KEY UPDATE + stato = $stato, + data = NOW() + "; + $res = mysql_query( $query, $DB_ID ); + + $query = " INSERT INTO + condes_logs + SET + id_utenti = ".$UTENTE['id'].", + id_condes_regole = $id, + stato = $valore, + data = NOW() + "; + $res = mysql_query( $query, $DB_ID ); + } +} + +$tabella = new html (0,"90%",array(15,2,20,2,15,2,5,0)); +?> +
+ + + + + + +riga (); + +$query = " SELECT + condes_regole.id, + condes_regole.stato, + proxy_pool.nome, + proxy_pool.ip, + proxy_acl_list.nome AS acl, + condes_regole.permanente + FROM + condes_regole + JOIN + utenti + ON + condes_regole.id_utenti = utenti.id + AND + utenti.id = ".$UTENTE['id']." + JOIN + condes_macchine + ON + condes_regole.id_condes_macchine = condes_macchine.id + JOIN + proxy_pool + ON + condes_macchine.id_proxy_pool = proxy_pool.id + JOIN + proxy_acl_list + ON + condes_regole.id_proxy_acl_list = proxy_acl_list.id + WHERE + condes_regole.attivo = 1 + ORDER BY + -proxy_pool.nome DESC, + proxy_pool.ip + "; + +$res = mysql_query( $query, $DB_ID ); +while ($dato = mysql_fetch_array ( $res )) { +?> + + + + + + + Macchina + + ACL + + Perm + + + + + + + +riga (); +} ?> +
+close (); +view_footer(); +?> diff --git a/condes/script/condes.conf b/condes/script/condes.conf new file mode 100644 index 0000000..875246a --- /dev/null +++ b/condes/script/condes.conf @@ -0,0 +1,6 @@ +our $DBhost = '127.0.0.1'; +our $DBname = 'pannello_vbc'; +our $DBuser = 'pannello_proxy'; +our $DBpass = 'CuQlM1lfF4VZDCIP'; + +return 1; diff --git a/condes/script/condes.pl b/condes/script/condes.pl new file mode 100755 index 0000000..f033a69 --- /dev/null +++ b/condes/script/condes.pl @@ -0,0 +1,96 @@ +#!/usr/bin/perl +$|=1; + +use DBI; +use FindBin qw($Bin); + +my $param = shift @ARGV; + +our $verbose = 0; +if ($param eq '-v') { + $verbose = 1; +} elsif ($param eq '-vv') { + $verbose = 2; +} + +require "$Bin/condes.conf"; + +my $dbmysql = DBI->connect("DBI:mysql:;host=$DBhost", $DBuser, $DBpass) or die ($DBI::errstr); +$sts = $dbmysql->prepare("use $DBname"); +$sts->execute (); + +$query = " SELECT + condes_regole.id, + condes_regole.id_condes_macchine, + condes_regole.id_proxy_acl_list, + condes_macchine.id_proxy_pool, + proxy_pool.ip, + proxy_pool.nome, + proxy_acl_list.nome AS acl + FROM + condes_regole + JOIN + condes_macchine + ON + condes_regole.id_condes_macchine = condes_macchine.id + JOIN + proxy_pool + ON + condes_macchine.id_proxy_pool = proxy_pool.id + JOIN + proxy_acl_list + ON + condes_regole.id_proxy_acl_list = proxy_acl_list.id + WHERE + condes_regole.stato = 1 +"; + +$sts = $dbmysql->prepare($query); +$sts->execute (); +while ( $ref = $sts->fetchrow_hashref ) { + $id = $$ref{'id'}; + $condes_macchine = $$ref{'id_condes_macchine'}; + $proxy_acl_list = $$ref{'id_proxy_acl_list'}; + $proxy_pool = $$ref{'id_proxy_pool'}; + $proxy_pool_ip = $$ref{'ip'}; + $proxy_pool_nome = $$ref{'nome'}; + $acl = $$ref{'acl'}; + + printf "Rimosso %-15s (%-10s) con lista %s\n", $proxy_pool_ip, $proxy_pool_nome, $acl if ($verbose); + + $query = " UPDATE + proxy_acl_ip + SET + stato = 0, + data = NOW() + WHERE + idacllist = $proxy_acl_list + AND + idpool = $proxy_pool + "; + my $sts = $dbmysql->prepare($query); $sts->execute (); + + $query = " INSERT INTO + condes_logs + SET + id_utenti = 0, + id_condes_regole = $id, + stato = 0, + data = NOW() + "; + $sts = $dbmysql->prepare($query); $sts->execute (); + + $query = " UPDATE + condes_regole + SET + stato = 0, + modifica = NOW() + WHERE + id_condes_macchine = $condes_macchine + AND + id_proxy_acl_list = $proxy_acl_list + "; + $sts = $dbmysql->prepare($query); $sts->execute (); +} + +exit; diff --git a/core/chkpasswd.php b/core/chkpasswd.php index a9ed4a2..4f91bd9 100755 --- a/core/chkpasswd.php +++ b/core/chkpasswd.php @@ -19,32 +19,23 @@ if (isset ($_POST['id'])) { $testo = "L'utente e' stato correttamente modificato"; $query = "UPDATE utenti SET $querypwd modifica = NOW(), mail='$mail' WHERE `id`=$id"; + + $tabella = new html (0,"90%", array (0)); + $tabella->riga(); + + if (mysql_query( $query, $DB_ID )) { + $testo = "L'utente e' stato correttamente modificato"; + } else { + $testo = "Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: ".mysql_error(); + } ?> - - - - - - - - - - - - - - -
+
- -
- -Non e' stato possibile eseguire l'operazione richiesta a causa di un errore:
-
- -
- +riga(); + $tabella->close(); } else { $bottone = "Modifica"; @@ -54,11 +45,8 @@ Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: - - - +if (($modifica == 0 || $modifica == 1) && !isset($_GET['rm'])) { ?> @@ -110,31 +98,34 @@ $(document).ready(function()
- + - + + - + - +riga(); ?> - + + - + - +riga(); ?> - - - +riga(); ?> - -
Nome Utente
- + - + - - - + + + +riga(); ?> - + - - - + + + + - -
+ +
+
 
@@ -142,29 +133,33 @@ $(document).ready(function()
 
+close(); ?>
   
+riga(); +$tabella->close(); +?>
- - - + diff --git a/core/conf.php b/core/conf.php index 85a0a8f..7fe5de3 100755 --- a/core/conf.php +++ b/core/conf.php @@ -2,24 +2,22 @@ include_once ("config.php"); $UTENTE = login(); isadmin(); - view_top(); -?> - - +$tabella = new html (0,"90%", array(2,20,2,30,2,40,0)); +?> - - - - - - + + + + + + - - riga(); + $query = "SELECT * FROM conf WHERE vis=1 ORDER BY ordine"; $res = mysql_query( $query, $DB_ID ); while ($dato = mysql_fetch_array ( $res )) { @@ -49,16 +47,18 @@ while ($dato = mysql_fetch_array ( $res )) { if ($visualizza) { ?> - - - - - - + + + + + + - - -
CampoValoreNotaCampoValoreNota
- +riga(); + } +} +$tabella->close(); +view_footer (); +?> diff --git a/core/config.php b/core/config.php index a6339c7..732768b 100755 --- a/core/config.php +++ b/core/config.php @@ -8,4 +8,6 @@ $db_data_pwd = "Lx7w3e8dNPfwwc3z"; require_once ("function.php"); $DB_ID = db_data_connect (); $CONF = carica_conf(); +$MODULO = modulo(); + ?> diff --git a/core/footer.php b/core/footer.php index b8d7df7..6ef38b2 100755 --- a/core/footer.php +++ b/core/footer.php @@ -1,6 +1,9 @@ - +riga(); +?> @@ -10,7 +13,7 @@ -
    
+close(); ?> diff --git a/core/function.php b/core/function.php index c5c269c..f857d31 100755 --- a/core/function.php +++ b/core/function.php @@ -395,7 +395,7 @@ function home_moduli () { $menu = array_moduli(); - html_spazi (array (5,30,0)); + $tabella = new html (0,"90%", array (5,30,0)); for ($i=1; $i @@ -403,10 +403,8 @@ function home_moduli () { - - - close (); } function lista_moduli () { @@ -464,6 +462,30 @@ function lista_moduli () { "; - $somma = 0; - foreach ($dati as $riga) { - if (!$riga) { - $riga = 100 - $somma; - } else { - $somma += $riga; - } -?> - -"; -} + $this->conf = $CONF; + $this->size = count ($dati); -function html_intestazione ($dati, $tipo = array ()) { - global $CONF; - - print ""; - foreach ($dati as $key => $riga) { - if ($riga == "") { - $riga = " "; + if ($align != "") $align = "align=\"$align\""; + print "\n"; + print "\t\n"; + $somma = 0; + foreach ($dati as $riga) { + if (!$riga) { + $riga = 100 - $somma; + } else { + $somma += $riga; + } + print "\t\t\n"; } + print "\t\n"; + } - if (isset ($tipo[$key]) && $tipo[$key] != "") { - $classe = $tipo[$key]; - } else { - $classe = "descrizione"; + public function intestazione ($dati, $tipo = array ()) { + + print "\t\n"; + foreach ($dati as $key => $riga) { + if ($riga == "") { + $riga = " "; + } + + if (isset ($tipo[$key]) && $tipo[$key] != "") { + $classe = $tipo[$key]; + } else { + $classe = "descrizione"; + } + print "\t\t\n"; } -?> - -"; + print "\t\n"; + } + + public function riga () { + print "\t\n"; + } + + public function close () { + print "
conf['base_url']."/img/spazio.gif\">
$riga
size\">conf['base_url']."/img/spazio.gif\">
\n"; + } + + public function td_vuoto () { + } + + public function bottoni () { + } + } ?> diff --git a/core/main.php b/core/main.php index e38aeeb..6e6181e 100755 --- a/core/main.php +++ b/core/main.php @@ -6,10 +6,7 @@ view_top(); - - -
diff --git a/core/modconf.php b/core/modconf.php index d457128..3679d16 100755 --- a/core/modconf.php +++ b/core/modconf.php @@ -14,7 +14,7 @@ if (isset ($_GET['var'])) {
- + @@ -22,8 +22,7 @@ if (isset ($_GET['var'])) { - - +riga(); ?> @@ -31,8 +30,7 @@ if (isset ($_GET['var'])) { - - +riga(); ?> @@ -61,16 +59,17 @@ if (isset ($_GET['var'])) { - - +riga(); ?> - -
Variabile
Commento
Valore
   
+riga(); +$tabella->close(); +?>
- + -
- - +close(); + } else { +$tabella = new html (1, "90%", array(0)); ?> close(); } +view_footer(); ?> - diff --git a/core/top.php b/core/top.php index 46c9232..c96bc81 100755 --- a/core/top.php +++ b/core/top.php @@ -5,17 +5,19 @@ -
Operazione non permessa
+ + + + + + + + + + +riga(); ?> + + + + + + +close(); ?> diff --git a/proxy/acl_edit.php b/proxy/acl_edit.php index 6e1b218..fd50d92 100755 --- a/proxy/acl_edit.php +++ b/proxy/acl_edit.php @@ -49,12 +49,10 @@ if (isset($_POST['rif']) && $_POST['rif'] != "") { } else { $id = 0; } -//print $query; ?> -
- + - - + + -
Utente:  LogoutLogout
+close(); ?>
diff --git a/core/userlogin.php b/core/userlogin.php index f6eb101..0b9180b 100755 --- a/core/userlogin.php +++ b/core/userlogin.php @@ -1,23 +1,24 @@
- - - - - - - - - - - - - - - - - - -

" />
+ +

" />
intestazione (array("","","Nome ACL","","Ultima Modifica","")); ?> - - - - - - - - +riga(); ?> - - - + + + + + + + + + + + + +close(); ?> + - + - - +riga(); +?> @@ -142,9 +135,8 @@ if ($dato['attivo']) { - - - +riga(); + while ($dato = mysql_fetch_array ( $res )) { ?> @@ -158,8 +150,8 @@ if ($dato['attivo']) { -
Nome ACLUltima Modifica
- - - - - - - - - - - - -
DefaultNegaDefaultAutorizza
> > >
-
+ +
DefaultNegaDefaultAutorizza
> > >
Nuova destinazione
+} +$tabella->close(); +?> - diff --git a/proxy/acl_lista.php b/proxy/acl_lista.php index a87e124..5b6e93c 100755 --- a/proxy/acl_lista.php +++ b/proxy/acl_lista.php @@ -6,15 +6,16 @@ view_top(); ?>
- - + - riga(); $query = " SELECT proxy_acl_list.id, proxy_acl_list.sys, @@ -80,11 +81,10 @@ while ($dato = mysql_fetch_array ( $res )) { - - -
+$tabella->riga(); +} +$tabella->close(); +?>
- diff --git a/proxy/index.php b/proxy/index.php index 9872256..ba4858c 100755 --- a/proxy/index.php +++ b/proxy/index.php @@ -4,31 +4,41 @@ $UTENTE = login(); $DIRITTI = diritti('Utente'); view_top(); ?> - - - - - + - + - + + + @@ -56,10 +69,9 @@ while ($dato = mysql_fetch_array ( $res )) { - - -
Utente non limitato DettaglioDettaglio class="colip"> Inviati
Ricevuti
- - +$tabella->riga(); +} +$tabella->close(); +view_footer(); +?> diff --git a/proxy/net_acl.php b/proxy/net_acl.php index 64569eb..bc15cdc 100755 --- a/proxy/net_acl.php +++ b/proxy/net_acl.php @@ -77,11 +77,11 @@ function do_submit() { }
-intestazione (array ("","Rete","","Nega","Default","Autorizza","","Nome Lista",""), array("","","","radio","radio","radio","","","")); + $res = mysql_query( $query, $DB_ID ); $conta = 0; while ($dato = mysql_fetch_array ( $res )) { @@ -98,8 +98,9 @@ while ($dato = mysql_fetch_array ( $res )) { -
+} +$tabella->riga(); +$tabella->close(); +?>
- diff --git a/proxy/net_edit.php b/proxy/net_edit.php index 3d0e7c6..4ff658a 100755 --- a/proxy/net_edit.php +++ b/proxy/net_edit.php @@ -38,7 +38,6 @@ if (isset($_POST['id'])) { ?>
- - - - - - - - - - - - +$tabella = new html (0,"90%",array(3,20,2,20,2,15,2,15,0)); +$tabella->intestazione (array("","Rete","","NetMask","","Data attivazione","","Ultima Modifica","")); +?> - - +riga(); ?> - -
ReteNetMaskData attivazioneUltima Modifica
+close(); ?>
- diff --git a/proxy/net_lista.php b/proxy/net_lista.php index fc2129c..c2b03e1 100755 --- a/proxy/net_lista.php +++ b/proxy/net_lista.php @@ -5,15 +5,16 @@ $DIRITTI = diritti('Admin'); view_top(); ?>
- - + - riga(); $query = " SELECT id, attivo, @@ -54,11 +55,10 @@ while ($dato = mysql_fetch_array ( $res )) { - - -
+$tabella->riga(); +} +$tabella->close(); +?>
- diff --git a/proxy/pool_acl.php b/proxy/pool_acl.php index 372d9fa..ee62ca6 100755 --- a/proxy/pool_acl.php +++ b/proxy/pool_acl.php @@ -76,30 +76,11 @@ function do_submit() { }
- +intestazione (array("","Indirizzo IP","","Nega","Default","Autorizza","","Nome Lista",""), array("","","","radio","radio","radio","","","")); +?> - - - - - - - - - - - - - - - - - - - - - - -
Indirizzo IPNegaDefaultAutorizzaNome Lista
+} +$tabella->riga(); +$tabella->close(); +?>
- diff --git a/proxy/pool_ip.php b/proxy/pool_ip.php index db2d7c0..0f05881 100755 --- a/proxy/pool_ip.php +++ b/proxy/pool_ip.php @@ -5,11 +5,22 @@ $DIRITTI = diritti('Admin'); view_top(); ?>
- - = DATE_SUB(NOW(), INTERVAL 1 $tempo) "; @@ -40,7 +52,7 @@ if (isset($_GET['ip'])) { ?> - - + - - +riga(); +$tabella->intestazione (array("", "IP", "", "Nome", "", "", "Inizio dati", "", "Fine Dati", "", "Inviati", "", "Ricevuti", "")); +?> - + - + - - - + + + + + - - - + + - - - - - - - - - - -riga(); ?> + +riga(); } else { if (isset($_POST['ip'])) { $ip = $_POST['ip']; + $nome = $_POST['nome']; if (isset($_POST['attivo'])) { $attivo = $_POST['attivo']; } else { @@ -98,6 +113,7 @@ if (isset($_GET['ip'])) { proxy_pool SET ip = '$ip', + nome = '$nome', pool = 1, attivo = $attivo, ins = NOW() @@ -107,8 +123,7 @@ if (isset($_GET['ip'])) { if (!$res) { $error_code = mysql_errno(); if ($error_code == 1062) { ?> - - + intestazione (array("", "IP", "", "Nome", "", "Limitazione", "")); ?> - - - - - - - - - - - - - - + - + - +riga(); ?> - - - - -
+
Utente limitatoUtente limitato Utente non limitatoUtente non limitato + + + + + Inviati
Ricevuti
Indirizzo IP gia' esistente
Indirizzo IP gia' esistente
Indirizzo IP: Limitazione:
+    
+} +$tabella->close(); ?>
- - + diff --git a/proxy/pool_lista.php b/proxy/pool_lista.php index 78a58ac..6216381 100755 --- a/proxy/pool_lista.php +++ b/proxy/pool_lista.php @@ -13,12 +13,12 @@ if (isset($_POST['tempo'])) { if (isset($_POST['ordina'])) { $ordina = $_POST['ordina']; } else { - $ordina = "ip"; + $ordina = "INET_ATON(ip)"; } ?>
- + @@ -33,19 +33,20 @@ if (isset($_POST['ordina'])) { + - riga(); $query = "SELECT GREATEST (sum(inviati), sum(ricevuti)) AS max from proxy_dati WHERE data_destroy >= DATE_SUB(NOW(), INTERVAL 1 $tempo) GROUP BY ip"; $res = mysql_query( $query, $DB_ID ); $max = 0; @@ -57,6 +58,7 @@ while ($valori = mysql_fetch_array ( $res )) { $query = " SELECT proxy_pool.id, + proxy_pool.nome, proxy_pool.attivo, proxy_dati.ip, MIN(proxy_dati.data_destroy) AS first, @@ -75,6 +77,7 @@ $query = " SELECT ip UNION DISTINCT SELECT proxy_pool.id, + proxy_pool.nome, proxy_pool.attivo, proxy_pool.ip, DATE_SUB(NOW(), INTERVAL 1 $tempo) AS first, @@ -100,11 +103,11 @@ while ($dato = mysql_fetch_array ( $res )) { - + - + @@ -116,6 +119,9 @@ while ($dato = mysql_fetch_array ( $res )) { + + + @@ -123,11 +129,10 @@ while ($dato = mysql_fetch_array ( $res )) { - - -
Ordinamento: 
Utente non limitato DettaglioDettaglio ACL class="colip">
Ricevuti
+$tabella->riga(); +} +$tabella->close(); +?>
- diff --git a/proxy/users_edit.php b/proxy/users_edit.php index d7154f1..325db81 100755 --- a/proxy/users_edit.php +++ b/proxy/users_edit.php @@ -74,12 +74,14 @@ function getvalue() { } - + +?>
-intestazione (array("","Utente","","Nome Completo","","Data attivazione","","Ultima Modifica","","IP","")); ?> - - - - - - - - - - - - - - + - + @@ -143,17 +134,13 @@ if ($dato['attivo']) { - +riga(); +$tabella->intestazione (array("","Nuova Password","","Conferma Nuova Password","","","","","","","")); +?> - - - - - - - - + @@ -162,10 +149,9 @@ if ($dato['attivo']) { - +riga(); ?> -
UtenteNome CompletoData attivazioneUltima ModificaIP
Utente non Attivo
Nuova PasswordConferma Nuova Password

+close(); ?>
- diff --git a/proxy/users_group_edit.php b/proxy/users_group_edit.php index 459b862..4f4ddf7 100755 --- a/proxy/users_group_edit.php +++ b/proxy/users_group_edit.php @@ -44,11 +44,9 @@ if (isset($_POST['id'])) {
- - intestazione (array ("","Prefisso","","Intervallo","","Lunghezza",""), array("","","","radio","","","")); ?> @@ -64,8 +62,10 @@ html_intestazione (array ("","Prefisso","","Intervallo","","Lunghezza",""), arra - - +riga(); +$tabella->intestazione (array ("","Lunghezza Password","","Tempo assegnato (h)","","","")); +?> @@ -73,12 +73,11 @@ html_intestazione (array ("","Prefisso","","Intervallo","","Lunghezza",""), arra - +riga(); ?> -
+close(); ?>
- diff --git a/proxy/users_group_lista.php b/proxy/users_group_lista.php index 13b5e20..eae50a2 100755 --- a/proxy/users_group_lista.php +++ b/proxy/users_group_lista.php @@ -3,9 +3,8 @@ include_once ("../core/config.php"); $UTENTE = login(); $DIRITTI = diritti('Admin'); view_top(); +$tabella = new html (0,"90%",array (3,3,3,2,10,2,13,2,10,2,10,0)); ?> - - @@ -28,7 +27,7 @@ $query = " SELECT "; $res = mysql_query( $query, $DB_ID ); -html_intestazione (array ("","","","","Utente","","Nome Completo","","Primo Accesso","","Ultimo Accesso","")); +$tabella->intestazione (array ("","","","","Utente","","Nome Completo","","Primo Accesso","","Ultimo Accesso","")); while ($dato = mysql_fetch_array ( $res )) { ?> @@ -57,10 +56,8 @@ while ($dato = mysql_fetch_array ( $res )) { - - -
- - +$tabella->riga(); +} +$tabella->close(); +view_footer(); ?> diff --git a/proxy/users_lista.php b/proxy/users_lista.php index cff2ad5..022f1de 100755 --- a/proxy/users_lista.php +++ b/proxy/users_lista.php @@ -3,9 +3,9 @@ include_once ("../core/config.php"); $UTENTE = login(); $DIRITTI = diritti('Admin'); view_top(); + +$tabella = new html (0,"90%", array (5,5,5,2,10,2,13,2,12,2,10,0)); ?> - - @@ -28,7 +28,7 @@ $query = " SELECT "; $res = mysql_query( $query, $DB_ID ); -html_intestazione (array ("","","","","Utente","","Nome Completo","","Ultimo Accesso","","IP Associato","")); +$tabella->intestazione (array ("","","","","Utente","","Nome Completo","","Ultimo Accesso","","IP Associato","")); while ($dato = mysql_fetch_array ( $res )) { ?> @@ -57,10 +57,9 @@ while ($dato = mysql_fetch_array ( $res )) { - - -
- - +$tabella->riga(); +} +$tabella->close(); +view_footer(); +?> diff --git a/risorse/stili/stile.css b/risorse/stili/stile.css index ad60947..83ae152 100644 --- a/risorse/stili/stile.css +++ b/risorse/stili/stile.css @@ -39,6 +39,7 @@ td.valoretxt { font-family: verdana; font-size: 14px; text-align: left; vertica td.col0 { font-family: verdana; font-size: 14px; text-align: left; width:20px; vertical-align:text-top; text-decoration: none; color: #000000; background-color: #dcd2d2; white-space: nowrap} td.ltop { font-family: verdana; font-size: 14px; text-align: left; vertical-align:text-top; text-decoration: none; color: #000000; } +td.ctop { font-family: verdana; font-size: 14px; text-align: center; vertical-align:text-top; text-decoration: none; color: #000000; } td.rtop { font-family: verdana; font-size: 14px; text-align: right; vertical-align:text-top; text-decoration: none; color: #000000; } td.lbottom { font-family: verdana; font-size: 14px; text-align: left; vertical-align:text-top; text-decoration: none; color: #000000; } td.rbottom { font-family: verdana; font-size: 14px; text-align: right; vertical-align:text-top; text-decoration: none; color: #5191D5; } @@ -66,6 +67,9 @@ td.col3valore { font-family: verdana; font-size: 12px; text-align: left; vertic td.col3valore2 { font-family: verdana; font-size: 10px; text-align: left; vertical-align:middle; width:200px; height: 10px; text-decoration: none; color: #000000; } td.colip { font-family: verdana; font-size: 10px; text-align: left; vertical-align:middle; width:80px; height: 10px; text-decoration: none; color: #000000; white-space: nowrap} +td.textr { font-family: verdana; font-size: 10px; text-align: right; vertical-align:middle; width:80px; height: 10px; text-decoration: none; color: #000000; white-space: nowrap} +td.textc { font-family: verdana; font-size: 10px; text-align: center; vertical-align:middle; width:80px; height: 10px; text-decoration: none; color: #000000; white-space: nowrap} +td.textl { font-family: verdana; font-size: 10px; text-align: left; vertical-align:middle; width:80px; height: 10px; text-decoration: none; color: #000000; white-space: nowrap} td.colspeed { font-family: verdana; font-size: 10px; text-align: left; vertical-align:middle; width:80px; height: 10px; text-decoration: none; color: #000000; white-space: nowrap} td.colimg { font-family: verdana; font-size: 11px; text-align: left; height:1px; text-decoration: none; color: #8e8e8e; white-space: nowrap} diff --git a/utenti/index.php b/utenti/index.php index 3d82035..fe3abc0 100755 --- a/utenti/index.php +++ b/utenti/index.php @@ -16,14 +16,16 @@ function PopupG(apri) } //--> - + - + - riga(); $query = "SELECT id, utente, admin, creazione, modifica, ultimo, attivo FROM utenti ORDER BY utente"; $res = mysql_query( $query, $DB_ID ); while ($dato = mysql_fetch_array ( $res )) { @@ -48,38 +50,35 @@ while ($dato = mysql_fetch_array ( $res )) { - + - + - + - + - - + - + - + - + - + - - - - + + - - -
Aggiungi utente
Utente UtenteUtente CreazioneCreazione Ultima ModificaUltima Modifica Ultimo accessoUltimo accesso Numero accessi - Gestione regole - Grafico Utilizzo + Numero accessi + Gestione regole +
Grafico Utilizzo
- - +$tabella->riga(); +} +$tabella->close(); +view_footer(); +?> diff --git a/utenti/logutenti.php b/utenti/logutenti.php index 04044e8..52a15bd 100755 --- a/utenti/logutenti.php +++ b/utenti/logutenti.php @@ -2,15 +2,11 @@ include_once ("../core/config.php"); $UTENTE = login(); $DIRITTI = diritti('Admin'); -//isadmin(); ?> - - intestazione (array("","Indirizzo IP","","Accesso","","Uscita","","Numero pagine","","","")); +$tabella->riga(); + while ($dato = mysql_fetch_array ( $res )) { ?> - - - - - - - - + + + + + + + + + + - - riga(); } -if ($fatte < $righe) { - for ($i = $fatte; $i<=$righe; $i++) { ?> - - - -
Indirizzo IP: Accesso: Uscita: Numero pagine: Dettaglio sessione
 
+
+close(); ?> diff --git a/utenti/modutenti.php b/utenti/modutenti.php index c81273e..297bf06 100755 --- a/utenti/modutenti.php +++ b/utenti/modutenti.php @@ -34,48 +34,69 @@ if (isset($_GET['id'])) { if ( $rm == 1) { $testo = "L'utente e' stato correttamente rimosso"; - $query = "DELETE FROM permessi WHERE id_utenti = $id"; - $query2 = "DELETE FROM utenti WHERE id = $id"; + $query = " DELETE FROM + permessi + WHERE + id_utenti = $id + "; + + $query2 = " DELETE FROM + utenti + WHERE + id = $id + "; + } elseif ($id > 0) { $testo = "L'utente e' stato correttamente modificato"; - $query = "UPDATE utenti SET $querypwd admin = $admin, attivo=$attivo, modifica = NOW(), mail='$mail' WHERE `id`=$id"; + $query = " UPDATE + utenti + SET + $querypwd + utente = '$utente', + admin = $admin, + attivo=$attivo, + modifica = NOW(), + mail='$mail' + WHERE + id=$id + "; } else { $testo = "L'utente e' stato correttamente inserito"; - $query = "INSERT INTO utenti SET utente = '$utente', $querypwd admin = $admin, attivo=$attivo, modifica = NOW(), creazione = NOW(), mail='$mail'"; + $query = " INSERT INTO + utenti + SET + $querypwd + utente = '$utente', + admin = $admin, + attivo=$attivo, + modifica = NOW(), + creazione = NOW(), + mail='$mail' + "; + } + +$tabella = new html (0,"90%", array (0)); +$tabella->riga(); + + if (mysql_query( $query, $DB_ID ) && ((!is_null ($query2) && mysql_query( $query2, $DB_ID )) || (is_null ($query2)))) { + } else { + $testo = "Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: ".mysql_error(); } ?> - - - + - - - - - - - - - -
+
- -
- -Non e' stato possibile eseguire l'operazione richiesta a causa di un errore:
-
- -
close(); } else { $bottone = "Aggiungi"; $modifica = 0; } -?> - +if (($modifica == 0 || $modifica == 1) && !isset($_GET['rm'])) { ?> @@ -123,7 +144,6 @@ $(document).ready(function() }, - // the errorPlacement has to take the table layout into account errorPlacement: function(error, element) { error.prependTo( element.parent().next() ); }, @@ -141,48 +161,51 @@ $(document).ready(function()
- - + - + + - + - +riga(); ?> - + + - + - +riga(); ?> - + - + - + - +riga(); ?> - - - - - - -
Attivo > Admin >  
- + - + - - - + + + +riga(); ?> - - - - - + + + + + + - -
+
+
 
@@ -190,21 +213,22 @@ $(document).ready(function()
+close(); ?>
+riga(); ?> +
    @@ -213,10 +237,10 @@ $(document).ready(function()
+riga(); +$tabella->close(); +?>
- - - + diff --git a/utenti/permessiutenti.php b/utenti/permessiutenti.php index f7161aa..e094109 100755 --- a/utenti/permessiutenti.php +++ b/utenti/permessiutenti.php @@ -50,11 +50,15 @@ $res = mysql_query( $query, $DB_ID ); $dato = mysql_fetch_array ($res); $livelli = get_levels(); -//$livelli = array(0=>"Negato", 5=>"Utente", 10=>"Admin"); ?> - + + + @@ -62,13 +66,16 @@ $livelli = get_levels(); - -
+ +
AdminUtente
- - - - +close(); ?> + + +riga(); ?> + + - - - -
+
@@ -79,12 +86,14 @@ $livelli = get_levels();
- - +riga(); +} +$tabella2->close(); +?> + + +close(); ?>