Welcome Guest, Not a member yet? Register   Sign In
Working Example for Erkana Auth
#3

[eluser]singlepringle[/eluser]
Hi Imzyos,

thanks for the offer!
Problem: _check_login does not return any Value.

Controller login.php
Code:
class Login extends Controller {

    function Login()
    {
        parent::Controller();
        // load the associated language file
        $this->lang->load('layout');
        $this->lang->load('content');
        
        $this->load->library('Erkanaauth');
        $this->load->library('validation');
    }


    function index()
    {
        $rules['username'] = "required";
        $rules['password'] = "required";
        
        $this->validation->set_rules($rules);
        
        $username = $this->input->post('username');
        $password = $this->input->post('password');
    
      // Validation Rules and Fields
      if ($this->validation->run() == False) {
          $data['result'] ='no validation';
        $this->load->view('login', $data);

      } else {
          $this->_check_login($username, $password);
        if(!$this->erkanaauth->try_session_login($username, $password)) {
            $this->load->view('login');
        } else {
            $this->load->view('account');
        }
      }
    }
    
    function _check_login($username, $password) {
      $this->load->helper('security');
      $password = dohash($this->input->post('password'));
      if ($this->erkanaauth->try_login(array('username'=>$username, 'password'=>$password))) {
        return TRUE;

      } else {
        $this->validation->set_message('_check_login', 'Incorrect login info.');
        return FALSE;

      }
    }
}


Messages In This Thread
Working Example for Erkana Auth - by El Forum - 01-10-2008, 05:48 AM
Working Example for Erkana Auth - by El Forum - 01-10-2008, 01:16 PM
Working Example for Erkana Auth - by El Forum - 01-11-2008, 04:25 AM
Working Example for Erkana Auth - by El Forum - 01-11-2008, 01:36 PM
Working Example for Erkana Auth - by El Forum - 01-11-2008, 06:22 PM
Working Example for Erkana Auth - by El Forum - 01-12-2008, 12:26 AM
Working Example for Erkana Auth - by El Forum - 01-12-2008, 12:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB