<?php
include_once(__DIR__."/../core.php");

if(!isset($skip_permissions) || !$skip_permissions){
    if(!isUserAutenticated() && strpos($_SERVER["SCRIPT_FILENAME"], "index.php") === false){
        redirect("index.php");
        exit();
    }
    else {
        $permission = true;
        if(isset($permissions)){
            foreach ($permissions as $p) {
                if(isset($modules_info[$p]["permessi"]) && $modules_info[$p]["permessi"] == "-") $permission = false;
            }
        }

        if(!$permission) die(_("Accesso negato!"));
    }
}
?>
