<?php
    $login = new Login();
    if($login->isLogged()){
        //$controller esta seteado en cada controller
        $login->setCurrentController($controller);
        
        if($controller == 'index'){
            //header('Location: /Controller/Home.php');
            /*Ante lo enviaba a Home, pero ahora lo dejo en index y ahi decide a que controller lo manda*/
        }else{
            $acl = new Acl($login->getId());
            if(!$acl->isAllowed($controller,$action)){
                header('Location: /index.php');
                exit;
            }
        }
    }else{
        if($controller != 'index'){
            header('Location: /');
        } 
    }