#! /usr/bin/perl #This file password protects the chat room, using board accounts. require '/var/www/vhosts/uhnd.com/httpdocs/board/cookie.pl'; $valid_passwords = "members"; $basedir = "/var/www/vhosts/uhnd.com/httpdocs/board"; $errormsg = ''; # Verify that the user's login information is correct. If it is, # set cookie. Otherwise, bring login screen back up. # Verify login info. if ($ENV{QUERY_STRING} eq 'login') { ReadParse(*FORM); if (!defined $FORM{'username'} || !defined $FORM{'password'}) { $errormsg = '
Login failed!
'; &login; } if (!(-e "$basedir/$valid_passwords/$FORM{'username'}")) { $errormsg = 'Login failed!
'; &login; } open(FILE, "$basedir/$valid_passwords/$FORM{'username'}") or &login; $password =Login failed!
'; &login; } } #START HERE. When the chat page loads, check if a cookie exists. If not, bring up login screen. if (&get_cookie('validation') ne '') { @validation = split(/&/, &get_cookie('validation')); if (!(-e "$basedir/$valid_passwords/$validation[0]")) { &login; } else { &load_chat; } } else { &login; } #Subroutine to load chat room sub load_chat { print "Content-type: text/html\n\n"; print <<'ENCODING';The chat room is always open, and now available to board members only.
We no longer organize chats, but you may post on the football board to gather other members. Or try checking in on gamedays. Use the "float" button to maximize the room. More instructions below.
To enter the chat room, enter a username and click "Ok,
connect". The other fields are optional.
Once inside the chat, you can ignore a user by highlighting their username (on the left), and then clicking the "ignore" box. Highlighting a username and then clicking
"Private Chat" will allow you to chat separately with anyone else in the room (similar to an instant message).
For more available user commands see the parachat FAQ page.
Email questions to: Contacts
ENCODING exit; } #subroutine to load login screen sub login { print "Content-type: text/html\n\n"; print $errormsg; print <<'ENCODING';The UHND.com Chat Room
Please login using your member information at this time: