gest366/lib/permissions.php

21 lines
565 B
PHP
Raw Permalink Normal View History

2021-02-24 20:40:04 +00:00
<?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!"));
}
}
?>