By triangleman85 on
I have a page on my site which contains a java chat room and I would like to password-protect it so only users of the site can get into it. The url is basically http://www.mysite.com/chatroom.php - so it's not a node but a php page. Is there a way to do this? I checked out simple access but it only works for nodes from what it looks like, and it's not out for 5.0 either.
Any help is super appreciated.
Comments
easy
Put the content of chatroom.php in a node with php input type, and only allow registered users access to it, for instance by putting this at the top:
global $user;
if ($user->uid)==0) exit;
Or you could display a friendly error message.
Or use taxonomy_access and create a 'Private' tag (or a 'Premium' tag for a more exclusive feel).
When I insert that code, I
When I insert that code, I get the following message:
Parse error: syntax error, unexpected T_IS_EQUAL in /usr/local/psa/home/vhosts/route146.org/httpdocs/wyldrydewebchat.php on line 3Because of the nature of the php, I'm unable to put it into a node.
Syntax error
The syntax error is because there is a missing parentheses.
if ($user->uid)==0) exit;
should be
if (($user->uid)==0) exit;
Take a look
Take a look at TAC_lite and/or Menu_Per_Role.
Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in Your Database
NancyDru
I have menu per role already
I have menu per role already installed, but it doesn't stop someone who knows the url to the chat page from accessing it. It just keeps it out of their menu.
True
That's why I use both TAC_lite and Menu_per_Role.
Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in Your Database
NancyDru
protected_node module
try http://drupal.org/project/protected_node