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

[eluser]Ben Edmunds[/eluser]
jk215,

So you change identity to username, then try to login with username=admin and you get a login error.

Make sure the username is set in the DB. You might have to throw some debug code in ion_auth_model->login()...

[eluser]Kevin Smith[/eluser]
Hey Ben, thanks for all your work on this. Forgive me if my question is answered in one of the 83 other pages for this thread; I couldn't find it by searching.

Do you have any plans in the works for making Ion Auth compatible with MongoDB?

[eluser]Ben Edmunds[/eluser]
Kevin,

Not really, a lot of the time even if your using a nosql database you would store users in a sql db.

If you write a model for it though send me a pull request, I'm sure it would help others.

[eluser]phpserver[/eluser]
I am using ion auth with sqlite3.I commented lines 549 and 884 of ion_auth_model and it worked,although i am gonna look at it later,see the auth model on sync in.I am using codeigniter 1.7.2 and PDO sqlite3 pdo driver here is the sql:

Code:
CREATE TABLE [ci_sessions] (
[session_id] VARCHAR(40)  NULL PRIMARY KEY,
[ip_address] VARCHAR(16)  NULL,
[user_agent] VARCHAR(50)  NULL,
[last_activity] INTEGER(10)  NULL,
[user_data] VARCHAR(400)  NULL
);


CREATE TABLE [groups] (
[id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,
[name] VARCHAR(100)  NULL,
[description] VARCHAR(100)  NULL
);

CREATE TABLE [meta] (
[id] INTEGER  NOT NULL PRIMARY KEY AUTOINCREMENT,
[user_id] INTEGER  NULL,
[first_name] VARCHAR(50)  NULL,
[last_name] VARCHAR(50)  NULL,
[company] VARCHAR(100)  NULL,
[phone] VARCHAR(20)  NULL
);


CREATE TABLE [users] (
[id] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,
[group_id] INTEGER  NULL,
[ip_address] VARCHAR(40)  NULL,
[username] VARCHAR(15)  NULL,
[password] VARCHAR(40)  NULL,
[salt] VARCHAR(40)  NULL,
[email] VARCHAR(100)  NULL,
[activation_code] VARCHAR(40)  NULL,
[forgotten_password_code] VARCHAR(40)  NULL,
[remember_code] VARCHAR(40)  NULL,
[created_on] INTEGER  NULL,
[last_login] INTEGER  NULL,
[active] INTEGER  NULL
);

[eluser]Kevin Smith[/eluser]
[quote author="Ben Edmunds" date="1300702925"]Kevin,

Not really, a lot of the time even if your using a nosql database you would store users in a sql db.

If you write a model for it though send me a pull request, I'm sure it would help others.[/quote]

Ah, thanks for the info. I'm still dipping my toes into this NoSQL thing, so I haven't yet figured out best practices.

[eluser]jk215[/eluser]
[quote author="Ben Edmunds" date="1300565021"]jk215,

So you change identity to username, then try to login with username=admin and you get a login error.

Make sure the username is set in the DB. You might have to throw some debug code in ion_auth_model->login()...[/quote]

Yes that is correct. I changed the config to 'username' and attempted to login in the default auth/login screen. Assuming everything is at default, do I have to change anything? Am I supposed to make my own login controller/view to accommodate switching the identity? Not sure what you mean by making sure the username is set in the DB. Im trying to retrieve the default 'administrator' row of the DB.

Also I created a function to get user by username in the ion_auth_model and it isnt returning an object. I basically copied the get_user_by_email function verbatim. Can anyone tell me why this doesnt work?

Code:
public function get_user_by_username($username)
    {
        $this->db->where($this->tables['users'].'.username', $username);
        $this->db->limit(1);

        return $this->get_users();
    }

[eluser]Ben Edmunds[/eluser]
jk215,

Yes you will have to modify the controller and views to support username instead of email.

[eluser]phpserver[/eluser]
[quote author="Kevin Smith (Hearsay)" date="1300731906"][quote author="Ben Edmunds" date="1300702925"]Kevin,

Not really, a lot of the time even if your using a nosql database you would store users in a sql db.

If you write a model for it though send me a pull request, I'm sure it would help others.[/quote]

Ah, thanks for the info. I'm still dipping my toes into this NoSQL thing, so I haven't yet figured out best practices.[/quote]

I have been looking at nosql and how one can implement it fully and its a huge undertaking by all means.I have been using cache db for hierarchical data and its kind of impressive.To add a proper nosql driver you have to figure a way to handle unstructured data and be a champion of the topic maps concept.

[eluser]rulin[/eluser]
[quote author="Ben Edmunds" date="1300768442"]jk215,

Yes you will have to modify the controller and views to support username instead of email.[/quote]

Hi Ben

I've sent jk215 my modified controller/views to allow log in with username.
Looks like it's working fine for him.

If anyone else is struggling to change from email to username please PM me and I'll gladly let them have a copy.

Russ

[eluser]Ben Edmunds[/eluser]
Thanks Russ!




Theme © iAndrew 2016 - Forum software by © MyBB