First of all, thanks Ben for all the great work you have done with Phil and the Redux code.
A captcha would be a good idea, perhaps a simple math challenge 😉
I have two questions:
-. Behaviour: The login has no effect unless I check the remember me checkbox. I went on to check what was happening bit by bit. The setup locally is to use database sessions:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
and $config[‘encryption_key’] set to something 32 chars long as suggested (should be in the README).
Well, after checking the cookies in the browser, nothing weird was found. After checking the user_data column in the ci_sessions table I found out that the last words in the column were “Sesi”, which corresponds to the first 4 characters of Spanish translation for $lang[‘login_successful’]
I have gone thru all the forums at codeigniter and Google and found nothing, but commenting the 363 line of libraries\Ion_auth.php to
//$this->set_message('login_successful');
gives no error because the message in the session is not set. Now I can login whether I click on remember me or not, but closing the browser and opening it again has the same behaviour whether I chose one or the other. Could someone reproduce this issue?
-. Along the issue above, the “remember me” checkbox seems to always return a value of 1 (which is always set) instead of using the checked value of that input. At controllers\auth.php I changed the following lines from:
if ($this->input->post('remember') == 1) {
$remember = true;
}
else {
$remember = false;
}
to:
$urlsas=$this->input->post('remember');
if (isset($urlsas[0])) {
$remember = true;
}
else {
$remember = false;
}
and the code at \views\auth\login.php to
<?php echo form_checkbox('remember[]', 'recuerda', FALSE);?>
Would this be a better implementation?
And one weird issue:
If I change the default public function username_check($username = ‘’) at ion_auth_model.php to the suggested code on page 25:
public function username_check($username)
{
if ($this->ion_auth->username_check($username))
{
$this->form_validation->set_message('username_check', 'The username "'.$username.'" already exists.');
return FALSE;
}
else
{
return TRUE;
}
}
Apache.exe closes unexpectedly on windows when entering the correct email and password at http://localhost/ci/index.php/auth/login.
Great community here!