forked from mario-fan-games-galaxy/tcsms
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
131 lines (101 loc) · 3.87 KB
/
index.php
File metadata and controls
131 lines (101 loc) · 3.87 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
//------------------------------------------------------------------
// Taloncrossing Submission Management System 1.0
//------------------------------------------------
// Copyright 2005 Justin Aquadro
//
// Index.php --
// Main Point of execution for entire CMS
//------------------------------------------------------------------
//set_time_limit(0);
//set_magic_quotes_runtime(0); // deprecated
define ('ROOT_PATH', './');
global $upload_msg, $global_error;
//------------------------------------------------
require ROOT_PATH.'settings.php';
require ROOT_PATH.'lib/db_drivers/'.$CFG['db_driver'].'.php';
$DB = new db_driver;
$DB->connect();
if (!empty($_GET['debug']))
$DB->debug = 1;
//------------------------------------------------
require ROOT_PATH.'lib/std.php';
require ROOT_PATH.'lib/userlib.php';
require ROOT_PATH.'lib/module.php';
require ROOT_PATH.'component/template_ui.php';
$STD = new std;
$STD->template = new template;
$STD->template->init();
$STD->modules = new module_record;
//$STD->modules->load_module_list();
$IN = $STD->parse_input();
$session = new session;
$session->authorize();
/*if (!$session->authorize()) {
$STD->error("Your access to {$CFG['site_name']} has been revoked. If you believe this is an error, contact
the <a href='mailto:{$CFG['admin_email']}'>site staff</a>. If you have been granted an exception, login
to the site with your username and password.");
$session->clear_session();
}*/
//trigger_error("<pre>{$_SERVER['REMOTE_ADDR']} (This is not an error - this is part of a temporary debugging session. Please ignore it.)</pre>", E_USER_WARNING);
$STD->global_template = $STD->template->useTemplate('global');
$STD->global_template_ui = new template_ui;
$STD->tags = $STD->template->global_tags();
//------------------------------------------------
/*$STD->modules = array();
$DB->query("SELECT * FROM {$CFG['db_pfx']}_modules");
while ($mod = $DB->fetch_row()) {
$STD->modules[$mod['mid']] = $mod;
}
if ($IN['c'] > 0) {
!isset($STD->modules[$IN['c']]) ? $STD->template->preprocess_error("Invalud Module Specified") : false;
$MODULE = $STD->modules[$IN['c']];
require_once ROOT_PATH.'component/modules/'.$MODULE['module_file'];
} else
$MODULE = null;*/
/*if ($IN['c'] > 0) {
//$mod_id = $TAG->nodedef[$IN['c']][1];
empty($IN['c']) ? $mod_id = '0' : $mod_id = $IN['c'];
$DB->query("SELECT * FROM {$CFG['db_pfx']}_modules WHERE mid = '{$mod_id}'");
$MODULE = $DB->fetch_row();
empty($MODULE) ? $STD->template->preprocess_error("Invalid Module Specified") : false;
require_once ROOT_PATH.'component/modules/'.$MODULE['module_file'];
} else
$MODULE = null;*/
//------------------------------------------------
// Are we offline?
if ($CFG['site_offline'] && !$STD->user['acp_access']) {
if ($IN['act'] != 'login' || $IN['param'] != 2) {
$STD->offline = 1;
$STD->template->display($CFG['offline_msg']);
exit;
}
}
//$IN['act'] = 'msg';
switch ($IN['act']) {
case 'login' : require ROOT_PATH.'component/login.php'; break;
case 'submit' : require ROOT_PATH.'component/submit.php'; break;
case 'user' : require ROOT_PATH.'component/user.php'; break;
case 'resdb' : require ROOT_PATH.'component/resourcedb.php'; break;
case 'msg' : require ROOT_PATH.'component/messenger.php'; break;
case 'comment' : require ROOT_PATH.'component/comment.php'; break;
case 'search' : require ROOT_PATH.'component/search.php'; break;
case 'page' : require ROOT_PATH.'component/page.php'; break;
case 'notice' : require ROOT_PATH.'component/submit_done.php'; break;
case 'staff' : $IN['param'] = 7;
require ROOT_PATH.'component/main.php'; break;
default : require ROOT_PATH.'component/main.php'; break;
}
$component->init();
$session->save_data(); //('err_save', false);
function get_error () {
global $global_error;
$output = 0;
if (!empty($global_error))
{
$output = $global_error;
}
return $output;
}
$DB->close_db();
?>