Sviluppo forward in firewall
This commit is contained in:
148
firewall/firewall_regole_versoesterno.php
Executable file
148
firewall/firewall_regole_versoesterno.php
Executable file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
$DIRITTI = diritti('Admin');
|
||||
view_top();
|
||||
|
||||
if (isset($_POST['id_utenti'])) {
|
||||
$id_utenti = $_POST['id_utenti'];
|
||||
$id_macchine = $_POST['id_macchine'];
|
||||
if (isset($_POST['perm'])) {
|
||||
$perm = $_POST['perm'];
|
||||
} else {
|
||||
$perm = 0;
|
||||
}
|
||||
$query = " INSERT INTO
|
||||
firewall_versoesterno_regole
|
||||
SET
|
||||
id_utenti = $id_utenti,
|
||||
id_firewall_versoesterno = $id_macchine,
|
||||
permanente = $perm,
|
||||
data = NOW(),
|
||||
attivo = 1
|
||||
";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
}
|
||||
|
||||
$query = " SELECT
|
||||
utenti.id,
|
||||
utenti.utente
|
||||
FROM
|
||||
utenti
|
||||
JOIN
|
||||
permessi
|
||||
ON
|
||||
permessi.id_utenti = utenti.id
|
||||
JOIN
|
||||
livelli
|
||||
ON
|
||||
livelli.nome = 'Utente'
|
||||
AND
|
||||
permessi.accesso <= livelli.livello
|
||||
WHERE
|
||||
permessi.id_moduli = ".$MODULO['id']."
|
||||
AND
|
||||
utenti.attivo = 1
|
||||
ORDER BY
|
||||
utente
|
||||
";
|
||||
$res_utenti = mysql_query( $query, $DB_ID );
|
||||
|
||||
$query = " SELECT
|
||||
firewall_versoesterno.id,
|
||||
firewall_versoesterno.nome
|
||||
FROM
|
||||
firewall_versoesterno
|
||||
WHERE
|
||||
firewall_versoesterno.attivo = 1
|
||||
ORDER BY
|
||||
nome
|
||||
";
|
||||
$res_macchine = mysql_query( $query, $DB_ID );
|
||||
|
||||
$tabella = new html (0,"90%",array(3,3,2,15,2,15,2,5,0));
|
||||
?>
|
||||
<form name="" method="post">
|
||||
<tr>
|
||||
<td colspan=2 class="spazioh"><input type="image" src="<?php print $CONF['base_url'] ?>/img/addresource.png" border="0" alt="Inserisci" /></td>
|
||||
|
||||
<td class="spaziov"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh">
|
||||
<select name="id_utenti">
|
||||
<option value="" selected="selected">---</option>
|
||||
<?php while ($dato = mysql_fetch_array ( $res_utenti )) { ?>
|
||||
<option value="<?php print $dato['id'] ?>"><?php print $dato['utente'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td class="spaziov"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="spazioh">
|
||||
<select name="id_macchine">
|
||||
<option value="" selected="selected">---</option>
|
||||
<?php while ($dato = mysql_fetch_array ( $res_macchine )) { ?>
|
||||
<option value="<?php print $dato['id'] ?>"><?php print $dato['nome'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td class="spaziov"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="radio"><input type="checkbox" name="perm" value="1"></td>
|
||||
|
||||
<td class="spaziov"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
</form>
|
||||
<?php
|
||||
$query = " SELECT
|
||||
firewall_versoesterno_regole.id,
|
||||
utenti.utente,
|
||||
firewall_versoesterno.nome,
|
||||
firewall_versoesterno_regole.permanente,
|
||||
firewall_versoesterno_regole.attivo
|
||||
FROM
|
||||
firewall_versoesterno_regole
|
||||
JOIN
|
||||
utenti
|
||||
ON
|
||||
firewall_versoesterno_regole.id_utenti = utenti.id
|
||||
JOIN
|
||||
firewall_versoesterno
|
||||
ON
|
||||
firewall_versoesterno_regole.id_firewall_versoesterno = firewall_versoesterno.id
|
||||
ORDER BY
|
||||
utenti.utente,
|
||||
firewall_versoesterno.nome
|
||||
";
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
while ($dato = mysql_fetch_array ( $res )) {
|
||||
?>
|
||||
<tr>
|
||||
<td rowspan=2 class="col3btn">
|
||||
<?php if ($dato['attivo']) { ?>
|
||||
<a href="firewall_gest.php?azione=regolaversoext_down&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Utente attivo" TITLE="Utente attivo"></a>
|
||||
<?php } else { ?>
|
||||
<a href="firewall_gest.php?azione=regolaversoext_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>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td rowspan=2 class="spazioh"><a href="firewall_gest.php?azione=regolaversoext_rm&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/trash.png"></a></td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="descrizione">Utenza</td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="descrizione">Regola</td>
|
||||
<td rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td class="radio">Perm</td>
|
||||
<td rowspan=2 rowspan=2 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="textl"><?php print $dato['utente'] ?></td>
|
||||
<td class="textl"><?php print $dato['nome'] ?></td>
|
||||
<td class="textc"><?php if ($dato['permanente']) print "Si"; else print "No"; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$tabella->riga();
|
||||
}
|
||||
$tabella->close();
|
||||
view_footer();
|
||||
?>
|
||||
Reference in New Issue
Block a user