Gestione gruppi proxy
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteRule ^(.*/)?img/(.*) risorse/immagini/$2 [L]
|
RewriteRule ^(.*/)?img/(.*) risorse/immagini/$2 [L]
|
||||||
RewriteRule ^(.*/)?css/(.*) risorse/stili/$2 [L]
|
RewriteRule ^(.*/)?css/(.*) risorse/stili/$2 [L]
|
||||||
|
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . /pannello_vbc/rewrite.php [L]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,26 @@ ALTER TABLE `proxy_utenti` ADD `guest` INT NOT NULL DEFAULT '0' AFTER `modifica`
|
|||||||
|
|
||||||
INSERT INTO `pannello_vbc`.`livelli` (`id`, `livello`, `nome`) VALUES (NULL, '1', 'Libero');
|
INSERT INTO `pannello_vbc`.`livelli` (`id`, `livello`, `nome`) VALUES (NULL, '1', 'Libero');
|
||||||
ALTER TABLE `moduli_page` ADD `livello` INT NOT NULL AFTER `pagina`;
|
ALTER TABLE `moduli_page` ADD `livello` INT NOT NULL AFTER `pagina`;
|
||||||
|
|
||||||
|
CREATE TABLE `rewrite` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`from_url` varchar(512) NOT NULL,
|
||||||
|
`to_url` varchar(512) NOT NULL,
|
||||||
|
`attivo` tinyint(1) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `from_url` (`from_url`(255))
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
||||||
|
|
||||||
|
INSERT INTO `rewrite` (`id`, `from_url`, `to_url`, `attivo`) VALUES
|
||||||
|
(1, 'pannello_vbc/proxy_auth.php', 'proxy/ext/main_proxy.php', 1),
|
||||||
|
(2, 'pannello_vbc/main_proxy.php', 'proxy/ext/main_proxy.php', 1),
|
||||||
|
(3, 'pannello_vbc/logout_proxy.php', 'proxy/ext/logout_proxy.php', 1),
|
||||||
|
(4, 'pannello_vbc/chkpasswd_proxy.php', 'proxy/ext/chkpasswd_proxy.php', 1);
|
||||||
|
|
||||||
|
ALTER TABLE `proxy_utenti` ADD `primo` DATETIME NULL AFTER `modifica`;
|
||||||
|
ALTER TABLE `proxy_utenti` ADD `ultimo` DATETIME NULL AFTER `ultimo`;
|
||||||
|
ALTER TABLE `proxy_utenti` ADD `tempo` DECIMAL(20,2) NOT NULL DEFAULT '0' AFTER `attivo`;
|
||||||
|
ALTER TABLE `proxy_utenti` CHANGE `ip` `ip` VARCHAR(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
|
||||||
|
REVOKE ALL PRIVILEGES ON `pannello_vbc`.`proxy_utenti` FROM 'pannello_proxy'@'%'; GRANT SELECT, UPDATE (`primo`, `ultimo`, `attivo`) ON `pannello_vbc`.`proxy_utenti` TO 'pannello_proxy'@'%';
|
||||||
|
|
||||||
|
INSERT INTO `pannello_vbc`.`moduli_page` (`id`, `id_moduli`, `nome`, `ordine`, `pagina`, `livello`, `attivo`) VALUES (NULL, '1', 'Lista Gruppi', '35', 'users_group_lista.php', '10', '1');
|
||||||
|
|||||||
15
proxy/ext/chkpasswd_proxy.php
Executable file → Normal file
15
proxy/ext/chkpasswd_proxy.php
Executable file → Normal file
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once ("../../core/config.php");
|
include_once ("core/config.php");
|
||||||
include_once ("function_proxy.php");
|
include_once ("proxy/ext/function_proxy.php");
|
||||||
$UTENTE = login_proxy();
|
$UTENTE = login_proxy();
|
||||||
view_top_proxy();
|
view_top_proxy();
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ Non e' stato possibile eseguire l'operazione richiesta a causa di un errore: <?p
|
|||||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td>
|
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="button" value="Ok" onclick="location.href = 'main.php';"></button></td>
|
<td><input type="button" value="Ok" onclick="location.href = 'main_proxy.php';"></button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="10" alt=""></td>
|
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="10" alt=""></td>
|
||||||
@@ -102,13 +102,6 @@ $(document).ready(function()
|
|||||||
<td class="status" colspan="6"></td>
|
<td class="status" colspan="6"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td></tr>
|
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td></tr>
|
||||||
<tr>
|
|
||||||
<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="30" height="1" alt=""></td>
|
|
||||||
<td class="label"><label id="lmail" for="mail">Indirizzo E-Mail</label></td>
|
|
||||||
<td class="field"><input id="mail" name="mail" type="text" value="<?php print $dato['mail']?>" maxlength="50" /></td>
|
|
||||||
<td class="status" colspan="6"></td>
|
|
||||||
</tr>
|
|
||||||
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="5" alt=""></td></tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="col1" colspan="9">
|
<td class="col1" colspan="9">
|
||||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
@@ -142,7 +135,7 @@ $(document).ready(function()
|
|||||||
<tr><td align="center" colspan="9">
|
<tr><td align="center" colspan="9">
|
||||||
<input type="submit" value="<?php print $bottone ?>">
|
<input type="submit" value="<?php print $bottone ?>">
|
||||||
|
|
||||||
<input type="button" value="Annulla" onclick="location.href = 'main.php';"></button>
|
<input type="button" value="Annulla" onclick="location.href = 'main_proxy.php';"></button>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="10" alt=""></td></tr>
|
<tr><td colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="10" alt=""></td></tr>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
<tr bgcolor="#FFC350">
|
<tr bgcolor="#34c6ea">
|
||||||
<td nowrap class="lbottom"> <?php print $CONF['Versione'] ?></td>
|
<td nowrap class="lbottom"> <?php print $CONF['Versione'] ?></td>
|
||||||
<td width="500"> </td>
|
<td width="500"> </td>
|
||||||
<?php if ($UTENTE['admin']) { ?>
|
<?php if ($UTENTE['admin']) { ?>
|
||||||
<td class="rtop"><a class="rtop" href="main.php">Admin </a></td>
|
<td class="rtop"><a class="rtop" href="main_proxy.php">Admin </a></td>
|
||||||
<?php } else {?>
|
<?php } else {?>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ function carica_utente_proxy () {
|
|||||||
function lista_moduli_proxy () {
|
function lista_moduli_proxy () {
|
||||||
global $UTENTE, $DB_ID, $CONF;
|
global $UTENTE, $DB_ID, $CONF;
|
||||||
|
|
||||||
$menu[] = array("Home", "main.php",0,"Home Page",0);
|
$menu[] = array("Home", "main_proxy.php",0,"Home Page",0);
|
||||||
$menu[] = array("Cambio password", "chkpasswd_proxy.php",0,"Cambio Password");
|
$menu[] = array("Cambio password", "chkpasswd_proxy.php",0,"Cambio Password");
|
||||||
|
|
||||||
$pezzi = preg_split('/\//', $_SERVER["PHP_SELF"], -2);
|
$pezzi = preg_split('/\//', $_SERVER["PHP_SELF"], -2);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once ("../../core/config.php");
|
include_once ("core/config.php");
|
||||||
include_once ("function_proxy.php");
|
include_once ("proxy/ext/function_proxy.php");
|
||||||
login_proxy();
|
login_proxy();
|
||||||
session_name("authmail");
|
session_name("authmail");
|
||||||
session_start();
|
session_start();
|
||||||
$_SESSION['auth'] = 0;
|
$_SESSION['auth'] = 0;
|
||||||
session_destroy();
|
session_destroy();
|
||||||
header('Location: main.php');
|
header('Location: main_proxy.php');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once ("../../core/config.php");
|
include_once ("core/config.php");
|
||||||
include_once ("function_proxy.php");
|
include_once ("proxy/ext/function_proxy.php");
|
||||||
$UTENTE = login_proxy();
|
$UTENTE = login_proxy();
|
||||||
view_top_proxy();
|
view_top_proxy();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<META HTTP-EQUIV="Refresh" CONTENT="30" URL="main.php">
|
<META HTTP-EQUIV="Refresh" CONTENT="30" URL="main_proxy.php">
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" border="0" width="90%">
|
<table cellpadding="0" cellspacing="0" border="0" width="90%">
|
||||||
<tr><td class="spaziov" colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
<tr><td class="spaziov" colspan="9"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
if ($UTENTE['user'] != '') { ?>
|
if ($UTENTE['user'] != '') { ?>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
<tr bgcolor="#FFC350">
|
<tr bgcolor="#34c6ea">
|
||||||
<td nowrap class="ltop">Utente: <?php print $_SESSION['username'] ?></td>
|
<td nowrap class="ltop">Utente: <?php print $_SESSION['username'] ?></td>
|
||||||
<td width="200"> </td>
|
<td width="200"> </td>
|
||||||
<td class="rtop"><a class="rtop" href="logout_proxy.php">Logout</a></td>
|
<td class="rtop"><a class="rtop" href="logout_proxy.php">Logout</a></td>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
lista_moduli_proxy();
|
lista_moduli_proxy();
|
||||||
} else {?>
|
} else {?>
|
||||||
<tr bgcolor="#FFC350"><td> </td></tr>
|
<tr bgcolor="#34c6ea"><td> </td></tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td class="spaziov" colspan=2><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
<tr><td class="spaziov" colspan=2><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ require "$Bin/../script/conntrack.conf";
|
|||||||
|
|
||||||
local $SIG{ALRM} = sub {
|
local $SIG{ALRM} = sub {
|
||||||
my $time = localtime; # scalar context
|
my $time = localtime; # scalar context
|
||||||
print LOG "$$ - $time - Exit\n";
|
# print LOG "$$ - $time - Exit\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -21,8 +21,8 @@ my $dbmysql = DBI->connect("DBI:mysql:;host=$DBhost", $DBuser, $DBpass) or die (
|
|||||||
$sts = $dbmysql->prepare("use $DBname");
|
$sts = $dbmysql->prepare("use $DBname");
|
||||||
$sts->execute ();
|
$sts->execute ();
|
||||||
|
|
||||||
open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
|
#open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
|
||||||
LOG->autoflush(1);
|
#LOG->autoflush(1);
|
||||||
|
|
||||||
while($limit) {
|
while($limit) {
|
||||||
alarm $timeout;
|
alarm $timeout;
|
||||||
@@ -35,15 +35,15 @@ while($limit) {
|
|||||||
my $ritorno = cerca ($param[1],$param[2], -1);
|
my $ritorno = cerca ($param[1],$param[2], -1);
|
||||||
$limit--;
|
$limit--;
|
||||||
if ($ritorno) {
|
if ($ritorno) {
|
||||||
print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
# print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
||||||
print "DENY\n";
|
print "DENY\n";
|
||||||
} else {
|
} else {
|
||||||
$ritorno = cerca ($param[1],$param[2], 1);
|
$ritorno = cerca ($param[1],$param[2], 1);
|
||||||
if ($ritorno) {
|
if ($ritorno) {
|
||||||
print LOG "$param[0] - $param[1] - $param[2] - OK\n";
|
# print LOG "$param[0] - $param[1] - $param[2] - OK\n";
|
||||||
print "OK\n";
|
print "OK\n";
|
||||||
} else {
|
} else {
|
||||||
print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
# print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
||||||
# print "DENY\n";
|
# print "DENY\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ require "$Bin/../script/conntrack.conf";
|
|||||||
|
|
||||||
local $SIG{ALRM} = sub {
|
local $SIG{ALRM} = sub {
|
||||||
my $time = localtime; # scalar context
|
my $time = localtime; # scalar context
|
||||||
print LOG "$$ - $time - Exit\n";
|
# print LOG "$$ - $time - Exit\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -21,8 +21,8 @@ my $dbmysql = DBI->connect("DBI:mysql:;host=$DBhost", $DBuser, $DBpass) or die (
|
|||||||
$sts = $dbmysql->prepare("use $DBname");
|
$sts = $dbmysql->prepare("use $DBname");
|
||||||
$sts->execute ();
|
$sts->execute ();
|
||||||
|
|
||||||
open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
|
#open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
|
||||||
LOG->autoflush(1);
|
#LOG->autoflush(1);
|
||||||
|
|
||||||
while($limit) {
|
while($limit) {
|
||||||
alarm $timeout;
|
alarm $timeout;
|
||||||
@@ -35,15 +35,15 @@ while($limit) {
|
|||||||
my $ritorno = cerca ($param[1],$param[2], -1);
|
my $ritorno = cerca ($param[1],$param[2], -1);
|
||||||
$limit--;
|
$limit--;
|
||||||
if ($ritorno) {
|
if ($ritorno) {
|
||||||
print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
# print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
||||||
print "DENY\n";
|
print "DENY\n";
|
||||||
} else {
|
} else {
|
||||||
$ritorno = cerca ($param[1],$param[2], 1);
|
$ritorno = cerca ($param[1],$param[2], 1);
|
||||||
if ($ritorno) {
|
if ($ritorno) {
|
||||||
print LOG "$param[0] - $param[1] - $param[2] - OK\n";
|
# print LOG "$param[0] - $param[1] - $param[2] - OK\n";
|
||||||
print "OK\n";
|
print "OK\n";
|
||||||
} else {
|
} else {
|
||||||
print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
# print LOG "$param[0] - $param[1] - $param[2] - ERR\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ require "$Bin/../script/conntrack.conf";
|
|||||||
|
|
||||||
local $SIG{ALRM} = sub {
|
local $SIG{ALRM} = sub {
|
||||||
my $time = localtime; # scalar context
|
my $time = localtime; # scalar context
|
||||||
print LOG "$$ - $time - Exit\n";
|
# print LOG "$$ - $time - Exit\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -20,8 +20,8 @@ my $dbmysql = DBI->connect("DBI:mysql:;host=$DBhost", $DBuser, $DBpass) or die (
|
|||||||
$sts = $dbmysql->prepare("use $DBname");
|
$sts = $dbmysql->prepare("use $DBname");
|
||||||
$sts->execute ();
|
$sts->execute ();
|
||||||
|
|
||||||
open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
|
#open LOG, ">> /srv/www/htdocs/pannello_vbc/proxy/squid_acl/squid_pool.log";
|
||||||
LOG->autoflush(1);
|
#LOG->autoflush(1);
|
||||||
|
|
||||||
alarm $timeout;
|
alarm $timeout;
|
||||||
while($limit) {
|
while($limit) {
|
||||||
@@ -29,11 +29,10 @@ while($limit) {
|
|||||||
my $input = <>;
|
my $input = <>;
|
||||||
chop $input;
|
chop $input;
|
||||||
|
|
||||||
# my ($acl, $ip) = split / /, $input;
|
|
||||||
my @param = split / /, $input;
|
my @param = split / /, $input;
|
||||||
|
|
||||||
if ($param[0] ne "") {
|
if ($param[0] ne "") {
|
||||||
$query = "SELECT id FROM proxy_utenti WHERE user = '".$param[0]."' AND pass = PASSWORD('".$param[1]."') AND attivo = 1";
|
$query = "SELECT id, primo, (tempo*3600)-time_to_sec(timediff(ultimo, primo)) AS rimasto, tempo FROM proxy_utenti WHERE user = '".$param[0]."' AND pass = PASSWORD('".$param[1]."') AND attivo = 1";
|
||||||
$limit--;
|
$limit--;
|
||||||
alarm $timeout;
|
alarm $timeout;
|
||||||
} else {
|
} else {
|
||||||
@@ -47,7 +46,22 @@ while($limit) {
|
|||||||
|
|
||||||
if ($ref = $sts->fetchrow_hashref ) {
|
if ($ref = $sts->fetchrow_hashref ) {
|
||||||
my $id = $$ref{'id'};
|
my $id = $$ref{'id'};
|
||||||
my $query = "UPDATE proxy_utenti SET data = NOW() WHERE id = $id";
|
my $primo = $$ref{'primo'};
|
||||||
|
my $rimasto = $$ref{'rimasto'};
|
||||||
|
my $tempo = $$ref{'tempo'};
|
||||||
|
|
||||||
|
my $agg = "";
|
||||||
|
my $query = "";
|
||||||
|
if (($tempo > 0) && ($rimasto < 0)){
|
||||||
|
$agg = "attivo = 0,";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$primo) {
|
||||||
|
$query = "UPDATE proxy_utenti SET $agg primo = NOW(), ultimo = NOW() WHERE id = $id";
|
||||||
|
} else {
|
||||||
|
$query = "UPDATE proxy_utenti SET $agg ultimo = NOW() WHERE id = $id";
|
||||||
|
}
|
||||||
|
# print LOG "$rimasto -- $query\n";
|
||||||
$sts = $dbmysql->prepare($query);
|
$sts = $dbmysql->prepare($query);
|
||||||
$sts->execute ();
|
$sts->execute ();
|
||||||
print "OK\n";
|
print "OK\n";
|
||||||
|
|||||||
84
proxy/users_group_edit.php
Executable file
84
proxy/users_group_edit.php
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
include_once ("../core/config.php");
|
||||||
|
$UTENTE = login();
|
||||||
|
$DIRITTI = diritti('Admin');
|
||||||
|
view_top();
|
||||||
|
|
||||||
|
if (isset($_POST['id'])) {
|
||||||
|
$prefisso = $_POST['prefisso'];
|
||||||
|
$da = $_POST['da'];
|
||||||
|
$a = $_POST['a'];
|
||||||
|
$a = $_POST['a'];
|
||||||
|
$lung = $_POST['lung'];
|
||||||
|
$lpwd = $_POST['lpwd'];
|
||||||
|
$tempo = $_POST['tempo'];
|
||||||
|
|
||||||
|
$lunghezza = $lung - strlen ($prefisso);
|
||||||
|
$parametro = "0".$lunghezza."d";
|
||||||
|
for ($i=$da;$i<=$a;$i++) {
|
||||||
|
$utgruppo = sprintf ("%s%$parametro",$prefisso,$i);
|
||||||
|
$pwgruppo = generateStrongPassword($length = $lpwd, $add_dashes = false, $available_sets = 'lud');
|
||||||
|
|
||||||
|
$query = " INSERT INTO
|
||||||
|
proxy_utenti
|
||||||
|
SET
|
||||||
|
user = '$utgruppo',
|
||||||
|
pass = PASSWORD('$pwgruppo'),
|
||||||
|
fullname = 'Utente Guest',
|
||||||
|
data = NOW(),
|
||||||
|
modifica = NOW(),
|
||||||
|
guest = 1,
|
||||||
|
attivo = 1,
|
||||||
|
tempo = $tempo
|
||||||
|
";
|
||||||
|
$res = mysql_query( $query, $DB_ID );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.location.href="users_group_lista.php"
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form name="" method="post">
|
||||||
|
<input type="hidden" name="id" value="0">
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="90%">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
html_spazi (array(2,10,2,16,2,10,0));
|
||||||
|
html_intestazione (array ("","Prefisso","","Intervallo","","Lunghezza",""), array("","","","radio","","",""));
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><input type="text" size="16" name="prefisso"></td>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="radio">
|
||||||
|
<input type="text" size="2" name="da">
|
||||||
|
-
|
||||||
|
<input type="text" size="2" name="a">
|
||||||
|
</td>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><input type="text" size="3" name="lung"></td>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr><td class="spaziov" colspan=7><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
||||||
|
<?php html_intestazione (array ("","Lunghezza Password","","Tempo assegnato (h)","","","")); ?>
|
||||||
|
<tr>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><input type="text" size="3" name="lpwd"></td>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><input type="text" size="3" name="tempo" value=24></td>
|
||||||
|
<td colspan=3 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
</tr>
|
||||||
|
<tr><td class="spaziov" colspan=7><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="spaziov" colspan=6><input type="submit" value="Conferma"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
<img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="20" alt="">
|
||||||
|
<?php view_footer(); ?>
|
||||||
66
proxy/users_group_lista.php
Executable file
66
proxy/users_group_lista.php
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
include_once ("../core/config.php");
|
||||||
|
$UTENTE = login();
|
||||||
|
$DIRITTI = diritti('Admin');
|
||||||
|
view_top();
|
||||||
|
?>
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="90%">
|
||||||
|
<?php html_spazi (array (5,5,5,2,10,2,13,2,10,2,10,0)); ?>
|
||||||
|
<tr>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="spazioh"><a href="users_group_edit.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
|
||||||
|
<td colspan=10 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$query = " SELECT
|
||||||
|
id,
|
||||||
|
user,
|
||||||
|
fullname,
|
||||||
|
attivo,
|
||||||
|
DATE_FORMAT(primo, '%d.%m.%Y %H:%i:%s') AS primo,
|
||||||
|
DATE_FORMAT(ultimo, '%d.%m.%Y %H:%i:%s') AS ultimo
|
||||||
|
FROM
|
||||||
|
proxy_utenti
|
||||||
|
WHERE
|
||||||
|
guest = 1
|
||||||
|
ORDER BY
|
||||||
|
user
|
||||||
|
";
|
||||||
|
|
||||||
|
$res = mysql_query( $query, $DB_ID );
|
||||||
|
html_intestazione (array ("","","","","Utente","","Nome Completo","","Primo Accesso","","Ultimo Accesso",""));
|
||||||
|
while ($dato = mysql_fetch_array ( $res )) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<?php
|
||||||
|
if ($dato['attivo']) {
|
||||||
|
?>
|
||||||
|
<td class="spazioh"><a href="proxy_gest.php?azione=user_down&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Utente Attivo" TITLE="Utente Attivo"></a></td>
|
||||||
|
<?php } else { ?>
|
||||||
|
<td class="spazioh"><a href="proxy_gest.php?azione=user_up&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Utente non Attivo" TITLE="Utente non Attivo"></a></td>
|
||||||
|
<?php } ?>
|
||||||
|
<td class="spazioh"><a href="proxy_gest.php?azione=user_rm&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/trash.png"></a></td>
|
||||||
|
|
||||||
|
<td class="spazioh"><a href="users_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Dettaglio" TITLE="Dettaglio"></a></td>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
|
||||||
|
<td class="colip"><?php print $dato['user'] ?></td>
|
||||||
|
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><?php print $dato['fullname'] ?></td>
|
||||||
|
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><?php print $dato['primo'] ?></td>
|
||||||
|
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
<td class="colip"><?php print $dato['ultimo'] ?></td>
|
||||||
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr><td class="spaziov" colspan=12><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td></tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
} ?>
|
||||||
|
</table>
|
||||||
|
<img src="<?php print $CONF['base_url'] ?>/img/spazio.gif" width="1" height="20" alt="">
|
||||||
|
<?php view_footer(); ?>
|
||||||
@@ -17,10 +17,12 @@ $query = " SELECT
|
|||||||
user,
|
user,
|
||||||
fullname,
|
fullname,
|
||||||
attivo,
|
attivo,
|
||||||
DATE_FORMAT(data, '%d.%m.%Y %H:%i:%s') AS data,
|
DATE_FORMAT(ultimo, '%d.%m.%Y %H:%i:%s') AS data,
|
||||||
ip
|
ip
|
||||||
FROM
|
FROM
|
||||||
proxy_utenti
|
proxy_utenti
|
||||||
|
WHERE
|
||||||
|
guest = 0
|
||||||
ORDER BY
|
ORDER BY
|
||||||
user
|
user
|
||||||
";
|
";
|
||||||
|
|||||||
27
rewrite.php
Normal file
27
rewrite.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
include_once ("core/config.php");
|
||||||
|
|
||||||
|
$path = ltrim($_SERVER['REQUEST_URI'], '/');
|
||||||
|
|
||||||
|
$query = " SELECT
|
||||||
|
to_url
|
||||||
|
FROM
|
||||||
|
rewrite
|
||||||
|
WHERE
|
||||||
|
from_url = '$path'
|
||||||
|
AND
|
||||||
|
attivo = 1
|
||||||
|
";
|
||||||
|
|
||||||
|
$res = mysql_query( $query, $DB_ID );
|
||||||
|
|
||||||
|
if ($valori = mysql_fetch_array ( $res )) {
|
||||||
|
include ($valori['to_url']);
|
||||||
|
} else {
|
||||||
|
print "$path non c'e'";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user