View previous topic :: View next topic |
Author |
Message |
jero87 -
Joined: 11 Jul 2007 Posts: 10
|
Posted: Wed Jul 25, 2007 8:29 pm Post subject: Question On Coding... |
|
|
I have a question....
Is there anyway to hide elements of a .php page depending on what group a user is logged into? Such as, if i log into group 1 I cant see a certain <div> or something along those lines. I want to be able to hide pages from users depending on what group they are in.
Thanks guys.... any code would be appreciated.
Owe u one :) |
|
Back to top |
|
 |
rrinc -
Joined: 24 Feb 2006 Posts: 725 Location: Arkansas, USA
|
Posted: Wed Jul 25, 2007 9:00 pm Post subject: |
|
|
Well, do you want to hide the certain divs or not send them to the client at all? If you want to send them but hide them, you can add to the div's style attribute 'display:none'. An example of it being used:
Code: | <div style="display:none;">Hidden Stuff</div> | If you don't want it send at all, just do a check (for the group) with whatever language you're using and then do or do not send the certain divs or whatever. _________________ -Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados. |
|
Back to top |
|
 |
loloyd -
Joined: 03 Mar 2006 Posts: 435 Location: Philippines
|
Posted: Thu Jul 26, 2007 3:53 am Post subject: |
|
|
i think somehow you will be able to do that if you're talking about php interfacing with your abyss web server user groups. you can look at the results of your phpinfo() to check for the available server variables that abyss makes visible to php for servicing. you will be able to see the following server variables which you can use in switch or if statements in your php scripts when printing out web pages:
_SERVER["AUTH_USER"]
_SERVER["PHP_AUTH_USER"]
but i hope aprelium would care enough to explain the differences and nuances between the two. however i wasn't able to find a server variable with "group" in its name that php can access. _________________
http://home.loloyd.com/ is online if the logo graphic at left is showing. |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jul 28, 2007 12:06 am Post subject: |
|
|
loloyd wrote: | _SERVER["AUTH_USER"]
_SERVER["PHP_AUTH_USER"]
but i hope aprelium would care enough to explain the differences and nuances between the two. however i wasn't able to find a server variable with "group" in its name that php can access. |
The first is the standard CGI variable that contains the name of the authenticated user.
The second is variable specific to PHP and added by PHP upon script startup. It contains the same value as _SERVER["AUTH_USER"] and _SERVER["REMOTE_USER"].
Regarding the groups, there is no notion of groups in the CGI specification. That's why there is no AUTH_GROUP variable. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
|