#! /usr/bin/perl # chatadd.cgi # ----------------------------------- # Copyright (C) 2000, Michael Stewart # All Rights Reserved # based on S8 Chat http://www.s8.org # load the chat.setup file require "chat.setup"; # If the offline.txt file exists, then the chat is in # maintenance mode, and is closed. Output the message # in the offline.txt and end. if (-e "$path/offline.txt") { open (OFFLINE, "$path/offline.txt"); @offline = ; close OFFLINE; print "Content-Type: text/html\n\n"; print "Fatal Chatroom Error 0 - Maintenance\n"; print "

The chatroom is closed right now for maintenance.
\n"; print "The chatroom administrator left the following message:

\n"; print "
\n";
  foreach $offlineLine (@offline) {
    print "$offlineLine";
  }
  print "
"; print "
\n"; print "Chatroom version $ver Error Code 0 - Maintenance"; exit; } # Check for the cgi-lib, make sure it's readable and require it if (-e "$path/cgi-lib.cgi") { if (-r "$path/cgi-lib.cgi") { require "$path/cgi-lib.cgi"; } else { print "Content-Type: text/html\n\n"; print "Fatal Chatroom Error 2 - cgi-lib Unreadable\n"; print "

The chatroom cannot load the required module cgi-lib.cgi.
\n"; print "This module is required for the chatroom to work correctly.
\n"; print "Please contact the chatroom administrator.

\n"; print "
\n"; print "Chatroom version $ver Error Code 2 - cgi-lib Unreadable"; exit; } } else { print "Content-Type: text/html\n\n"; print "Fatal Chatroom Error 1 - Missing cgi-lib\n"; print "

The chatroom cannot find the required module cgi-lib.cgi.
\n"; print "This module is required for the chatroom to work correctly.
\n"; print "Please contact the chatroom administrator.

\n"; print "
\n"; print "Chatroom version $ver Error Code 1 - Missing cgi-lib"; exit; } # Load the User Input into %in &ReadParse(); unless ($in{'room'}) { print "Content-Type: text/html\n\n"; print "Fatal Chatroom Error 3 - Invalid User Input\n"; print "

A required variable was not passed to the script.
\n"; print "This varible is required for the action you requested.
\n"; print "This error is most likely caused because you are trying to directly
\n"; print "access certain actions. Please goto $url and
\n"; print "run the script from the beginning. Thank You

\n"; print "
\n"; print "Chatroom version $ver Error Code 3 - Invalid User Input"; exit; } $chatroom = $in{'room'}; if ($in{'admin'}) { $admin = $in{'admin'}; } else { $admin = ""; } # check for the config file and whether it is readable if (-e "$path/chat.config" && -r "$path/chat.config") { # load the file open (CONFIG, "$path/chat.config"); @chatConfig = ; close CONFIG; # output the Content-Type print "Content-Type: text/html\n\n"; # output the ChatAdd print << function go() { parent.ChatWindow.location.href="$url/reload.cgi?room="+chat.room.options(chat.room.selectedIndex).value+"&pass="+chat.pass.value+"&admin=$admin" if (chat.autoRL.checked) { autoReload() } } function autoReload() { reloadTimer=setTimeout('go()', 10000) } $bodytag
Name: E-Mail: URL: pw:   Color:
Room:

Automatic Reload
CHATADD print ""; print "
"; print "
Chat Version: $ver - $copyinfo"; exit; } else { # output the Content-Type print "Content-Type: text/html\n\n"; # output the ChatAdd print << function go() { parent.ChatWindow.location.href="$url/reload.cgi?room=none&pass"+chat.pass.value if (chat.autoRL.checked) { autoReload() } } function autoReload() { reloadTimer=setTimeout('go()', 10000) } $bodytag
Name: E-Mail: URL:   Color:

Automatic Reload
CHATADD print "
Chat Version: $ver - $copyinfo"; exit; } print "Content-Type: text/html\n\n"; print "Error!"; print "
Chat Version: $ver - $copyinfo";