logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-10-2007, 02:19 AM   #1
owner
 
Join Date: Sep 2007
Posts: 64
Default

Ok, here is my next help question. (Told ya I would have a ton!)

I want to make user groups.

Example: Admin, Moderator, normal user, banned

How do you do this?

also, how can you encrypt a users password so in the database it doesnt show the users exact password.

Last edited by owner; 09-10-2007 at 02:35 AM..
owner is offline   Reply With Quote
Old 09-10-2007, 05:51 AM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

create a usergroup column in the db and give each group a number

admin = 1
mod = 2
user = 3
banned = 0

when you create an account you need to add a usergroup dropdown which passes that value into the relevent field in the db

then when you login just assign this value to a session and carry it around. You need then in your security include file to check the group session.

if your using groups then you can build the navigation through php depending on the group level. This means that a user does not see buttons the he is not allowed to click

i can give you an example of this dynamic navigation
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-10-2007, 11:05 PM   #3
owner
 
Join Date: Sep 2007
Posts: 64
Default

Ok, I think I have everything done on the database side. Now, how do I actually use a checking method to figure out what the user is?

Also, how can I make it so that when a user signs up the default group id number stored in the database is whatever number I want.

Example:

admin = 1
mod = 2
user = 3
banned = 0

I would want the default number assigned to people to be 3. Then if I want them mod/admin I would change that in the admin cp.

Last edited by owner; 09-10-2007 at 11:28 PM..
owner is offline   Reply With Quote
Old 09-11-2007, 05:44 AM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

use a dropdown with the initial option set as your default so when you do a submit the initial value (3) would always be your default

////

as you have a user table you should have a group column so when you peform your login and match the username and password and then set the username to a session. At this stage you need to set the group to a session and then call your menu. i can show you how to do this
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-11-2007, 12:23 PM   #5
owner
 
Join Date: Sep 2007
Posts: 64
Default

Quote:
Originally Posted by davidj View Post
use a dropdown with the initial option set as your default so when you do a submit the initial value (3) would always be your default

////

as you have a user table you should have a group column so when you peform your login and match the username and password and then set the username to a session. At this stage you need to set the group to a session and then call your menu. i can show you how to do this
1. Wont that be unsecure using a dropdown menu as someone could download the page remotely and change the variable from 3 to whatever and gain administrative access?

2. I will probably need your help on that.
owner is offline   Reply With Quote
Old 09-11-2007, 12:27 PM   #6
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

how can you change the value of a dropdown which is hardcoded ?
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-11-2007, 12:31 PM   #7
owner
 
Join Date: Sep 2007
Posts: 64
Default

Erm, I think I read what you were talking about a bit wrong.

I have my groups and stuff setup in the database and another part in the users where it shows the group they are in. Now, how do I check what their id is when they login to have an id of X or X
owner is offline   Reply With Quote
Old 09-11-2007, 12:43 PM   #8
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

post your login script
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 09-11-2007, 10:56 PM   #9
owner
 
Join Date: Sep 2007
Posts: 64
Default

Hello,

I really wouldn't like to post my login script, would you mind just giving me an example and then I can try to implement it myself. I would prefer this way anyways instead of just copying what you did to my original script so I can learn a bit more off this way.

Thank you,
-Owner
owner is offline   Reply With Quote
Old 09-13-2007, 12:34 PM   #10
owner
 
Join Date: Sep 2007
Posts: 64
Default

bump,
anyone?
owner is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com