[eluser]riwakawd[/eluser]
I can not seem to log in to my dashboard I am getting some errors missing arguments on my login controller and stored hash not working. It says missing arguments on controller but not sure where to add them or what its missing.
Line 31 if($this->CI->rwdsecurity->check_password($password, $stored_hash)) { On Library
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: stored_hash
Filename: libraries/User.php
On My Libraries File
Code:
public function login($username, $password) {
if($this->CI->rwdsecurity->check_password($password, $stored_hash)) {
$data = array(
'isLogged' => true,
'user_id' => $user->id
);
$this->CI->session->set_userdata($data);
$this->user_model->editUser($user->id, array('last_login' => date('Y-m-d H:i:s')));
return true;
}
return false;
}
On The Controller
Code:
public function index() {
$this->login();
}
public function login() {
$data['action'] = site_url('login/login_credentials');
$this->load->view('template/common/login', $data);
}
function login_credentials() {
$this->form_validation->set_rules('username', 'Username', 'required|trim|min_length[3]|max_length[12]|xss_clean|callback_validate');
$this->form_validation->set_rules('password', 'Password', 'required|trim');
if ($this->form_validation->run($this) == false) {
$data['action'] = site_url('login/login_credentials');
$this->load->view('template/common/login', $data);
} else {
redirect('dashboard');
}
}
function validate() {
if($this->user->login()) {
return true;
} else {
$this->form_validation->set_message('validate', "Incorrect Username Or Password");
return false;
}
}