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

[eluser]Ben Edmunds[/eluser]
Andy78,

You can still use it through the Ion Auth library but you'd want to make a DataMapper model for the basics like querying users.

[eluser]austintbiggs[/eluser]
After checking some DB values I've found that once a user is deleted that their ID is not reused. In fact there are gaps in between ID numbers once new accounts are created, I'm aiming to fix this "bug" in my own system.

For example, I create 5 new accounts and their ID in the DB is set to Auto_Increment. If I delete user 3 I would like for the ID 3 to be reused upon creating a new account, but instead a gap is created. Instead of using auto_increment how would I reuse the lowest available ID?

Hopefully this post is understandable.

The resulting ID numbers after the above are: 1, 2, 4, 5, [6]

[eluser]Ben Edmunds[/eluser]
austintbiggs,

You DO NOT want to re-use IDs.

IDs should be a completely unique identifier and will be referenced throughout your application, emails that are sent, bookmarks, etc. Also, if you have relations setup, and forget to cleanup on user delete or something happens, you do not want that data related to a new user.

There is no good reason to re-use IDs (size is not a valid reason) so take it from experience and just don't.

[eluser]austintbiggs[/eluser]
That's a valid point, I didn't even really think of that. Thanks, I could've really messed up :]

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

I've made a good bit of progress with Ion Auth v2 so I'd like to invite people to beta test and give me feedback/suggestions. Ion Auth v2 is not backwards compatible but you're DB would be easy enough to upgrade.

This update adds multiple groups per user, more powerful querying, fixes the issue with emails, and adds hooks so the library can be extended properly.


The code can be found here: http://github.com/benedmunds/CodeIgniter...uth/tree/2


Thanks!

[eluser]austintbiggs[/eluser]
Exactly how difficult would it be to migrate or update the db? Do you have a list of the differences / changes so we can make them? or is there a doc somewhere?

[eluser]shenanigans01[/eluser]
Ben : do you have a change lot / list of updates for the V2. I'd like to give it a test but also know what changes were made to the system

[eluser]Ben Edmunds[/eluser]
austintbiggs mikem562,

Not ATM, it's still very alpha. You can look at the SQL file to see the DB differences, the group_id is removed from the users table and a new users_groups table is added to support the user -> groups relations.

[eluser]joytopia[/eluser]
Ben,

perhaps I could test it in a current project.
Database changes seem to be easy.
But do all old methodes keep on working like before?

Best regards

Bernd

[eluser]Ben Edmunds[/eluser]
Bernd,

No the methods have changed as well.

For example, to get the current user as an object you do:

Code:
$user = $this->ion_auth->user()->result();

to get the current user as an array:

Code:
$user_array = $this->ion_auth->user()->result_array();

or to get all the active users order desc by id do:

Code:
$users = $this->ion_auth->where('active', 1)
                        ->order_by('id', 'desc')
                        ->users()
                        ->result();




Theme © iAndrew 2016 - Forum software by © MyBB