Example #1
0
 public static function nivelRestrito(array $nivel, $admin = FALSE)
 {
     if (!Session::get('autenticado')) {
         header("location: " . URL . "error/acesso/5050");
         exit;
     }
     Session::tempo();
     if ($admin == FALSE) {
         if (Session::get("nivel") == "administrador") {
             return;
         }
     }
     if (count($nivel)) {
         if (in_array(Session::get('nivel'), $nivel)) {
             return;
         }
     }
     header("location: " . URL . "error/acesso/5050");
 }