#!/usr/bin/perl
########## - Ver 3.5 - [InterGB] -------- #####################################################
#
# Created by Paul Williams
# E-Mail: paul@rainbow.nwnet.co.uk
# http://scripts.marschall.net/
# Created: 5 July 1996
# Last Updated: 18 Feb 1998
#
########## - ? Copyright 1998 Cougasoft - #####################################################
#
# About: The redistribution or reselling of this code is strictly
# prohibited, I don't mind if you alter the code but please
# give credit where credit is due ;)
#
# Basically, all I ask is you don't try and make a profit from
# this script. If you are in the webhosting business, please
# visit my website for a serverpack.
#
# Source [IS NOT] to be redistributed in any form of medium.
#
########## ------------------------------ #####################################################
#
$admin = 'igb-admin.cgi';
#
########## ------------------------------ #####################################################
#
# M A I N P R O G R A M
#
########## ------------------------------ #####################################################
#
unless (do "data/igb-pref.pref" || do "igb-pref.pref")
{
print "Content-type: text/plain\n\n" .
"_________________________________________________________\n\n" .
"- 找不到 [igb-pref.pref] 档案 ! -\n" .
"- 你必须上传这个档案, -\n" .
"- 并确定你的档案路径是正确的 -\t\t\t\t-\n\n" .
"_________________________________________________________\n\n";
exit(0);
}
#
########## ------------------------------ #####################################################
#
########## - READ_STDIN [] -------------- #####################################################
#
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $input);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/;/:/;
$value =~ s/<([^>]|\n)*>//g if ($html);
$INPUT{$name} = $value;
}
#
########## ------------------------------ #####################################################
#
########## - ACTION:SIGN_BOOK [] -------- #####################################################
#
if ($ENV{'QUERY_STRING'} eq "action=sign-guestbook")
{
&top_html("Sign in...", 1);
print "
";
&bottom(1);
}
#
########## ---------------------- #############################################################
#
# S U B R O U T I N E S
#
########## - ADDITIONAL STUFF [] #############################################################
#
sub top_html
{
print "Content-type: text/html\n\n" .
"\n" .
"\n" .
"\n" .
" $gb_name - $_[0]\n" .
"\n".
"\n" .
"\n\n";
print "
\n\n";
&bottom(1);
}
}
#
########## ---------------------- #############################################################
#
# S U B N F R A M E
#
########## - NFRAME [] ---------- #############################################################
#
sub nframe
{
print "
\n" .
"
\n
\n" .
" $_[0]
\n
\n";
print "
\n\n";
}
#
########## ---------------------- #############################################################
#
# S U B M I S S I N G
#
########## - MISSING [] --------- #############################################################
#
sub missing
{
&top_html("Missing Field", 1);
&nframe ("Missing Field [$_[0]] Return to the " .
" F O R M and try again.");
&bottom(1);
}
#
########## ---------------------- #############################################################
#
# S U B N O T I F Y
#
########## - NOTIFY [] ---------- #############################################################
#
sub notify
{
$xtra = " 请回到 表单再试一次." if ($_[2] ==1);
$xtra = " 请回到 首页." if ($_[2] == 2);
&top_html("$_[0]", 1);
&nframe ("$_[1] $xtra");
&bottom(1);
}
#
########## ---------------------- #############################################################
#
# S U B B O T T O M
#
########## - BOTTOM [] ---------- #############################################################
#
sub bottom
{
print "\n";
print "\n";
exit(0) if ($_[0]);
}
#
########## ---------------------- #############################################################
#
########## - EXIT(0) ------------ #############################################################
#