Hi guys, we had a site developed offshore and they decided to use Tank auth as the user authentication system. Originally the login script worked via ajax: the user would enter their credentials and then a json string would be returned indicating weather or not the the credentials were correct or not. Our offshore development team created 2 sample users and were able to log them in without a problem.
I have decided we do not want to use ajax with our log in and have applied a more traditional method of accomplishing this. When a user first goes to http://localhost/site/login they see the username and password box (with a “remember me” check box). When they hit submit they get sent to http://localhost/site/confirm_login This .is where I am experiencing an issue. I am able to login with the 2 sample users my offshore team has registered but I cannot log in with new users I have registered afterwards. This is what my confirm_login() function looks like:
function confirm_login() {
if (count($_POST)) {
$this -> load -> library('form_validation');
$this -> form_validation -> set_rules($this -> validate_login);
if ($this -> form_validation -> run()) {
$email = $this -> input -> post('email_login');
$pass = $this -> input -> post('password_login');
$rememberme = $this -> input -> post('rem_login');
if ($this -> tank_auth -> login($email, $pass, $rememberme, FALSE, TRUE)) {// success
$do_loggedin_stuff;
} else {
redirect('/site/login/err');
}
}
}
}
this is what theirs looked like:
function confirm_login(){
if(count($_POST)){
$this->load->library('form_validation');
$this->form_validation->set_rules($this->validate_login);
if($this->form_validation->run()){
$email = $this->input->post('email_login');
$pass = $this->input->post('password_login');
$rememberme = $this->input->post('rem_login');
if ($this->tank_auth->login($email, $pass, $rememberme, FALSE, TRUE)) { // success
$do_loggedin_stuff;
exit();
} else {
$errors = $this->tank_auth->get_error_message();
$er = '{"error":"';
foreach ($errors as $v) {
$er .= $this->lang->line($v) . '<br />';
}
echo $er.'"}';
}
}
}
}
Neither of these functions work on the new users (they do work on the first two usample users my offshore team delivered the product with.
