Welcome Guest, Not a member yet? Register   Sign In
Verficiation before loading page
#5

[eluser]xwero[/eluser]
Code:
function access_allowed()
{
    $controllers = array('crtl1','ctrl2'); // you can move this to the hooks.php params key for more flexibility
    $CI =& get_instance();
    $CI->load->helper('url'); // to be on the safe side
    // check if the controller is protected
    if(in_array($CI->uri->rsegment(1),$controllers))
    {
        // do some more checking
        if ($something == FALSE)
        {
             redirect('some/error/page');
        }
    }
}
Call this function in a post_controller_hook


Messages In This Thread
Verficiation before loading page - by El Forum - 12-10-2008, 03:28 AM
Verficiation before loading page - by El Forum - 12-10-2008, 03:47 AM
Verficiation before loading page - by El Forum - 12-10-2008, 04:10 AM
Verficiation before loading page - by El Forum - 12-10-2008, 05:15 AM
Verficiation before loading page - by El Forum - 12-10-2008, 05:15 AM
Verficiation before loading page - by El Forum - 12-10-2008, 05:29 AM
Verficiation before loading page - by El Forum - 12-10-2008, 05:48 AM
Verficiation before loading page - by El Forum - 12-10-2008, 06:52 AM
Verficiation before loading page - by El Forum - 12-10-2008, 06:56 AM
Verficiation before loading page - by El Forum - 12-10-2008, 06:59 AM
Verficiation before loading page - by El Forum - 12-10-2008, 07:03 AM
Verficiation before loading page - by El Forum - 12-10-2008, 07:03 AM
Verficiation before loading page - by El Forum - 12-10-2008, 07:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB