-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathmaster.inc.php
67 lines (54 loc) · 1.87 KB
/
master.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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';
require DOC_ROOT . '/includes/email_class/class.phpmailer.php';
require DOC_ROOT . '/includes/recaptcha/recaptchalib.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();
/* 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();
}