Jump to content

user systems


SyncViews

Recommended Posts

I know how to store (using mysql) and handel the basic stuff like emails, passwords, usernames etc but where do I start with implementing more dynamic stuff eg:

 

-Which groups a user is a member of

-Users access rights for each section (eg can they see the section, are they allowed to post there, do they have moderator rights there etc)

Link to comment
Share on other sites

when you want to do things like this your best bet is to add another field and another table

 

the new field would reference the table by a unique_id

 

the new table references the level of access or whatever you want to define,

 

this is a poor explanation, though I can't think of any examples off the top of my head,

 

the way I learned was to open up a simple open source program that has a similar function to what you want to do and then work backwards,

 

figure out how they did it, and in the process gain understanding,

 

if you have a specific example you'd like help with it will be easier to offer an explanation,

 

most of it comes down to smart code,

 

if (user.level >= group.minlevel) {

do code

} else {

  echo 'you do not have access to do this';

}

 

though you can do much of that in mySQL which is optimized for that sort of thing, for getting started you can work with any specific idea and figure out how to get it to work once, doesn't matter how sloppy the code is,

 

then work on ways to make it cleaner, and leaner

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.