<?php if ( ! defined('BASEPATH')) exit('No esta permitido el acceso directo');//impide el acceso directo a este script

class Login {

	//Constructor
	public function __construct(){
		$this->CI =& get_instance();
		!$this->CI->load->library('session') ? $this->CI->load->library('session') : FALSE;
		!$this->CI->load->helper('url') ? $this->CI->load->helper('url') : FALSE;
	}

	public function check_login(){
		if($this->CI->uri->segment(1) != 'inicio' || ($this->CI->uri->segment(2) && $this->CI->uri->segment(1) != 'index')){
			//if($this->CI->uri->segment(2) == 'capacitacion'){}
			if($this->CI->uri->segment(2) && $this->CI->uri->segment(2) == 'cambiar_pass'){}
			elseif($this->CI->session->userdata('nombre') == FALSE)
		    	redirect(base_url('inicio'));
		}
	}

}