1 |
<?php |
= |
1 |
<?php |
2 |
|
|
2 |
|
3 |
/************************************************************************/ |
<> |
3 |
################################################################## |
4 |
/* PHP-NUKE: Advanced Content Management System */ |
|
4 |
# Copyright by Siegfried Schlosser, Regine Diepold, Roman Mahr ( www.phpnuke-community.de ) |
5 |
/* ============================================ */ |
|
5 |
# know as: sigi, Regs, Dogman |
6 |
/*
*/ |
|
6 |
# Email: admin@phpnuke-community.de |
7 |
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */ |
|
7 |
# Modified for CP v2.0 at www.phpnuke-community.de |
8 |
/* http://phpnuke.org
*/ |
|
8 |
# This file is not free! |
9 |
/*
*/ |
|
9 |
# Do not Remove the Copyright! |
10 |
/* This program is free software. You can redistribute it and/or modify */ |
|
10 |
# modules.php CAN NOT be renamed. |
11 |
/* it under the terms of the GNU General Public License as published by */ |
|
11 |
# modules.php CAN NOT be ported. |
12 |
/* the Free Software Foundation; either version 2 of the License. */ |
|
12 |
# This package CAN NOT be mirrored. |
13 |
/************************************************************************/ |
|
13 |
# Support: http://phpnuke-community.de |
|
|
|
14 |
# Only http://phpnuke-style.de is allowed to sell modules.php! |
|
|
|
15 |
###################################################################* |
14 |
|
= |
16 |
|
15 |
require_once("mainfile.php"); |
|
17 |
require_once("mainfile.php"); |
16 |
|
|
18 |
|
17 |
if (isset($name)) { |
|
19 |
if (isset($name)) { |
|
|
<> |
20 |
## QuickFix 3.2 Begin |
|
|
|
21 |
$name = trim($name); |
|
|
|
22 |
if (preg_match('/(http|ftp)/is', $name)) { |
|
|
|
23 |
die("Sorry, such file doesn't exist..."); |
18 |
|
|
24 |
} |
|
|
|
25 |
## QuickFix 3.2 End |
|
|
|
26 |
global $nukeuser; |
|
|
|
27 |
$nukeuser = base64_decode($user); |
19 |
$result = sql_query("select active, view from ".$prefix."_modules where title='$name'", $dbi); |
= |
28 |
$result = sql_query("select active, view from ".$prefix."_modules where title='$name'", $dbi); |
20 |
list($mod_active, $view) = sql_fetch_row($result, $dbi); |
|
29 |
list($mod_active, $view) = sql_fetch_row($result, $dbi); |
21 |
if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin) OR ($name == "Content"))) { |
<> |
30 |
if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) { |
22 |
if (!isset($mop)) { $mop="modload"; } |
= |
31 |
if (!isset($mop)) { $mop="modload"; } |
23 |
if (!isset($file)) { $file="index"; } |
|
32 |
if (!isset($file)) { $file="index"; } |
24 |
if (ereg("\.\.",$name) || ereg("\.\.",$file)) { |
|
33 |
if (ereg("\.\.",$name) || ereg("\.\.",$file)) { |
25 |
echo "You are so cool..."; |
|
34 |
echo "You are so cool..."; |
26 |
} else { |
|
35 |
} else { |
|
|
-+ |
36 |
// VIEW == ALL |
27 |
if ($view == 0) { |
= |
37 |
if ($view == 0) { |
28 |
$modpath="modules/$name/$file.php"; |
|
38 |
$modpath="modules/$name/$file.php"; |
29 |
if (file_exists($modpath)) { |
|
39 |
if (file_exists($modpath)) { |
30 |
include($modpath); |
|
40 |
include($modpath); |
31 |
} else { |
|
41 |
} else { |
32 |
die ("Sorry, such file doesn't exist..."); |
|
42 |
die ("Sorry, such file doesn't exist..."); |
33 |
} |
|
43 |
} |
34 |
} |
|
44 |
} |
|
|
-+ |
45 |
// VIEW == REGISTERED USERS |
35 |
if ($view == 1 AND is_user($user) || is_admin($admin)) { |
= |
46 |
if ($view == 1 AND is_user($user) || is_admin($admin)) { |
36 |
$modpath="modules/$name/$file.php"; |
|
47 |
$modpath="modules/$name/$file.php"; |
37 |
if (file_exists($modpath)) { |
|
48 |
if (file_exists($modpath)) { |
38 |
include($modpath); |
|
49 |
include($modpath); |
39 |
} else { |
|
50 |
} else { |
40 |
die ("Sorry, such file doesn't exist..."); |
|
51 |
die ("Sorry, such file doesn't exist..."); |
41 |
} |
|
52 |
} |
42 |
} elseif ($view == 1 AND !is_user($user) || !is_admin($admin)) { |
|
53 |
} elseif ($view == 1 AND !is_user($user) || !is_admin($admin)) { |
43 |
$pagetitle = "- "._ACCESSDENIED.""; |
|
54 |
$pagetitle = "- "._ACCESSDENIED.""; |
44 |
include("header.php"); |
|
55 |
include("header.php"); |
45 |
title("$sitename: "._ACCESSDENIED.""); |
|
56 |
title("$sitename: "._ACCESSDENIED.""); |
46 |
OpenTable(); |
|
57 |
OpenTable(); |
47 |
echo
"<center><b>"._RESTRICTEDAREA."</b><br><br>" |
|
58 |
echo
"<center><b>"._RESTRICTEDAREA."</b><br><br>" |
48 |
.""._MODULEUSERS."" |
|
59 |
.""._MODULEUSERS."" |
49 |
.""._GOBACK.""; |
|
60 |
.""._GOBACK.""; |
50 |
CloseTable(); |
|
61 |
CloseTable(); |
51 |
include("footer.php"); |
|
62 |
include("footer.php"); |
52 |
die(); |
|
63 |
die(); |
53 |
} |
|
64 |
} |
|
|
-+ |
65 |
// VIEW == ADMIN |
54 |
if ($view == 2 AND is_admin($admin)) { |
= |
66 |
if ($view == 2 AND is_admin($admin)) { |
55 |
$modpath="modules/$name/$file.php"; |
|
67 |
$modpath="modules/$name/$file.php"; |
56 |
if (file_exists($modpath)) { |
|
68 |
if (file_exists($modpath)) { |
57 |
include($modpath); |
|
69 |
include($modpath); |
58 |
} else { |
|
70 |
} else { |
59 |
die ("Sorry, such file doesn't exist..."); |
|
71 |
die ("Sorry, such file doesn't exist..."); |
60 |
} |
<> |
72 |
} |
61 |
} elseif ($view == 2 AND !is_admin($admin)) { |
= |
73 |
} elseif ($view == 2 AND !is_admin($admin)) { |
62 |
$pagetitle = "- "._ACCESSDENIED.""; |
|
74 |
$pagetitle = "- "._ACCESSDENIED.""; |
63 |
include("header.php"); |
|
75 |
include("header.php"); |
64 |
title("$sitename: "._ACCESSDENIED.""); |
|
76 |
title("$sitename: "._ACCESSDENIED.""); |
65 |
OpenTable(); |
|
77 |
OpenTable(); |
66 |
echo
"<center><b>"._RESTRICTEDAREA."</b><br><br>" |
|
78 |
echo
"<center><b>"._RESTRICTEDAREA."</b><br><br>" |
67 |
.""._MODULESADMINS."" |
|
79 |
.""._MODULESADMINS."" |
68 |
.""._GOBACK.""; |
|
80 |
.""._GOBACK.""; |
69 |
CloseTable(); |
|
81 |
CloseTable(); |
70 |
include("footer.php"); |
|
82 |
include("footer.php"); |
71 |
die(); |
|
83 |
die(); |
72 |
} |
|
84 |
} |
|
|
-+ |
85 |
// VIEW == USERGROUPS |
|
|
|
86 |
if ($view > 2 AND is_user($user)) {// || is_admin($admin) |
|
|
|
87 |
$userInfo = getusrinfo($user); |
|
|
|
88 |
$newView = $view - 2; |
|
|
|
89 |
list($groupName) = sql_fetch_row(sql_query("select groupName from
".$prefix."_usergroups where groupID=$newView", $dbi), $dbi); |
|
|
|
90 |
list($confUID) = sql_fetch_row(sql_query("select uid from
".$prefix."_usergroup_users where groupID=$newView AND
uid=$userInfo[uid]", $dbi), $dbi); |
|
|
|
91 |
if ($confUID == $userInfo[uid] || is_admin($admin)) { |
|
|
|
92 |
$modpath="modules/$name/$file.php"; |
|
|
|
93 |
if (file_exists($modpath)) { |
|
|
|
94 |
include($modpath); |
|
|
|
95 |
} else { |
|
|
|
96 |
die ("Sorry, such file doesn't exist..."); |
|
|
|
97 |
} |
|
|
|
98 |
} else { |
|
|
|
99 |
$pagetitle = "- "._ACCESSDENIED.""; |
|
|
|
100 |
include("header.php"); |
|
|
|
101 |
title("$sitename: "._ACCESSDENIED.""); |
|
|
|
102 |
OpenTable(); |
|
|
|
103 |
echo
"<center><b>"._RESTRICTEDAREA."</b><br><br>" |
|
|
|
104 |
."We are Sorry but this section of our site is for <i>$groupName
Only</i><br><br>" |
|
|
|
105 |
.""._GOBACK.""; |
|
|
|
106 |
CloseTable(); |
|
|
|
107 |
include("footer.php"); |
|
|
|
108 |
die(); |
|
|
|
109 |
} |
|
|
|
110 |
} elseif ($view > 2 AND !is_user($user)) { |
|
|
|
111 |
$pagetitle = "- "._ACCESSDENIED.""; |
|
|
|
112 |
include("header.php"); |
|
|
|
113 |
title("$sitename: "._ACCESSDENIED.""); |
|
|
|
114 |
OpenTable(); |
|
|
|
115 |
echo
"<center><b>"._RESTRICTEDAREA."</b><br><br>" |
|
|
|
116 |
.""._MODULEUSERS."" |
|
|
|
117 |
.""._GOBACK.""; |
|
|
|
118 |
CloseTable(); |
|
|
|
119 |
include("footer.php"); |
|
|
|
120 |
die(); |
|
|
|
121 |
} |
73 |
} |
= |
122 |
} |
74 |
} else { |
|
123 |
} else { |
75 |
include("header.php"); |
|
124 |
include("header.php"); |
76 |
OpenTable(); |
|
125 |
OpenTable(); |
77 |
echo "<center>"._MODULENOTACTIVE."<br><br>" |
|
126 |
echo "<center>"._MODULENOTACTIVE."<br><br>" |
78 |
.""._GOBACK."</center>"; |
|
127 |
.""._GOBACK."</center>"; |
79 |
CloseTable(); |
|
128 |
CloseTable(); |
80 |
include("footer.php"); |
|
129 |
include("footer.php"); |
81 |
} |
|
130 |
} |
82 |
} else { |
|
131 |
} else { |
83 |
die ("Sorry, you can't access this file directly..."); |
|
132 |
die ("Sorry, you can't access this file directly..."); |
84 |
} |
|
133 |
} |
85 |
|
|
134 |
|
86 |
?> |
|
135 |
?> |