-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodules.php
134 lines (130 loc) · 5.3 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
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2007 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. */
/************************************************************************/
define('MODULE_FILE', true);
require_once("mainfile.php");
if (isset($name) && $name == $_REQUEST['name']) {
$name = addslashes(trim($name));
$modstring = strtolower($_SERVER['QUERY_STRING']);
if (stripos_clone($name, "..") OR ((stripos_clone($modstring,"&file=nickpage") || stripos_clone($modstring,"&user=")) AND ($name=="Private_Messages" OR $name=="Forums" OR $name=="Members_List"))) header("Location: index.php");
global $nukeuser, $db, $prefix, $user;
if (is_user($user)) {
$nukeuser = base64_decode($user);
$nukeuser = addslashes($nukeuser);
} else {
$nukeuser = "";
}
$result = $db->sql_query("SELECT active, view FROM ".$prefix."_modules WHERE title='".addslashes($name)."'");
list($mod_active, $view) = $db->sql_fetchrow($result);
$mod_active = intval($mod_active);
$view = intval($view);
if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) {
if (!isset($mop) OR $mop != $_REQUEST['mop']) $mop="modload";
if (!isset($file) OR $file != $_REQUEST['file']) $file="index";
if (stripos_clone($file,"..") OR stripos_clone($mop,"..")) die("You are so cool...");
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/modules/$name/".$file.".php")) {
$modpath = "themes/$ThemeSel/";
} else {
$modpath = "";
}
if ($view == 0) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} elseif ($view == 1 AND (is_user($user) OR is_group($user, $name)) OR is_admin($admin)) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} elseif ($view == 1 AND !is_user($user) AND !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED;
include("header.php");
title($sitename.": "._ACCESSDENIED);
OpenTable();
echo "<center><strong>"._RESTRICTEDAREA."</strong><br><br>"._MODULEUSERS;
$result2 = $db->sql_query("SELECT mod_group FROM ".$prefix."_modules WHERE title='".addslashes($name)."'");
list($mod_group) = $db->sql_fetchrow($result2);
if ($mod_group != 0) {
$result3 = $db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='".intval($mod_group)."'");
$row3 = $db->sql_fetchrow($result3);
echo _ADDITIONALYGRP.": <b>".$row3['name']."</b><br><br>";
}
echo _GOBACK;
CloseTable();
include("footer.php");
} elseif ($view == 2 AND is_admin($admin)) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} elseif ($view == 2 AND !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED;
include("header.php");
title($sitename.": "._ACCESSDENIED);
OpenTable();
echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"._MODULESADMINS.""._GOBACK;
CloseTable();
include("footer.php");
} elseif ($view == 3 AND paid()) {
$modpath .= "modules/$name/".$file.".php";
if (file_exists($modpath)) {
include($modpath);
} else {
include("header.php");
OpenTable();
echo "<br><center>Sorry, such file doesn't exist...</center><br>";
CloseTable();
include("footer.php");
}
} else {
$pagetitle = "- "._ACCESSDENIED."";
include("header.php");
title($sitename.": "._ACCESSDENIED."");
OpenTable();
echo "<center><strong>"._RESTRICTEDAREA."</strong><br><br>"._MODULESSUBSCRIBER;
if (!empty($subscription_url)) echo "<br>"._SUBHERE;
echo "<br><br>"._GOBACK;
CloseTable();
include("footer.php");
}
} else {
include("header.php");
OpenTable();
echo "<center>"._MODULENOTACTIVE."<br><br>"._GOBACK."</center>";
CloseTable();
include("footer.php");
}
} else {
header("Location: index.php");
exit;
}
?>