#!/usr/bin/perl -- use strict; # this should be fun ############################################################################### # YaBB.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 2.4 # # Packaged: April 12, 2009 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2009 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # # Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com # # Your source for web hosting, web design, and domains. # ############################################################################### # # $Id$ ### Version Info ### (our $VERSION = '$Revision$') =~ s~^\$ R e v i s i o n: \s (.*) \s \$$~$1~x; use CGI::Carp qw(fatalsToBrowser); # used only for tests BEGIN { # Make sure the module path is present push(@INC, "./Modules"); if (defined $ENV{'SERVER_SOFTWARE'} and $ENV{'SERVER_SOFTWARE'} =~ /IIS/) { $GLOBAL::IIS = 1; $0 =~ m~(.*)(\\|/)~; my $path = $1; $path =~ s~\\~/~g; chdir($path); push(@INC, $path); } # Modify the following line if your forum main scriptname must be different. # The default is: "YaBB". Do this also in AdminIndex.pl!!! # Don't forget to modify also all index.html files in the folders!!! $GLOBAL::EXEC = "YaBB"; my $script_root = $ENV{'SCRIPT_FILENAME'}; $script_root = defined $script_root ? $script_root : "" ; $script_root =~ s/\/$GLOBAL::EXEC\.(pl|cgi)//ig; use YaBB3::Paths qw(:all); #exporting variables naughty require "$vardir/Settings.pl"; #TODO: lots of work on Settings.pl # If we're debugging, try to use HiRes time. if ($GLOBAL::DEBUG) { eval { require Time::HiRes; import Time::HiRes qw(time); }; } our $START_TIME = time(); require "$sourcedir/Subs.pl"; require "$sourcedir/System.pl"; use YaBB3::DateTime qw(:all); require "$sourcedir/Load.pl"; require "$sourcedir/Guardian.pl"; require "$boardsdir/forum.master"; sub warn { open my $log, ">>", "ERROR.LOG" or die "Could not open logfile. $@"; print $log, @_; close $log; } } # END of BEGIN block # load the data driver require "$YaBB3::Paths::vardir/dsn.txt"; use YaBB3::DataSource; $GLOBAL::DS = YaBB3::DataSource->new(%GLOBAL::DSN); # If enabled: check if hard drive has enough space to safely operate the board my $hostchecked = &freespace; # Auto Maintenance Hook $GLOBAL::SETTING::maintenance = 2 if !$GLOBAL::SETTING::maintenance and -e "$vardir/maintenance.lock"; # load the user's session use CGI::Session; $GLOBAL::SESSION = CGI::Session->new("driver:y3datasource", undef, {DS => $GLOBAL::DS}); no strict; # I can only do so much in a day... &LoadCookie; # Load the user's cookie (or set to guest) &LoadUserSettings; # Load user settings &WhatTemplate; # Figure out which template to be using. &WhatLanguage; # Figure out which language file we should be using! :D # Do this now that language is available $yyfreespace = $hostchecked < 0 ? $error_txt{'module_missing'} : (($yyfreespace && (($debug == 1 && !$iamguest) || ($debug == 2 && $iamgmod) || $iamadmin)) ? qq~