Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Application flag
- define('SPF', true);
- // Determine our absolute document root
- define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
- // Global include files
- require DOC_ROOT . '/includes/functions.inc.php'; // __autoload() is contained in this file
- require DOC_ROOT . '/includes/class.dbobject.php';
- require DOC_ROOT . '/includes/class.objects.php';
- // Fix magic quotes
- if (get_magic_quotes_gpc())
- {
- $_POST = fix_slashes($_POST);
- $_GET = fix_slashes($_GET);
- $_REQUEST = fix_slashes($_REQUEST);
- $_COOKIE = fix_slashes($_COOKIE);
- }
- // Load our config settings
- $Config = Config::getConfig();
- /* * ***************************** check licence details ****************************** */
- if (!file_exists(DOC_ROOT . "/_licence_key.inc.php"))
- die("<b>ERROR:</b> Could not locate licence file (_licence_key.inc.php), please add and try again or contact mfscripts.com.");
- include_once(DOC_ROOT . "/_licence_key.inc.php");
- if (!defined("_SCRIPT_LICENCE_KEY"))
- define("_SCRIPT_LICENCE_KEY", "");
- // clear the vars to be used just encase they are passed in
- $licence_key = "N2h+" . substr(_SCRIPT_LICENCE_KEY, 5, 200);
- $actual_licence = base64_decode($licence_key);
- if (substr($actual_licence, 0, 18) != "7h~@}-=sdte!@*AP;s")
- die("<b>ERROR:</b> The structure of your licence key is invalid, please contact support@mfscripts.com for further support.");
- // clear the vars used above
- unset($licence_key, $actual_licence, $current_url, $vars, $lookup, $timeout, $old, $file, $buffer, $lock_file, $new_data, $padding_start, $padding_end, $start, $end, $last_check, $runcheck);
- /* * ***************************** end check licence details ****************************** */
- /* load db config settings into constants */
- $db = Database::getDatabase();
- $rows = $db->getRows("SELECT config_key, config_value FROM site_config ORDER BY config_group, config_key");
- if (COUNT($rows))
- {
- foreach ($rows AS $row)
- {
- $constantName = "SITE_CONFIG_" . strtoupper($row['config_key']);
- define($constantName, $row['config_value']);
- }
- }
- /* setup translations */
- translate::setUpTranslationConstants();
- // Store session info in the database?
- if ($Config->useDBSessions === true)
- DBSession::register();
- // Initialize our session
- session_name($Config->sessionName);
- session_start();
- // Initialize current user
- $Auth = Auth::getAuth();
- // Object for tracking and displaying error messages
- $Error = Error::getError();
- define("SITE_IMAGE_PATH", WEB_ROOT . "/themes/" . SITE_CONFIG_SITE_THEME . "/images");
- define("SITE_CSS_PATH", WEB_ROOT . "/themes/" . SITE_CONFIG_SITE_THEME . "/styles");
- define("SITE_JS_PATH", WEB_ROOT . "/themes/" . SITE_CONFIG_SITE_THEME . "/js");
- /* check for banned ip */
- $bannedIP = bannedIP::getBannedType();
- if (strtolower($bannedIP) == "whole site")
- {
- header('HTTP/1.1 404 Not Found');
- die();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement