Welcome Guest, Not a member yet? Register   Sign In
debugging a library server side
#1

[eluser]benmanson[/eluser]
Hi,

I am having some issues with SimpleLogin. I have a login script that works fine in Firefox but is failing to fire in Safari and IE. The validation is working fine so I have narrowed down the problem to the SimpleLogin side of things. I am not sure how to go about inserting either breakpoints or error code into the SimpleLogin library and then accessing that information in the browser. Can anyone suggest how I should go about doing it?

Also in case anyone can see something immediately wrong with my code, here is the controller:

Code:
function login() {
    
        $data['h1'] = 'cms login';
        $data['nomenu'] = 'y'; // hide menu as this is the login page

        
        // ---------------------------
        //       SET VALIDATION
        // ---------------------------
        $this->load->library('validation');
        
        // check incoming variables
        $rules['login_username'] = "required|min_length[4]|max_length[32]|alpha_dash";
        $rules['login_password'] = "required|min_length[4]|max_length[32]|alpha_dash";
        
        $this->validation->set_rules($rules);
        
        $fields['login_username'] = 'Username';
        $fields['login_password'] = 'Password';
        
        $this->validation->set_fields($fields);
        
        $this->validation->set_error_delimiters('<p id="error">','</p>');
        
        // ---------------------------
        //  RUN VALIDATION + SUBMIT DATA
        // ---------------------------
        
        if ($this->validation->run() == false) {
            // form fails to validate
            $data['status'] = "<p class=\"popfirst\">Please login in to the content management system below.</p>";
            $data['login'] = $this->load->view('cms/loginform','',true);
            $this->load->view('cms/cms_view',$data);
            
        } else {
            // form validates ok
            
            if($this->simplelogin->login($this->input->post('login_username'), $this->input->post('login_password'))) {
                // user logged in ok
                redirect('cms');
            
            } else {
                // failed to login
                redirect('cms/login');
            
            }
        }    
        
    
    } //ends login

Thanks
Ben


Messages In This Thread
debugging a library server side - by El Forum - 10-12-2007, 04:38 PM
debugging a library server side - by El Forum - 10-14-2007, 11:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB