Welcome Guest, Not a member yet? Register   Sign In
Is this correct way...
#1

[eluser]mk3[/eluser]
I found solution. how to include in every page login form, but do not really know if it is correct. the method I used is I auto loaded library. and the library constructor is doing the following:
Code:
class Authorize {
    
    //constructor    
    function Authorize(){
        $this->CI =& get_instance();
        $this->CI->load->library('MySmarty');
        $this->CI->load->library('session');
        $this->CI->mysmarty->assign('login_errors', null);
        $this->CI->mysmarty->assign('user', $this->CI->session->userdata('user_data'));
        $this->CI->mysmarty->assign('logged_in', $this->CI->session->userdata('logged_in'));
        if (isset( $_POST['submit']) && $_POST['submit'] == 'Login'){
            $this->login();    
        }
    }

So when login form is submitted authorize library calls function which then processes login.

What it is interesting for me am I doing the right way. It seems OK for me, but I believe there are/can be some issues why this cannot be done.

Also would be nice to hear suggestions and critics.




Theme © iAndrew 2016 - Forum software by © MyBB