Fix path
This commit is contained in:
@@ -108,11 +108,11 @@ function carica_conf () {
|
||||
}
|
||||
|
||||
function isadmin () {
|
||||
global $UTENTE;
|
||||
global $UTENTE, $CONF;
|
||||
if ($UTENTE['admin']) {
|
||||
return;
|
||||
} else {
|
||||
header("location: main.php");
|
||||
header("location: ".$CONF['base_url']."/index.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ function logga ($testo, $dest="") {
|
||||
// print "-- $sessione --";
|
||||
$query = "INSERT INTO accessi_utenti SET utente = '$destinatario', quando = now(), ip = '$ip', cosa = '$testo', sessione = '$sessione'";
|
||||
$queryuser = "UPDATE utenti SET ultimo = now() WHERE utente = '$destinatario'";
|
||||
// print "-- $queryuser --";
|
||||
// print "-- $query --";
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
$res = mysql_query( $queryuser, $DB_ID );
|
||||
}
|
||||
@@ -327,4 +327,56 @@ function azioni ($tabella, $idtabella, $stato) {
|
||||
}
|
||||
}
|
||||
|
||||
function lista_moduli () {
|
||||
global $UTENTE, $DB_ID, $CONF;
|
||||
|
||||
$query = " SELECT
|
||||
moduli.nome AS nome,
|
||||
moduli.directory AS directory
|
||||
FROM
|
||||
utenti
|
||||
JOIN
|
||||
permessi ON utenti.id = permessi.id_utenti
|
||||
JOIN
|
||||
moduli ON moduli.id = permessi.id_moduli
|
||||
WHERE
|
||||
utenti.utente = '".$_SESSION['username']."'
|
||||
";
|
||||
|
||||
$menu[] = array("Home", $CONF['base_url']."/core/main.php");
|
||||
|
||||
if ($UTENTE['admin']) {
|
||||
$menu[] = array("Configurazione", $CONF['base_url']."/core/conf.php");
|
||||
$query .= " OR moduli.superadmin = 1";
|
||||
}
|
||||
|
||||
$res = mysql_query( $query, $DB_ID );
|
||||
|
||||
while ($dato = mysql_fetch_array ($res)) {
|
||||
$menu[] = array($dato['nome'], $CONF['base_url']."/".$dato['directory']."/index.php");
|
||||
}
|
||||
|
||||
$menu[] = array("Cambio password", $CONF['base_url']."/core/chkpasswd.php");
|
||||
|
||||
$pezzi = preg_split('/\//', $_SERVER["PHP_SELF"], -2);
|
||||
$self = $pezzi[count($pezzi)-1];
|
||||
?>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="90%">
|
||||
<tr bgcolor="#d2f4df">
|
||||
<?php for ($i=0; $i<count($menu);$i++) {
|
||||
if ($self == $menu[$i][1]) {
|
||||
$classe = "menuatt";
|
||||
} else {
|
||||
$classe = "menu";
|
||||
}
|
||||
?>
|
||||
<td class="spaziol"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
<td nowrap class="<?php echo $classe?>"><a class="<?php echo $classe?>" href="<?php print $menu[$i][1]?>"><?php print $menu[$i][0]?></a></td>
|
||||
<?php } ?>
|
||||
<td class="spaziol"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user