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

[eluser]Ben Edmunds[/eluser]
d3ptzz,

Your welcome Wink

[eluser]Kinsbane[/eluser]
Hey Ben,

I just upgraded my files to your latest gits and am receiving an error when trying to login with the default account - it appears to be in the function identity_check() within ion_auth_model.php, on or around line #332 here's what my error says:
Quote:A Database Error Occurred

Error Number: 1064

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'' at line 2

SELECT COUNT(*) AS `numrows` WHERE `0` = 'admin@admin.com'

Here's the function:
Code:
protected function identity_check($identity = '')
    {
        if (empty($identity))
        {
            return FALSE;
        }

        return $this->db
            ->where($this->identity_column, $identity)
            ->count_all_results($this->tables['users']) > 0;
    }

I've got my newest ion_auth config file setup how I need, but not sure why it's querying field `0` for the email.

Any ideas that could help out? Thanks.

[eluser]owls[/eluser]
Other than form_validation, are there any major obstacles to using ion auth with codeigniter 1.6.2?

[eluser]Ben Edmunds[/eluser]
Owls,

I have no idea, other than form_validation I don't remember any big changes...

Give it a go and I'll help you if you run into problems.

[eluser]Ben Edmunds[/eluser]
Kisbane,

Try replacing $this->identity_column with $this->config->item('identity', 'ion_auth') and let me know what happens.


Thanks,

[eluser]Rob B.[/eluser]
Hi -- Thanks for the great library. Just wanted to let you know that I ran into the same problem Bernd discussed in this reply (http://ellislab.com/forums/viewreply/733952/) about the $this->ion_auth->_extra_where problem in the Ion auth model. I ended up commenting out line 899 (in the login_remembered_user() function) in ion_auth_model.php as follows:

Code:
//get the user
        $query = $this->db->select($this->identity_column.', id, group_id')
            ->where($this->identity_column, get_cookie('identity'))
            ->where('remember_code', get_cookie('remember_code'))
            // ->where($this->ion_auth->_extra_where)
            ->limit(1)
            ->get($this->tables['users']);

and that enabled CI to run properly. I'm not really sure I understand what this property is for (I did read through the definition in the library, but it's still not that clear to me). Perhaps this could be a config variable that could be turned off if not needed. Anyway, I just wanted to post this as another case of this issue in the case it is helpful to you. Thanks!

Rob

[eluser]Ben Edmunds[/eluser]
Hey Rob,

Thanks. I just pushed a fix for this. There seems to be a problem with the extra_where only when ran in the constructor of the library. I haven't been able to re-produce this issue to give it a good once over but from Bernd's troubleshooting this is the fix he came up with and should work fine.

The extra_where is there for multiple domain systems and any other system where users might need to have the same identity but need separate accounts.

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

Try replacing $this->identity_column with $this->config->item('identity', 'ion_auth') and let me know what happens.


Thanks,[/quote]

Hey Ben,

Well my first thought was, "I hadn't upgraded CI since I did Ion Auth", so I upgraded CI to 1.7.2 - but that was no fix. Changing from $this->identity_column to $this->config->item('identity', 'ion_auth') also didn't seem to work.

So then I thought, "OK! I'll just use ->where('email', $identity) !!"
But, this doesn't work either:
Quote:A Database Error Occurred

Error Number: 1064

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 `email` = 'admin@admin.com'' at line 2

SELECT COUNT(*) AS `numrows` WHERE `email` = 'admin@admin.com'

Something fishy is going on here. :/

[eluser]spmckee[/eluser]
Same exact error as Kinsbane.

Worked fine on localhost:
PHP Version 5.2.9
MySQL client version: 5.0.51a

1064 error on dev server:
PHP Version 5.2.6
MySQL client version: 5.0.45

[eluser]Kinsbane[/eluser]
I just realized that the AR commands in here aren't selecting a table to select from whatsoever:
Code:
return $this->db->get_where('users', array('email' => $identity), 1, 0);

Outputs this error:
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




Theme © iAndrew 2016 - Forum software by © MyBB