Inizio gestione condes

This commit is contained in:
cmaffio
2016-05-18 17:14:40 +02:00
parent cbf0610ee0
commit de0e6e1867
11 changed files with 450 additions and 28 deletions

View File

@@ -8,4 +8,6 @@ $db_data_pwd = "Lx7w3e8dNPfwwc3z";
require_once ("function.php");
$DB_ID = db_data_connect ();
$CONF = carica_conf();
$MODULO = modulo();
?>

View File

@@ -464,6 +464,30 @@ function lista_moduli () {
<?php
}
function modulo () {
global $DB_ID, $CONF;
preg_match ('/^'.preg_replace('/\//','\/',$CONF['base_url']).'\/([^\/]+)\/.*/', $_SERVER['REQUEST_URI'], $trovato);
$modulo = $trovato[1];
$query = " SELECT
id,
nome
FROM
moduli
WHERE
moduli.directory = '$modulo'
";
$res = mysql_query( $query, $DB_ID );
$risposta = "NIENTE";
if ($dato = mysql_fetch_array ($res)) {
$risposta = $dato;
}
return $risposta;
}
function diritti ($minimo) {
global $UTENTE, $DB_ID, $CONF;
@@ -539,7 +563,7 @@ function get_levels () {
}
function view_top () {
global $CONF, $UTENTE;
global $CONF, $UTENTE, $MODULO;
include_once ($_SERVER["DOCUMENT_ROOT"].$CONF['base_url']."/core/top.php");
}

View File

@@ -10,10 +10,11 @@
if ($UTENTE['utente'] != '') { ?>
<tr><td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<?php html_spazi (array(33, 33, 0)); ?>
<tr bgcolor="#FFC350">
<td nowrap class="ltop">Utente: <?php print $_SESSION['username'] ?></td>
<td width="200">&nbsp;</td>
<td class="rtop"><a class="rtop" href="<?php print $CONF['base_url'] ?>/core/logout.php">Logout</a></td>
<td nowrap class="ctop"><?php if ($MODULO['nome'] != "") print "Modulo: ".$MODULO['nome'] ?></td>
<td nowrap class="rtop"><a class="rtop" href="<?php print $CONF['base_url'] ?>/core/logout.php">Logout</a></td>
</tr>
</table>
</td></tr>