-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodules.php
214 lines (184 loc) · 7.08 KB
/
modules.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
/*=======================================================================
Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
=======================================================================*/
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* */
/************************************************************************/
/* Additional security checking code 2003 by chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/*****[CHANGES]**********************************************************
-=[Base]=-
Nuke Patched v3.1.0 06/26/2005
-=[Mod]=-
Lock Modules v1.0.0 08/04/2005
************************************************************************/
define('MODULE_FILE', true);
if (isset($_GET['file']) && $_GET['file'] == 'posting') {
define('MEDIUM_SECURITY', true);
}
if (isset($_GET['Action']) && $_GET['Action'] == 'AJAX') {
define('MEDIUM_SECURITY', true);
}
if (isset($_POST['tos_text']) && isset($_POST['op']) && $_POST['op'] == 'editTOS') {
define('MEDIUM_SECURITY', true);
}
require_once(dirname(__FILE__) . '/mainfile.php');
global $name;
if ($name) {
/*****[BEGIN]******************************************
[ Mod: Lock Modules v1.0.0 ]
******************************************************/
global $db, $prefix, $user, $lock_modules;
if(($lock_modules && $name != 'Your_Account') && !is_admin() && !is_user() && ($name != 'Profile' && $mode == 'register' && (isset($check_num) || isset($HTTP_POST_VARS['submit'])))) {
include(NUKE_MODULES_DIR.'Your_Account/index.php');
}
/*****[END]********************************************
[ Mod: Lock Modules v1.0.0 ]
******************************************************/
$module = $db->sql_ufetchrow('SELECT `title`,
`active`,
`view`,
`blocks`,
`custom_title`,
`groups` FROM `'.$prefix.'_modules` WHERE `title`="'.Fix_Quotes($name).'"');
$module_name = $module['title'];
if ($module_name == 'Your_Account' || $module_name == main_module())
{
$module['active'] = true;
$view = 0;
}
else
{
$view = $module['view'];
}
if ($name == 'Technocrat')
{
die('Sleep alittle, Drink alot');
}
if ($name == 'TheGhost')
{
die('Sleep alittle, Code alot');
}
if ($module['active'] || is_mod_admin($module_name))
{
if (!isset($file) OR $file != $_REQUEST['file'])
$file='index';
if (isset($open))
{
if ($open != $_REQUEST['open']) $open = '';
}
if ((isset($file) && stristr($file,"..")) || (isset($mop) && stristr($mop,"..")) || (isset($open) && stristr($open,"..")))
die('You are so cool...');
$showblocks = $module['blocks'];
$module_title = ($module['custom_title'] != '') ? $module['custom_title'] : str_replace('_', ' ', $module_name);
$modpath = isset($module['title']) ? NUKE_MODULES_DIR.$module['title']."/$file.php" : NUKE_MODULES_DIR.$name."/$file.php";
$groups = (!empty($module['groups'])) ? $groups = explode('-', $module['groups']) : '';
if(!empty($open))
{
$modpath = isset($module['title']) ? NUKE_MODULES_DIR.$module['title']."/$open.php" : NUKE_MODULES_DIR.$name."/$open.php";
}
unset($module, $error);
if ($view >= 1 && !is_admin())
{
# Must Not be a user
if ($view == 2 AND is_user())
{
$error = _MVIEWANON;
# Must Be a user
}
else
if ($view == 3 && !is_user())
{
$error = _MODULEUSERS;
# Must Be an admin
}
else
if ($view == 4 && !is_mod_admin($module['title']))
{
$error = _MODULESADMINS;
# Groups
}
else
if ($view == 6 && !empty($groups) && is_array($groups))
{
$ingroup = false;
global $userinfo;
foreach ($groups as $group)
{
if (isset($userinfo['groups'][$group]))
{
$ingroup = true;
}
}
# Lets do alittle more with the information we give when folks try to access
# groups they are not authorized to view or access!
# Ernest Buffington - 09/03/2019
if (!$ingroup)
{
$result = $db->sql_query('SELECT group_name
FROM '.$prefix.'_bbgroups WHERE group_id = '.$group.'
ORDER BY group_id');
if($db->sql_numrows($result))
{
while($row = $db->sql_fetchrow($result))
{
if ($group == 9)
{
$error = '<img class="icons" align="absmiddle" width="200" src="'.img('unknown-error.png','error').'"><br />';
$error .= '<strong><font size="4">'.GroupColor($row['group_name']).' Area!';
$error .= '<br />You do not possess the required credentials to access the Network '.$module_title.' area!</font></strong>';
}
else
if ($group == 10)
{
$error = '<img class="icons" align="absmiddle" width="200" src="'.img('unknown-error.png','error').'"><br />';
$error .= '<strong><font size="4">You must be a '.GroupColor($row['group_name']).' Area!';
$error .= '<br />You do not possess the required credentials to access the '.$module_title.' area!</font></strong>';
}
else
{
$error = '<img class="icons" align="absmiddle" width="200" src="'.img('unknown-error.png','error').'"><br />';
$error .= '<strong><font size="4">'.GroupColor($row['group_name']).' Area!';
$error .= '<br />You do not possess the required credentials to access the '.$module_title.' area!</font></strong>';
}
}
}
$db->sql_freeresult($result);
}
}
}
if(isset($error))
{
DisplayError($error);
}
else
if(file_exists($modpath))
{
include($modpath);
}
else
{
DisplayError(_MODULEDOESNOTEXIST);
}
}
else
{
DisplayError(_MODULENOTACTIVE."<br /><br />"._GOBACK);
}
}
else
{
redirect('index.php');
}
?>