Welcome Guest, Not a member yet? Register   Sign In
Feedback on session check, login system.
#3

[eluser]überfuzz[/eluser]
Code:
//menu prep. At the moment the site has no other pages than in-menu-pages thats going to be public.
        $menu = $this->systemdata->get_menu();
        foreach($menu AS $array)
        {
            $keys_unlocked[] = $array['segment'];
        }
//------ check for segments not public
        if( in_array ($this->uri->rsegment(1), $keys_unlocked) )
        {
            $is_logged_in = $this->session->userdata('logged');
            if(!$is_logged_in)
            {
                redirect('login');
            }
        }

This is the code I'm planing to use, not tested. Pointers appreciated! For instance, I'm not sure of when 404 is trowed. (It's stated in the MY_Controller, in __construct().)


Messages In This Thread
Feedback on session check, login system. - by El Forum - 09-23-2009, 05:02 AM
Feedback on session check, login system. - by El Forum - 09-23-2009, 05:11 AM
Feedback on session check, login system. - by El Forum - 10-01-2009, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB