Question On Coding...

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
jero87
-


Joined: 11 Jul 2007
Posts: 10

PostPosted: Wed Jul 25, 2007 8:29 pm    Post subject: Question On Coding... Reply with quote

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 View user's profile Send private message
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Wed Jul 25, 2007 9:00 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Thu Jul 26, 2007 3:53 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Jul 28, 2007 12:06 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group