All pastes #974432 Raw Edit

Something

public text v1 · immutable
·published 2008-04-06 20:04 UTC
rendered paste body
#######/config/hooks.php

$hook['post_controller'] = array(
                                'class'    => 'security',
                                'function' => 'security',
                                'filename' => 'security.php',
                                'filepath' => 'hooks'
                                );

#######/hooks/security.php

class security
{

	var $ci;

	function security ()
	{

			$this->ci =& get_instance();
			$this->check_login();
			
	}
		
	function check_login()
	{
		if ($this->ci->uri->segment(1) != 'login' && $this->ci->uri->segment(1) != 'bot')
		{
					
			if ($this->ci->session->userdata('loggedin') === FALSE)
			{
				redirect('/login');
			}
			
		}
	}

}