-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
common.php
executable file
·103 lines (90 loc) · 4.34 KB
/
common.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
////////////////////////////////////////////////////////////////////////////////
// Copyright (C) ReloadCMS Development Team //
// http://reloadcms.com //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY, without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
// //
// This product released under GNU General Public License v2 //
////////////////////////////////////////////////////////////////////////////////
error_reporting(E_ALL);
// Unset any globals created by register_globals being turned ON
foreach ($GLOBALS as $key => $global) {
if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST)$/', $key)) {
unset($$key);
}
}
unset($global);
////////////////////////////////////////////////////////////////////////////////
// Defining constants //
////////////////////////////////////////////////////////////////////////////////
define('RCMS_VERSION_A', '1');
define('RCMS_VERSION_B', '2');
define('RCMS_VERSION_C', '22');
if (!defined('RCMS_ROOT_PATH')) {
die('Even though I walk through the darkest valley, I will fear no evil, for you are with me; your rod and your staff, they comfort me.'); //23:4
}
if (is_file(RCMS_ROOT_PATH . 'CURRENT')) {
define('RCMS_VERSION_SUFFIX', '-git');
} else {
define('RCMS_VERSION_SUFFIX', '');
}
define('RCMS_COPYRIGHT', '© ' . date("Y"));
define('RCMS_POWERED', 'RCMS Framework');
// Main paths
define('SYSTEM_MODULES_PATH', RCMS_ROOT_PATH . 'modules/system/');
define('ENGINE_PATH', RCMS_ROOT_PATH . 'modules/engine/');
define('MODULES_PATH', RCMS_ROOT_PATH . 'modules/general/');
define('REMOTEAPI_PATH', RCMS_ROOT_PATH . 'modules/remoteapi/');
define('MODULES_TPL_PATH', RCMS_ROOT_PATH . 'modules/templates/');
define('MODULES_DOWNLOADABLE', RCMS_ROOT_PATH . 'modules/foreign/');
define('CONFIG_PATH', RCMS_ROOT_PATH . 'config/');
define('LANG_PATH', RCMS_ROOT_PATH . 'languages/');
define('ADMIN_PATH', RCMS_ROOT_PATH . 'admin/');
define('SKIN_PATH', RCMS_ROOT_PATH . 'skins/');
define('SMILES_PATH', SKIN_PATH . 'smiles/');
define('BACKUP_PATH', RCMS_ROOT_PATH . 'backups/');
// Content paths
define('DATA_PATH', RCMS_ROOT_PATH . 'content/');
define('RATE_PATH', DATA_PATH . 'rate/');
define('DF_PATH', DATA_PATH . 'datafiles/');
define('USERS_PATH', DATA_PATH . 'users/');
define('FILES_PATH', DATA_PATH . 'uploads/');
define('GALLERY_PATH', DATA_PATH . 'gallery/');
define('FORUM_PATH', DATA_PATH . 'forum/');
define('LOGS_PATH', DATA_PATH . 'logs/');
define('IPACLALLOWIP_PATH', DATA_PATH . 'documents/ipacl/ip/');
define('IPACLALLOWNETS_PATH', DATA_PATH . 'documents/ipacl/nets/');
// Cookies
define('FOREVER_COOKIE', time() + 3600 * 24 * 365 * 5);
define('IGNORE_LOCK_FILES', false);
////////////////////////////////////////////////////////////////////////////////
// Loading modules //
////////////////////////////////////////////////////////////////////////////////
include_once(SYSTEM_MODULES_PATH . 'load.php');
if (empty($_SERVER['REQUEST_URI']))
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
if (empty($_SERVER['REMOTE_ADDR']))
$_SERVER['REMOTE_ADDR'] = '0.0.0.0';
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
if (empty($_SERVER['REMOTE_HOST']))
$_SERVER['REMOTE_HOST'] = $_SERVER['REMOTE_ADDR'];
if (empty($_SERVER['HTTP_REFERER']))
$_SERVER['HTTP_REFERER'] = '';
if (empty($_SERVER['HTTP_USER_AGENT']))
$_SERVER['HTTP_USER_AGENT'] = '';
////////////////////////////////////////////////////////////////////////////////
// Loading modules //
////////////////////////////////////////////////////////////////////////////////
include("api/apiloader.php");
$em_dir = opendir(ENGINE_PATH);
while ($em = readdir($em_dir)) {
if (substr($em, 0, 1) != '.' && is_file(ENGINE_PATH . $em)) {
include_once(ENGINE_PATH . $em);
}
}
closedir($em_dir);
?>