#!/usr/bin/perl ############################################################################### # UltraBoard 2000 by UltraScripts.com, Inc. # # Copyright (c) 1999-2000 UltraScripts.com, Inc. All Rights Reserved. # # Available from http://www.ub2k.com/ or http://www.ultrascripts.com/ # ############################################################################### # USES # # This program is being distributed as freeware for personal, educational, # # government, or non-profit only. Any commercial use is forbidden. The # # sources code must not be resold, or distributed. # # # # MODIFICATIONS AND CHANGES # # This program may be modified within the following guidelines: # # # # 1. Cannot modify or replace UltraBoard.cgi except to change the path to # # perl on first line. # # 2. No modification that affect the Control Panel in any way are allowed. # # 3. The modified source code must not be resold, or distributed. # # # # COPYRIGHT NOTICES # # Copyright 1999-2000 UltraScripts.com, Inc. All Rights Reserved. # # # # Copyright notices included within the CGI scripts and within source files # # of this software program must not be modified or removed. These copyrights # # notices, including "powered by" wording, and the about document on help # # page, must be visible to the end user. # # # # Selling, or distributing the source code for this program in any medias # # without prior written consent is expressly forbidden. In all cases # # copyright notices must remain intact. # # # # WARRANTIES # # THIS SFTWARE PROGRAM AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND # # WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY OTHER # # WARRANTIES WHETHER EXPRESSED OR IMPLIED. THE SELLER ALSO MAKES NO WARRANTY # # OF FITNESS FOR A PARTICULAR PURPOSE. # ############################################################################### package UB; BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File SDBM_File) } BEGIN { $UB::PATH = "."; # < < < < < < < < < < < < < < < < < < < < < < < < < < < < # my $Program = $0; $Program =~s/\\/\//g; $Program =~s/^.*\/([^\/]+)$/$1/g; unless (-e $UB::PATH."/".$Program) { foreach my $path ( $0, $ENV{'SCRIPT_FILENAME'}, $ENV{'PATH_TRANSLATED'} ) { $path =~s/\\/\//g; $path =~s/^(.*)\/[^\/]+$/$1/g; if (-e $path."/".$Program) { $UB::PATH = $path and last; } } } unshift (@INC, "$UB::PATH"); unshift (@INC, "$UB::PATH/Private"); unshift (@INC, "$UB::PATH/Private/Variables"); unshift (@INC, "$UB::PATH/Private/Sources"); unshift (@INC, "$UB::PATH/Private/Sources/Libraries"); } use System qw($SYSTEM); use General qw($GENERAL); use Standard; use CGI qw (:cgi); use strict; $TempFile::TMPDIRECTORY = $SYSTEM->{'TEMP_PATH'}; $| = 1; $UB::VERSION = "2.11"; $UB::CGI = new CGI; eval { &UB::Main } || &UB::CGIError("Can't run your request. $@", ""); sub Main { $UB::CONTENT_TYPE = 0; %UB::GLOBAL = (); %UB::MEMBER = (); %UB::QUERY = (); %UB::COOKIES = (); foreach my $Keyword ($UB::CGI->param()) { $UB::QUERY{ $Keyword } = $UB::CGI->param( $Keyword ); $UB::QUERY{ $Keyword } =~ s/^\s+//g; $UB::QUERY{ $Keyword } =~ s/\s+$//g; } $UB::GLOBAL{'SKIN'} = $SYSTEM->{'SKIN'}; require "Database.$SYSTEM->{'DB_TYPE'}.pm"; my $DB = Database->new(); if ((-e "$UB::PATH/install.cgi") || (-e "$UB::PATH/install.pl")) { unlink("$UB::PATH/install.cgi"); unlink("$UB::PATH/install.pl"); unlink("$UB::PATH/Private.tar"); unlink("$UB::PATH/Public.tar"); unlink("$UB::PATH/Archive/Tar.pm"); rmdir ("$UB::PATH/Archive"); } if ((-e "$UB::PATH/install.cgi") || (-e "$UB::PATH/install.pl")) { &UB::CGIError("You should remove install.cgi/pl, Private.tar, Public.tar... before for security reason.", ""); } if (exists ($UB::QUERY{'CP'})) { $UB::PLATFORM = "CP"; require Authenticate; my $Authenticate = Authenticate->new(); $UB::GLOBAL{'TOTAL_MEMBERS'} = $DB->Count(TABLE => "Accounts"); if ($UB::GLOBAL{'TOTAL_MEMBERS'}) { if (-e $SYSTEM->{'TEMP_PATH'}."/Logging-$ENV{'REMOTE_ADDR'}.tmp.txt") { &Standard::FileOpen(*LOGGING, "rw", $SYSTEM->{'TEMP_PATH'}."/Logging-$ENV{'REMOTE_ADDR'}.tmp.txt"); my @FAIL = ; close (LOGGING); if ((scalar (@FAIL) > 9) and ($FAIL[$#FAIL] - $FAIL[$#FAIL - 9]) < (15 * 60)) { &UB::Error("CP", ID => "LOGGING_TOO_MANY"); } } unless ( $Authenticate->Authenticate(DB => $DB) ) { if ($Authenticate->{'ERROR'}) { open (ERROR_LOG, ">>$SYSTEM->{'LOGS_PATH'}/error.log.txt"); print ERROR_LOG "CP|^|400|^|$Authenticate->{'ERROR'}|^||^|$ENV{'REMOTE_ADDR'}|^|".time."\n"; close (ERROR_LOG); } &Standard::FileOpen(*LOGGING, "a", $SYSTEM->{'TEMP_PATH'}."/Logging-$ENV{'REMOTE_ADDR'}.tmp.txt"); print LOGGING time."\n"; close (LOGGING); require ControlPanel::Login; my $Source = ControlPanel::Login->new(); $Source->show(error => $Authenticate->{'ERROR'}, form => { hiddens => [ {name => "CP"}, {name => "action", value => $UB::QUERY{'action'}} ] }); } else { if (-e $SYSTEM->{'TEMP_PATH'}."/Logging-$ENV{'REMOTE_ADDR'}.tmp.txt") { unlink ($SYSTEM->{'TEMP_PATH'}."/Logging-$ENV{'REMOTE_ADDR'}.tmp.txt"); } } } else { $UB::MEMBER{'LEVEL'} = 100; } if ( ($UB::MEMBER{'LEVEL'} ne "70") && ($UB::MEMBER{'LEVEL'} ne "100") ) { LOGIN: require ControlPanel::Login; my $Source = ControlPanel::Login->new(); $Source->show( form => { hiddens => [ {name => "CP"}, {name => "action", value => $UB::QUERY{'action'}} ] } ); } if ((!$UB::QUERY{'action'}) || ($UB::QUERY{'action'} eq "Index")) { require ControlPanel::Index; if ($UB::QUERY{'panel'} eq "title") { my $Source = ControlPanel::Index->new(); $Source->show("title"); } elsif ($UB::QUERY{'panel'} eq "menu") { my $Source = ControlPanel::Index->new(); $Source->show("menu"); } elsif ($UB::QUERY{'panel'} eq "index") { if ($UB::GLOBAL{'TOTAL_MEMBERS'}) { my $Source = ControlPanel::Index->new(); $Source->show("index", DB => $DB); } else { if ($DB->Count(TABLE => "Groups")) { require ControlPanel::CreateAccount; my $Source = ControlPanel::CreateAccount->new(); $Source->show(DB => $DB); } else { require ControlPanel::CreateGroup; my $Source = ControlPanel::CreateGroup->new(); $Source->show(); } } } else { my $Source = ControlPanel::Index->new(); $Source->show("main"); } } elsif ($UB::QUERY{'action'} eq "SystemInformation") { require ControlPanel::SystemInformation; my $Source = ControlPanel::SystemInformation->new(); $Source->show(); } elsif ($UB::QUERY{'action'} eq "Logout") { require ControlPanel::Logout; my $Source = ControlPanel::Logout->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Switch") { require ControlPanel::Switch; my $Source = ControlPanel::Switch->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CfgSystem") { if ($UB::MEMBER{'LEVEL'} ne "100") { require ControlPanel::Login; my $Source = ControlPanel::Login->new(); $Source->show( form => { hiddens => [ {name => "CP"}, {name => "action", value => $UB::QUERY{'action'}} ] } ); } require ControlPanel::CfgSystem; my $Source = ControlPanel::CfgSystem->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCfgSystem") { if ($UB::MEMBER{'LEVEL'} ne "100") { require ControlPanel::Login; my $Source = ControlPanel::Login->new(); $Source->show( form => { hiddens => [ {name => "CP"}, {name => "action", value => $UB::QUERY{'action'}} ] } ); } require ControlPanel::CfgSystem; my $Source = ControlPanel::CfgSystem->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CfgGeneral") { require ControlPanel::CfgGeneral; my $Source = ControlPanel::CfgGeneral->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCfgGeneral") { require ControlPanel::CfgGeneral; my $Source = ControlPanel::CfgGeneral->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CfgStyle") { require ControlPanel::CfgStyle; my $Source = ControlPanel::CfgStyle->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCfgStyle") { require ControlPanel::CfgStyle; my $Source = ControlPanel::CfgStyle->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyProfile") { require ControlPanel::ModifyProfile; my $Source = ControlPanel::ModifyProfile->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyProfile") { require ControlPanel::ModifyProfile; my $Source = ControlPanel::ModifyProfile->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CreateGroup") { require ControlPanel::CreateGroup; my $Source = ControlPanel::CreateGroup->new(); $Source->show(); } elsif ($UB::QUERY{'action'} eq "DoCreateGroup") { require ControlPanel::CreateGroup; my $Source = ControlPanel::CreateGroup->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ListGroups") { require ControlPanel::ListGroups; my $Source = ControlPanel::ListGroups->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyGroup") { require ControlPanel::ModifyGroup; my $Source = ControlPanel::ModifyGroup->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyGroup") { require ControlPanel::ModifyGroup; my $Source = ControlPanel::ModifyGroup->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoRemoveGroups") { require ControlPanel::RemoveGroups; my $Source = ControlPanel::RemoveGroups->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CreateAccount") { require ControlPanel::CreateAccount; my $Source = ControlPanel::CreateAccount->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCreateAccount") { require ControlPanel::CreateAccount; my $Source = ControlPanel::CreateAccount->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ListAccounts") { require ControlPanel::ListAccounts; my $Source = ControlPanel::ListAccounts->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoListAccounts") { require ControlPanel::ListAccounts; my $Source = ControlPanel::ListAccounts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModerateAccounts") { require ControlPanel::ModerateAccounts; my $Source = ControlPanel::ModerateAccounts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyAccount") { require ControlPanel::ModifyAccount; my $Source = ControlPanel::ModifyAccount->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyAccount") { require ControlPanel::ModifyAccount; my $Source = ControlPanel::ModifyAccount->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoChangeAccountsStatus") { require ControlPanel::ChangeAccountsStatus; my $Source = ControlPanel::ChangeAccountsStatus->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "MoveAccounts") { require ControlPanel::MoveAccounts; my $Source = ControlPanel::MoveAccounts->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoMoveAccounts") { require ControlPanel::MoveAccounts; my $Source = ControlPanel::MoveAccounts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoRemoveAccounts") { require ControlPanel::RemoveAccounts; my $Source = ControlPanel::RemoveAccounts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "EmailAccounts") { require ControlPanel::EmailAccounts; my $Source = ControlPanel::EmailAccounts->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoEmailAccounts") { require ControlPanel::EmailAccounts; my $Source = ControlPanel::EmailAccounts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CreateCategory") { require ControlPanel::CreateCategory; my $Source = ControlPanel::CreateCategory->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCreateCategory") { require ControlPanel::CreateCategory; my $Source = ControlPanel::CreateCategory->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ListCategories") { require ControlPanel::ListCategories; my $Source = ControlPanel::ListCategories->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyCategory") { require ControlPanel::ModifyCategory; my $Source = ControlPanel::ModifyCategory->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyCategory") { require ControlPanel::ModifyCategory; my $Source = ControlPanel::ModifyCategory->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoRemoveCategories") { require ControlPanel::RemoveCategories; my $Source = ControlPanel::RemoveCategories->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CreateBoard") { require ControlPanel::CreateBoard; my $Source = ControlPanel::CreateBoard->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCreateBoard") { require ControlPanel::CreateBoard; my $Source = ControlPanel::CreateBoard->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ListBoards") { require ControlPanel::ListBoards; my $Source = ControlPanel::ListBoards->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyBoard") { require ControlPanel::ModifyBoard; my $Source = ControlPanel::ModifyBoard->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyBoard") { require ControlPanel::ModifyBoard; my $Source = ControlPanel::ModifyBoard->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoReorderBoards") { require ControlPanel::ReorderBoards; my $Source = ControlPanel::ReorderBoards->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoRemoveBoards") { require ControlPanel::RemoveBoards; my $Source = ControlPanel::RemoveBoards->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "CreatePost") { require ControlPanel::CreatePost; my $Source = ControlPanel::CreatePost->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoCreatePost") { require ControlPanel::CreatePost; my $Source = ControlPanel::CreatePost->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ListPosts") { require ControlPanel::ListPosts; my $Source = ControlPanel::ListPosts->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoListPosts") { require ControlPanel::ListPosts; my $Source = ControlPanel::ListPosts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModeratePosts") { require ControlPanel::ModeratePosts; my $Source = ControlPanel::ModeratePosts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "MovePosts") { require ControlPanel::MovePosts; my $Source = ControlPanel::MovePosts->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoMovePosts") { require ControlPanel::MovePosts; my $Source = ControlPanel::MovePosts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyPost") { require ControlPanel::ModifyPost; my $Source = ControlPanel::ModifyPost->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyPost") { require ControlPanel::ModifyPost; my $Source = ControlPanel::ModifyPost->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoChangePostsStatus") { require ControlPanel::ChangePostsStatus; my $Source = ControlPanel::ChangePostsStatus->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoRemovePosts") { require ControlPanel::RemovePosts; my $Source = ControlPanel::RemovePosts->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Backup") { goto LOGIN if ($UB::MEMBER{'LEVEL'} ne "100"); require ControlPanel::Backup; my $Source = ControlPanel::Backup->new(); $Source->show(); } elsif ($UB::QUERY{'action'} eq "DoBackup") { goto LOGIN if ($UB::MEMBER{'LEVEL'} ne "100"); require ControlPanel::Backup; my $Source = ControlPanel::Backup->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Restore") { goto LOGIN if ($UB::MEMBER{'LEVEL'} ne "100"); require ControlPanel::Restore; my $Source = ControlPanel::Restore->new(); $Source->show(); } elsif ($UB::QUERY{'action'} eq "DoRestore") { goto LOGIN if ($UB::MEMBER{'LEVEL'} ne "100"); require ControlPanel::Restore; my $Source = ControlPanel::Restore->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "UpdateThreads") { require ControlPanel::UpdateThreads; my $Source = ControlPanel::UpdateThreads->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoUpdateThreads") { require ControlPanel::UpdateThreads; my $Source = ControlPanel::UpdateThreads->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "UpdateDatabase") { require ControlPanel::UpdateDatabase; my $Source = ControlPanel::UpdateDatabase->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoUpdateDatabase") { require ControlPanel::UpdateDatabase; my $Source = ControlPanel::UpdateDatabase->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ErrorsReport") { require ControlPanel::Report; my $Source = ControlPanel::Report->new(); $Source->show(errors => 1); } else { require Package; } } elsif (exists ($UB::QUERY{'SSI'})) { require Standard; $UB::GLOBAL{'SKIN'} = $UB::QUERY{'SkinID'} || $SYSTEM->{'SKIN'}; if ($UB::QUERY{'action'} eq "GetLastVisited") { require SSI::LastVisited; my $Source = SSI::LastVisited->new(); &Standard::PrintHTMLHeader(); print $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "GetMenu") { require Authenticate; my $Authenticate = Authenticate->new(); $Authenticate->Authenticate(DB => $DB); require SSI::Menu; my $Source = SSI::Menu->new(); &Standard::PrintHTMLHeader(); print $Source->show(); } elsif ($UB::QUERY{'action'} eq "GetBoardsOption") { require Authenticate; my $Authenticate = Authenticate->new(); $Authenticate->Authenticate(DB => $DB); require SSI::BoardsOption; my $Source = SSI::BoardsOption->new(); &Standard::PrintHTMLHeader(); print $Source->show(DB => $DB); } else { require Package; } } else { $UB::PLATFORM = "UB"; unless ($DB) { &UB::Error("UB", MESSAGE => $DB->{'ERROR'}); } if (-e "$SYSTEM->{'LOGS_PATH'}/clean.log.txt") { my $mtime = (stat("$SYSTEM->{'LOGS_PATH'}/clean.log.txt"))[9]; if ($mtime < (time - (60 * 60 * 6))) { require Clean; my $Clean = Clean->new(); $Clean->Sessions(DB => $DB); $Clean->Temp(); } } else { open (CLEAN, ">$SYSTEM->{'LOGS_PATH'}/clean.log.txt"); close(CLEAN); chmod (0777, "$SYSTEM->{'LOGS_PATH'}/clean.log.txt"); } require Authenticate; my $Authenticate = Authenticate->new(); &UB::Error ("UB", ID => "BANNED") unless ( &Standard::HostIPFilter() ); unless ( $Authenticate->Authenticate(DB => $DB) ) { if ($Authenticate->{'ERROR'}) { require UltraBoard::Login; my $Source = UltraBoard::Login->new(); $Source->show(error => $Authenticate->{'ERROR'}); } } unless ($SYSTEM->{'ONLINE'}) { &UB::Error("UB", MESSAGE => $SYSTEM->{'OFFLINE_MESSAGE'}); } unless (&Standard::HostIPFilter()) { &UB::Error ("UB", ID => "BANNED"); } if (!$UB::QUERY{'action'}) { goto INDEX; } elsif ($UB::QUERY{'action'} eq "Index") { INDEX: unless ($GENERAL->{'INDEX'}) { &Standard::PrintHTMLHeader(redirect => $GENERAL->{'INDEX_URL'}); } if ($GENERAL->{'LOGIN'}) { unless ($UB::MEMBER{'LOGIN'}) { print "Location: $SYSTEM->{'UB_URL'}/UltraBoard.$SYSTEM->{'EXTENSTION'}?action=Login\n\n" and exit; } } require UltraBoard::Index; my $Source = UltraBoard::Index->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Register") { require UltraBoard::Register; my $Source = UltraBoard::Register->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoRegister") { require UltraBoard::Register; my $Source = UltraBoard::Register->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ModifyProfile") { require UltraBoard::ModifyProfile; my $Source = UltraBoard::ModifyProfile->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyProfile") { require UltraBoard::ModifyProfile; my $Source = UltraBoard::ModifyProfile->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Profile") { require UltraBoard::Profile; my $Source = UltraBoard::Profile->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Login") { require UltraBoard::Login; my $Source = UltraBoard::Login->new(); $Source->show(); } elsif ($UB::QUERY{'action'} eq "Logout") { require UltraBoard::Logout; my $Source = UltraBoard::Logout->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Category") { require UltraBoard::Category; my $Source = UltraBoard::Category->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Headlines") { require UltraBoard::Headlines; my $Source = UltraBoard::Headlines->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Post") { require UltraBoard::Post; my $Source = UltraBoard::Post->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoPost") { require UltraBoard::Post; my $Source = UltraBoard::Post->new(); if ($UB::QUERY{'FORM_PREVIEW'}) { $Source->show(preview => 1, DB => $DB); } else { $Source->do(DB => $DB); } } elsif ($UB::QUERY{'action'} eq "Reply") { require UltraBoard::Reply; my $Source = UltraBoard::Reply->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoReply") { require UltraBoard::Reply; my $Source = UltraBoard::Reply->new(); if ($UB::QUERY{'FORM_PREVIEW'}) { $Source->show(preview => 1, DB => $DB); } else { $Source->do(DB => $DB); } } elsif ($UB::QUERY{'action'} eq "ModifyPost") { require UltraBoard::ModifyPost; my $Source = UltraBoard::ModifyPost->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoModifyPost") { require UltraBoard::ModifyPost; my $Source = UltraBoard::ModifyPost->new(); if ($UB::QUERY{'FORM_PREVIEW'}) { $Source->show(preview => 1, DB => $DB); } else { $Source->do(DB => $DB); } } elsif ($UB::QUERY{'action'} eq "Read") { require UltraBoard::Read; my $Source = UltraBoard::Read->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Print") { goto INDEX unless $GENERAL->{'PRINT'}; require UltraBoard::Read; my $Source = UltraBoard::Read->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "ICQ") { require UltraBoard::ICQ; my $Source = UltraBoard::ICQ->new(); $Source->show(); } elsif ($UB::QUERY{'action'} eq "Search") { require UltraBoard::Search; my $Source = UltraBoard::Search->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "DoSearch") { require UltraBoard::Search; my $Source = UltraBoard::Search->new(); $Source->do(DB => $DB); } elsif ($UB::QUERY{'action'} eq "QuickSearch") { require UltraBoard::Search; my $Source = UltraBoard::Search->new(); $Source->quick(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Result") { require UltraBoard::Result; my $Source = UltraBoard::Result->new(); $Source->show(DB => $DB); } elsif ($UB::QUERY{'action'} eq "Help") { require UltraBoard::Help; my $Source = UltraBoard::Help->new(); $Source->show(); } else { goto INDEX; } } } sub Error { my $platform = shift; my %in= (ID => "", MESSAGE => "", @_); my $message = $in{'MESSAGE'} || $in{'ID'}; $message =~ s/\n/
/g; open (ERROR_LOG, ">>$SYSTEM->{'LOGS_PATH'}/error.log.txt"); print ERROR_LOG "$platform|^|400|^|$message|^||^|$ENV{'REMOTE_ADDR'}|^|".time."\n"; close (ERROR_LOG); &Standard::PrintHTMLHeader(); if ($platform eq "CP") { require "Skins/$UB::GLOBAL{'SKIN'}/ControlPanel.pm"; my $Interface = Skin::ControlPanel->new(); if ($in{'ID'}) { print $Interface->Error(error => $Interface->{'LANGUAGE'}{ $in{'ID'} }); } else { print $Interface->Error(error => $in{'MESSAGE'}); } } else { require "Skins/$UB::GLOBAL{'SKIN'}/UltraBoard.pm"; my $Interface = Skin::UltraBoard->new(); if ($in{'ID'}) { print $Interface->Error(error => $Interface->{'LANGUAGE'}{ $in{'ID'} }); } else { print $Interface->Error(error => $in{'MESSAGE'}); } } exit; } sub CGIError { my ($message, $path) = @_; my ($key, $space); unless ($UB::CONTENT_TYPE) { print "Content-type: text/html\n\n"; $UB::CONTENT_TYPE = 1; } $message =~ s/\n/
/g; open (ERROR_LOG, ">>$SYSTEM->{'LOGS_PATH'}/error.log.txt"); print ERROR_LOG "|^|500|^|$message|^|$path|^|$ENV{'REMOTE_ADDR'}|^|".time."\n"; close (ERROR_LOG); print "\n"; print "\n"; print "CGI Script Error\n"; print "\n"; print "\n"; print "\n"; print "CGI Script Error

\n"; print "\n"; $message and print $message; print "

"; print "General Infomation

\n"; print "\n"; if ($path) { $path =~ s/\\/\//g; print "\n"; print "\n"; print "\n"; print "\n"; } if ($0) { $0 =~ s/\\/\//g; print "\n"; print "\n"; print "\n"; print "\n"; } if ($]) { print "\n"; print "\n"; print "\n"; print "\n"; } if ($UB::VERSION) { print "\n"; print "\n"; print "\n"; print "\n"; } if ($CGI::VERSION) { print "\n"; print "\n"; print "\n"; print "\n"; } print "
Error Path$path
Script Path$0
Perl Version$]
UltraBoard Version$UB::VERSION
CGI.pm Version$CGI::VERSION

\n"; if (defined %UB::QUERY) { print "Form Variables

\n"; print "\n"; foreach my $KEY (sort keys %UB::QUERY) { print "\n"; print "\n"; print "\n"; print "\n"; } print "
$KEY".$UB::QUERY{$KEY}."

\n"; } print "Environment Variables

\n"; print "\n"; foreach $key (sort keys %ENV) { print "\n"; print "\n"; print "\n"; print "\n"; } print "
$key".$ENV{$key}."

\n"; print "\n"; print "\n"; print "\n"; print "\n"; exit; }