|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
User system advice
Hi guys.
I,m currently TRYING to design an elegant, portable and feature rich user membership system, and i,m looking for advice and how to accomplish this. The main thing it must comply with, is easy implemntation within allready coded websites. At the moment, I,m considering the User, Groups, Usergroups, Modules approach, but I feel its somewhat messy, as far as the Modules table is concerned, because there would be lots of modules for each permission I would like to check for. Lets take a News section for instance... There would be a Module called "News", everyone who had this related to there group, would be able to read it, but then you would have "News Submit" etc,etc. So I think it also needs a permission system, but I,m unsure which is the best way to go, hence this post. Any advice would be appreciated. Thankyou. |
|
#2
|
|||
|
|||
|
RE: User system advice
Which language are you planning to use? PHP would be the obvious one as this is a PHP orientated site where help for that would be much larger than for other languages.
On a separate note, I'd suggest the use of classes of functions that are common to several sections of the system. Its more efficient in terms of code size as the functions only have to be written out in full once. |
|
#3
|
||||
|
||||
|
RE: User system advice
yeah if you want to be able to optimum integration with an existing site, an object oriented solution is by far the best way to go. Read up on those, you won't regret it. As far as permissions go, in the users database table, have a field called "access" and have a number rating from 1-5 or 1-10 (depending on how many levels of user you want). then make admin the highest, and banned the lowest. Then you can easily manage them and for instance SELECT * FROM users WHERE access > '7' or something like that.
|
|
#4
|
|||
|
|||
|
RE: User system advice
I'm a fan of the bitfield approach for a permissions system... I don't do a good job of explaining it, but basically, you use PHP's bitwise operators, and store permissions in each bit of a number. That allows for 32 fields per number, and allows alot of control. I'd google bitfields, you'll probably find C examples, but it applies to PHP too. Thats just my way of doing it, jam's works just fine too, just less fine tuned control
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > User system advice |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|