Inizio abilitazione modulo proxy

This commit is contained in:
cmaffio
2016-03-09 15:02:46 +01:00
parent 1bacc3232e
commit a5ed0d219d
30 changed files with 576 additions and 1153 deletions

View File

@@ -98,13 +98,24 @@ function login () {
}
}
function carica_conf () {
function carica_conf ($modulo="") {
global $CONF, $DB_ID;
$query = "SELECT variabile, valore FROM conf";
if ($modulo != "") {
$query = "SELECT prefisso FROM moduli WHERE nome = '$modulo'";
$res = mysql_query( $query, $DB_ID );
$dato = mysql_fetch_array ( $res );
$tabella = $dato['prefisso']."conf";
} else {
$tabella = "conf";
}
$query = "SELECT variabile, valore FROM $tabella";
$res = mysql_query( $query, $DB_ID );
while ($dato = mysql_fetch_array ( $res )) {
$CONF[$dato[0]] = $dato[1];
$tmp[$dato[0]] = $dato[1];
}
return $tmp;
}
function isadmin () {
@@ -390,7 +401,7 @@ function lista_moduli () {
<?php
}
function diritti () {
function diritti ($minimo) {
global $UTENTE, $DB_ID, $CONF;
preg_match ('/^'.preg_replace('/\//','\/',$CONF['base_url']).'\/([^\/]+)\/.*/', $_SERVER['REQUEST_URI'], $trovato);
@@ -423,7 +434,7 @@ function diritti () {
$risposta = 0;
}
if ($risposta) {
if ($risposta >= $minimo) {
return $risposta;
} else {
header("location: ".$CONF['base_url']."/index.php");
@@ -443,4 +454,14 @@ function get_levels () {
return $livelli;
}
function view_top () {
global $CONF, $UTENTE;
include_once ($_SERVER["CONTEXT_DOCUMENT_ROOT"].$CONF['base_url']."/core/top.php");
}
function view_footer () {
global $CONF, $UTENTE;
include_once ($_SERVER["CONTEXT_DOCUMENT_ROOT"].$CONF['base_url']."/core/footer.php");
}
?>