Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Ben Edmunds[/eluser]
Kisbane,

You're saying the count_all_results($this->tables['users']) doesn't contain the table name?


Thanks,

[eluser]Kinsbane[/eluser]
[quote author="Ben Edmunds" date="1271809180"]Kisbane,

You're saying the count_all_results($this->tables['users']) doesn't contain the table name?


Thanks,[/quote]
Yep, that seems like where the error lies - although I'm not sure why the query formed is trying to find a field `0` - shouldn't it be the $identity field it looks for? (username or email)

[eluser]spmckee[/eluser]
OK, I think I narrowed it down.

I was auto-loading the ion_auth config file, once I removed that all was fine.

In the user guide here: http://ellislab.com/codeigniter/user-gui...onfig.html it says to load a config file with
Code:
// Stored in an array with this prototype: $this->config['blog_settings'] = $config
$this->config->load('blog_settings', TRUE);

in the current ion_auth_model.php the code is
Code:
$this->load->config('ion_auth', TRUE);
(load and config are switched.)

[eluser]Ben Edmunds[/eluser]
If someone can troubleshoot this some more and let me what you find I would be appreciative. I'll try to make time to test this tomorrow or the day after and see if I can reproduce the issue.


spmckee,
You can load the config either way. The loader class simply calls the config class when loading config files.


Thanks!

[eluser]spmckee[/eluser]
[quote author="Ben Edmunds" date="1271838258"]
spmckee,
You can load the config either way. The loader class simply calls the config class when loading config files.


Thanks![/quote]

Yeah, I figured you can. I'm not sure why but I had the exact same issue and removing the autoload cleared it for me.

Anyhow, thanks for all the hard work!

[eluser]acormack[/eluser]
Hi Ben,

Thanks for Ion Auth it is working really well on my site.

I just wondered if anyone can please suggest a way of automatically logging out the user if they close the browser window without logging out.

I know that the session will expire automatically after n minutes. But it scares the users that if they close the browser and then reopen it soon after they are still logged in.

I wondered if I should create a second cookie with expiry set to zero (that expires on browser close) and require both cookies before allowing login?

Any ideas / suggestions would be gratefully received.

Thanks again Ben!

Alec

[eluser]Kinsbane[/eluser]
Okay I replaced the query in the Model's identity_check () function to this:
Code:
return $this->db->query("SELECT COUNT(*) AS numrows FROM users WHERE email='".$identity."'");

That seems to have done the trick - however, inside the Model's login function, is this query with AR:
Code:
$query = $this->db->select($this->identity_column.', id, password, group_id')
            ->where($this->identity_column, $identity)
            ->where($this->ion_auth->_extra_where)
            ->where('active', 1)
            ->limit(1)
            ->get($this->tables['users']);

Which outputs this SQL error (please take note of the query here):
Quote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `0` = 'admin@admin.com' AND `active` = 1 LIMIT 1' at line 2

SELECT `id`, `password`, `group_id` WHERE `0` = 'admin@admin.com' AND `active` = 1 LIMIT 1

The SQL query being output last, as above, is actually NOT selecting anything from a table - also, it wants to find the field `0` for an instance of admin@admin.com - I believe this to be wrong.

I'm still trying to get the hang of method chaining (like, what is the proper, prescribed order for AR query chaining?), but this seems to be it.

I tried spmckee's suggestion, above, but it did not work.

[eluser]Ben Edmunds[/eluser]
Alec,

Not sure what you mean exactly... Are you using the "remember me" functionality?

[eluser]Ben Edmunds[/eluser]
Kisbane,

I'm still not sure what's up with the identity check but try out the newest code and see if that fixes the login issue.

Are you only experiencing this on auto-login or on normal logins as well?


Thanks,

[eluser]acormack[/eluser]
Hi Ben

Quote:Alec,

Not sure what you mean exactly… Are you using the “remember me” functionality?

No I am not using remember me. Just the standard Ion Auth login mechanism.

It works really well and expires my session after n minutes of no activity. What I additionally want it to do is expire my session "immediately if the browser window is closed" and/or "after n minutes of no activity".

Currently a user can login, close their browser, reopen their browser immediately and they are still logged in.

Thanks in Advance

Alec




Theme © iAndrew 2016 - Forum software by © MyBB