[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;
}
}
}