0

I know i have already asked this question but i didn't want to reply to an old thread :)

But i have made a second table in my database named members_info the other table is named members and it holds the usernames and passwords.

My question is how can i have a users username in there and make certain permissions for this person?

Thanks !

2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by huntaz556
0

You could also just extend the members table and add a new column named 'permission' that is an integer. The integer corresponds with the level of authentication:

0 :: Member
1 :: Admin
2 :: Superadmin
3 :: President
4 :: Superman

Something like that. And in the code you can test that value: if ($permission > 2) { ....... } ~G

0

Wouldnt that require 5 new fields in members ? And then how would i assign a user either 0, 1, 2, 3, 4 or 5?

0

Wouldnt that require 5 new fields in members ?

No, only 1 field: permission. E.g.

Username Password Permission
--------- --------- -----------
Dude secret 2
Guy cube 0

And so on.

And then how would i assign a user either 0, 1, 2, 3, 4 or 5?

When you insert an user to the database, for example when he registers, he is standard assigned member (0) permission. You could write a script that allows users to assign permission to users below its own permission (e.g. an superadmin can make a member admin, but can't make a member superadmin or president).

You can make it as complex as you want.

~G

Edited by Graphix: n/a

0

Thanks i've got my database set up now i just need to define privileges. Now that i think of it that seems kind of easy lets see if i can work out the php code now :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.