<?php
/************************************************************************/
/* ViperWeb: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Raptr & Godboko */
/* http://development.ea-hq.net */
/* */
/* 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. */
/* */
/* Based on PHP-Nuke found at http://www.phpnuke.org */
/************************************************************************/
require_once("mainfile.php");
$PHP_SELF = "modules.php";
if (isset($mod)) {
$result = sql_query("select active, view from ".$prefix."_modules where title='$mod'", $dbi);
list($mod_active, $view) = sql_fetch_row($result, $dbi);
if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin) OR ($mod == "Content"))) {
if (!isset($mop)) { $mop="modload"; }
if (!isset($file)) { $file="index"; }
if (ereg("\.\.",$mod) || ereg("\.\.",$file)) {
echo "You are so cool...";
} else {
if ($view == 0) {
$modpath="modules/$mod/$file.php";
if (file_exists($modpath)) {
include($modpath);
} else {
die ("Sorry, such file doesn't exist...");
}
}
if ($view == 1 AND is_user($user) || is_admin($admin)) {
$modpath="modules/$mod/$file.php";
if (file_exists($modpath)) {
include($modpath);
} else {
die ("Sorry, such file doesn't exist...");
}
} elseif ($view == 1 AND !is_user($user) || !is_admin($admin)) {
$pagetitle = "- "._ACCESSDENIED."";
include("header.php");
title("$sitename: "._ACCESSDENIED."");
OpenTable();
echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
.""._MODULEUSERS.""
.""._GOBACK."";
CloseTable();
include("footer.php");
die();
}
if ($view == 2 AND is_admin($admin)) {
$modpath="modules/$mod/$file.php";
if (file_exists($modpath)) {
include($modpath);
} else {
die ("Sorry, such file doesn't exist...");
}
} 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");
die();
}
}
} else {
include("includes/header.php");
OpenTable();
echo "<center>"._MODULENOTACTIVE."<br><br>"
.""._GOBACK."</center>";
CloseTable();
include("includes/footer.php");
}
}
else {
$modpath="modules/Index/index.php";
if (file_exists($modpath)) {
include($modpath);
}
else {
die("The index page could not be found");
}
}
if ($mod = Index) {
unset($mod);
}
?>