<?php
//namespace proyectos\application\libraries;
require_once __DIR__."/NavSession.php";

class LibApp
{
    private $ci;
    public function __construct()
    {
        $this->ci=&get_instance();
    }
    public function checkIssetSession()
    {
        if(!$this->ci->session->has_userdata('session'))
        {
            redirect("login");
        }
    }
    public function getUsuario()
    {
        if($this->ci->session->has_userdata('session'))
        {
            $navSession=NavSession::cast(unserialize($this->ci->session->userdata("session")));
            return $navSession;
        }
        return null;
    }
    public function getUsuarioSession()
    {
        if($this->ci->session->has_userdata('session'))
        {
            $navSession=NavSession::cast(unserialize($this->ci->session->userdata("session")));
            return $navSession->getUsuario();
        }
        return null;
    }
    
}

