<?php
include_once ("../core/config.php");
$UTENTE = login();
$DIRITTI = diritti(1);
?>
<html>
<head>
<?php
if (isset($_GET['id'])) {
	$id = $_GET['id'];
	if (isset($_GET['azione'])) {
		$azione = $_GET['azione'];
		switch ($azione) {
			case "attiva":
				$query = "UPDATE proxy_acl_list SET attivo = 1, data = NOW() WHERE id = $id";
				mysql_query( $query, $DB_ID );
			break;
			case "disattiva":
				$query = "UPDATE proxy_acl_list SET attivo = 0, data = NOW() WHERE id = $id";
				mysql_query( $query, $DB_ID );
			break;
			case "attiva_acl":
				$query = "UPDATE proxy_acl SET attivo = 1, data = NOW() WHERE id = $id";
				mysql_query( $query, $DB_ID );
			break;
			case "disattiva_acl":
				$query = "UPDATE proxy_acl SET attivo = 0, data = NOW() WHERE id = $id";
				mysql_query( $query, $DB_ID );
			break;
			case "rimuovi":
				$query = "DELETE FROM proxy_acl WHERE id = $id";
				mysql_query( $query, $DB_ID );
			break;
			default:
				$testo = "Regola non implementata";
			break;
		}
	}
}
?>
<script type="text/javascript">
	document.location.href='<?php print $_SERVER['HTTP_REFERER']?>'
</script>
