Re: Suggestions please!
| From: | Graham Cossey | Date: | Tue, 22 Nov 2005 14:45:40 +0000 |
| Subject: | Re: Suggestions please! | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-40714@lists.php.net to get a copy of this message | ||
On 11/21/05, Micah Stevens <micah@raincross-tech.com> wrote:
> Sounds like a decision needs to be made. If statements were born for that..
> On Monday 21 November 2005 3:41 am, JeRRy wrote:
> > Hi,
> >
> > Okay I have a dj site, I have alogin script and cookies to handle the
> > login.
> >
> > Next I want to add some permissions for each dj account. Maybe 3 to
> > start with, 3 permissions.
> >
> > A value or y or n will be set in each permission, with n being the
> > default.
> >
> > Now I need to know how to output the permission out with some add php
> > code.
> >
> > So let me explain:
> >
> > Three permissions lets say are perm_1 , perm_2 , and perm_3
> >
> > If user bob has a y in perm_2 I want to output the perm_2 permission.
> > Which lets say is to delete a dj account. So it needs to output some php
> > code to work with the database. Is IF statements relevent/safe for this or
> > is there a better method?
> >
> > So each user account on default will need to also check the values of the
> > permission. So I need a code that checks for a y value in each permission.
> > If none is found than nothing is displayed or a message saying you have no
> > special permissions currently. But if one or more are met than those
> > permissions are outputed to the relevant permission code.
> >
> > If you need any further information please let me know. All help mostly
> > appreciated in advance.
> >
> > J
You may want to consider values.
perm1 on = 1
perm2 on = 3
perm3 on = 5
therefore:
perm1 + perm2 = 4
perm1 + perm3 = 6
Might make some of the permission checking simpler?
Just a thought.
--
Graham