Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Laplink Gold 2008 - $15 Off with Coupon Code CJM9NE
  #1  
Old July 6th, 2002, 07:24 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
Question Member Database

I'm interested in making a database for an organization that contains info about all its members, like Name, e-mail, etc.. The database can be altered by admins like Adding, editing, removing members. When a normal viewer comes to see it. They can order the database by Alphabetical or they can select a certain sub-group inside the organization and view the members within the sub-group. How hard would this be to do?
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #2  
Old July 6th, 2002, 08:12 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Lindset Send a message via AIM to Lindset
It wouldn't be that hard. It really depends on how experienced you are with MySQL (I presume that's what you are using) and PHP..

This is the table layout I was thinking

Users Table
userId | userGroupId | userName | userEmail | etc etc etc...

Group Table
groupId | groupName

A query to select the userId, userName and groupName of all users ordered by their name could for example be formed like this:
SELECT users.userId, users.userName, groups.groupName FROM users LEFT JOIN groups ON users.userGroupId = groups.groupId ORDER BY users.userName asc; (note: change between desc or asc to change between descending or ascending sort)

...

If you were thinking more towards PHP you could be interested in an authentication article/tutorial I'm writing for devarticles.. it should be published later today or tomorrow..
__________________
Best Regards,
Håvard Lindset

Last edited by Lindset : July 6th, 2002 at 08:20 AM.

Reply With Quote
  #3  
Old July 6th, 2002, 07:16 PM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
Thanks alot! Now you're making me think I can actually do this.

Reply With Quote
  #4  
Old July 8th, 2002, 04:50 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to fakker
hi,

you may also want a field in the members table called "status" (or the like) which will determin the status of each member. This way you can run basic IF statements to decide if certain people have the right to do certain things on the site.

ie: If you registered as a normal member (limited functions eg: read only access on the site) your status might be set to "2".
If you are an aministrator you might set your "status" field to "1".

Then you can run statements such as

if $status != "1"
//display arror message or redirect to another page
else
draw the admin table to edit users details / delete user etc


or something like that!

On the other hand, you could simply create another table and call it "admin"... this would keep it seperate from the normal members table.

Look out for Lindsets article, and this could be linked in very nicely!!

__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #5  
Old July 10th, 2002, 07:27 PM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
yeah, i would definately need to have admins put aside from the normal users. how would i display different menus & options for the admins?

Reply With Quote
  #6  
Old July 10th, 2002, 08:01 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Check out Lindset's article on Authentication... it will answer any questions you have.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #7  
Old July 11th, 2002, 01:10 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
I took a look and don't think it is what I mean. In my database, I would require everyone to login. People with Super Admin status could have more features then someone who has regular admin status. Likewise, someone with regular access has only the basic features.

Reply With Quote
  #8  
Old July 11th, 2002, 07:32 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
What you can do is similar to what Lindset said:

Users Table
userId | userGroupId | userName | userEmail | etc etc etc...

Group Table
groupId | groupName


You can add another column "userLevel" to the Users table which determines their access level. Those with level 1 have access to Super Admin areas, those with 2 have admin access, and all others have "user" access.

When you're authenticating a user for login access, also check their access level... On each page you want to block for "Super Admin", have an if statement to verify their access level:

if ($userLevel > 1){
// output msg to advise they don't have enough access
} else {
// grant access
}


... Just a suggestion!

Reply With Quote
  #9  
Old July 11th, 2002, 12:39 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to fakker
yeah, I agree with FrankieShakes... at the top of each page which requires "super member" status.. add code as Frankie says.

What I do is when the user logs in or registers, the "member status" field is returned to a session variable, then at the top of every page I check the value of that variable.

I think this is a secure way of checking the user status..?

If you use cookies to validate the user.......I believe that people can change cookies on their computer to allow them to have full access to a site...but I might be wrong?!

I wouldn't mind some advice on the security issue.... is a session variable secure? or can the value be changed??!

Reply With Quote
  #10  
Old July 11th, 2002, 06:58 PM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
Post

Yeah, I was thinking of doing what FrankieShakes said, however what I mean is after everyone logs in, they get taken to index.php or something. Yet people with Level 1 (Super Admin) would see a different menu with more options then a Level 3 (Regular) would.

Reply With Quote
  #11  
Old July 12th, 2002, 07:08 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
War-Angel,

In your statement that checks if the user has "super admin" access, you would just put an include statement:

include("superadmin.php");

Reply With Quote
  #12  
Old July 12th, 2002, 08:42 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
so...

if (userlevel = 'superadmin')
{ include("superadmin.php"); }
if (userlevel = 'regular)
{ include("normal.php"); }

Like that?

Reply With Quote
  #13  
Old July 12th, 2002, 08:52 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to fakker
that way is probably the best.... for security purposes.. but I have only one menu (menu.php) and at the top I work out what the users membership rights are...

then I use simple if statements to decide if the button is drawn...

so:

if member is superadmin
//draw button
else
//dont draw button


then the next button would be the same etc etc...

I agree with wAr-AnGeL in that using includes might be better... but I am layzeee so I used one file... so I didnt need to update two seperate files if I change colours etc etc....!!


Reply With Quote
  #14  
Old July 12th, 2002, 09:10 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Fakker,

You would probably save a lot of time and hasssle if you used an include... for changing colors, link the page to an external stylesheet (CSS). This way any changes are done to one file, but the changes affect multiple pages.

Reply With Quote
  #15  
Old July 12th, 2002, 09:18 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to fakker
Talking

aaah of course!

cheers!!!!


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Member Database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On