emreakay / CodeIgniter-Aauth

Authorization, Authentication and User Management library for Codeigniter 2.x and 3.x to make easy user management and permission operations
http://emreakay.com
GNU Lesser General Public License v3.0
393 stars 235 forks source link

id groups and members #135

Closed Firefly16 closed 8 years ago

Firefly16 commented 8 years ago

To celebrate your contributor title... an issue ! :smile:

When i add new groups and members, the id continue with the last id added. So, if we had 1,2,3 and we delete 2 and 3, the next one will be 4. Is it possible to fill the DB with the ID not used? to do 1,2 again instead of 1,4 ?

REJack commented 8 years ago

yep that's default by the MySQLs Auto-Incremental ID. with aauth you cant change it, its only possible with phpMyAdmin etc.

REJack commented 8 years ago

if you change the user id, you need to update the user password.

paulcanning commented 8 years ago

Yea, it's really not an issue. If you really wanted, you could maybe reset the AUTO_INCREMENT ID, but you are going to get yourself into a right mess.

And as @REJack states, the password is salted with the users ID (maybe not the best way to salt a password, but hey, it is what it is!)

REJack commented 8 years ago

best way is edit the SQL file before upload/import it, i'm working on a way that aauth creates the db automatically incl changed groups. (a Part of v3)

@paulcanning yeah the hashing is not perfect, i don't know what we could use instead of userID (its a not changeable unique variable for every user)

paulcanning commented 8 years ago

Do you need a salt for the BCRYPT work? If so, maybe take a look at the ion_auth library for inspiration?

Firefly16 commented 8 years ago

For the user its not a real problem but, for groups and perms, i created a control panel to add or delete one, and display them. If the increment do not follow 1,2,3,4, etc, it will not be user friendly for other people who will manage groups. I'm in auto-increment, i don't really now what to change (phpmyadmin). And you say that changing id need to change password too. But if i just change mannually groups and perms (and perms allow for groups), i imagine this is ok (i dont give perms to user, only to groups).

REJack commented 8 years ago

if you change PermID's you need to change them in perm_to_group too. if you change GroupID's you need to change them in user_to_group, perm_to_group too.

paulcanning commented 8 years ago

Users who manage groups etc don't really need to see the ID. Use the group name to be "friendly".

REJack commented 8 years ago

@paulcanning for BCrypt not but its work only on PHP 5 >= 5.5.0 & PHP 7 so i cant switch it with the actual hashing method only as extra option over config and a special SQL file.

yeah with the name its easier for manage groups/perms, the id is only important for the assignment on name changes etc. but its not really a good idea if the perms are hardcoded in PHP

Firefly16 commented 8 years ago

Ok, i think i will use the name, say to me when i can close this 'issue' :P

REJack commented 8 years ago

now i can close it too :smiley:

Firefly16 commented 8 years ago

So much power in you ! :D

paulcanning commented 8 years ago

FYI @Firefly16 you can close your own issues too