Beehive PHP Cross Reference Discussion Forums

Source: /lboot.php - 151 lines - 4204 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /*======================================================================
   4  Copyright Project Beehive Forum 2002
   5  
   6  This file is part of Beehive Forum.
   7  
   8  Beehive Forum is free software; you can redistribute it and/or modify
   9  it under the terms of the GNU General Public License as published by
  10  the Free Software Foundation; either version 3 of the License, or
  11  (at your option) any later version.
  12  
  13  Beehive Forum is distributed in the hope that it will be useful,
  14  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  GNU General Public License for more details.
  17  
  18  You should have received a copy of the GNU General Public License
  19  along with Beehive; if not, write to the Free Software
  20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  21  USA
  22  ======================================================================*/
  23  
  24  // We shouldn't be accessing this file directly.
  25  if (basename($_SERVER['SCRIPT_NAME']) == basename(__FILE__)) {
  26      header("Request-URI: ../index.php");
  27      header("Content-Location: ../index.php");
  28      header("Location: ../index.php");
  29      exit;
  30  }
  31  
  32  // Light Mode Detection
  33  define("BEEHIVEMODE_LIGHT", true);
  34  
  35  // Constant to define where the include files are
  36  if (!defined('BH_INCLUDE_PATH')) {
  37      define('BH_INCLUDE_PATH', __DIR__ . '/include/');
  38  }
  39  
  40  // Set the default timezone
  41  date_default_timezone_set('UTC');
  42  
  43  // Set default character set
  44  header('Content-type: text/html; charset=UTF-8');
  45  
  46  // Constants
  47  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
  48  
  49  // Enable the error handler
  50  require_once  BH_INCLUDE_PATH . 'errorhandler.inc.php';
  51  
  52  // Set the error reporting level to report all errors
  53  error_reporting(E_ALL | E_STRICT);
  54  
  55  // Enable the error handler
  56  set_error_handler('bh_error_handler');
  57  
  58  // Attempt to handle fatal errors
  59  register_shutdown_function('bh_fatal_error_handler');
  60  
  61  // Enable the exception handler
  62  set_exception_handler('bh_exception_handler');
  63  
  64  // Don't output errors to the browser
  65  @ini_set('display_errors', '0');
  66  
  67  // Fix problems with PHP and APC session storage
  68  register_shutdown_function('session_write_close');
  69  
  70  // Forum functionality
  71  require_once  BH_INCLUDE_PATH . 'forum.inc.php';
  72  
  73  // Forum maintenance functionality
  74  register_shutdown_function('forum_check_maintenance');
  75  
  76  // Server checking functions
  77  require_once  BH_INCLUDE_PATH . 'server.inc.php';
  78  
  79  // Caching functions
  80  require_once  BH_INCLUDE_PATH . 'cache.inc.php';
  81  
  82  // Installation checking functions
  83  require_once  BH_INCLUDE_PATH . 'install.inc.php';
  84  
  85  // Wordfilter
  86  require_once  BH_INCLUDE_PATH . 'word_filter.inc.php';
  87  
  88  // Disable PHP's register_globals
  89  unregister_globals();
  90  
  91  // Disable PHP's magic quotes
  92  disable_magic_quotes();
  93  
  94  // Correctly set server protocol
  95  set_server_protocol();
  96  
  97  // Disable caching if on AOL
  98  cache_disable_aol();
  99  
 100  // Disable caching if proxy server detected.
 101  cache_disable_proxy();
 102  
 103  // Check that Beehive is installed correctly
 104  install_check();
 105  
 106  // Required includes
 107  require_once  BH_INCLUDE_PATH . 'banned.inc.php';
 108  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
 109  require_once  BH_INCLUDE_PATH . 'header.inc.php';
 110  require_once  BH_INCLUDE_PATH . 'html.inc.php';
 111  require_once  BH_INCLUDE_PATH . 'lang.inc.php';
 112  require_once  BH_INCLUDE_PATH . 'light.inc.php';
 113  require_once  BH_INCLUDE_PATH . 'session.inc.php';
 114  // End Required includes
 115  
 116  // Initialise the session
 117  session::init();
 118  
 119  // Initialise gettext
 120  lang_init();
 121  
 122  // Enable the word filter ob filter
 123  ob_start('word_filter_ob_callback');
 124  
 125  // Perform ban check
 126  ban_check($_SESSION);
 127  
 128  // Check to see if user account has been banned.
 129  if (session::user_banned()) {
 130      light_html_user_banned();
 131      exit;
 132  }
 133  
 134  // Check to see if the user has been approved.
 135  if (!session::user_approved()) {
 136      light_html_user_require_approval();
 137      exit;
 138  }
 139  
 140  // Get the webtag for the current forum
 141  $webtag = get_webtag();
 142  
 143  // Check we have a webtag and have access to the specified forum
 144  if (!forum_check_webtag_available($webtag) || !forum_check_access_level()) {
 145      header_redirect("lforums.php?webtag_error=$webtag");
 146  }
 147  
 148  // Check guest access is available.
 149  if (!forum_check_guest_access_allowed()) {
 150      header_redirect("llogon.php?webtag=$webtag");
 151  }

title

Description

title

Description

title

Description

title

title

Body