home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / modules.php < prev    next >
PHP Script  |  2004-08-26  |  4KB  |  99 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Advanced Content Management System                         */
  5. /* ============================================                         */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14. require_once("mainfile.php");
  15. $module = 1;
  16.  
  17.     $name = trim($name);
  18. if (isset($name)) {
  19. if (eregi("http\:\/\/", $name)) {
  20.     die("Hi and Bye");
  21.     }
  22.     $modstring = strtolower($_SERVER['QUERY_STRING']);
  23. if (stripos_clone($modstring,"&user=") AND ($name=="Private_Messages" || $name=="Forums" || $name=="Members_List")) header("Location: index.php");
  24.     global $nukeuser, $db, $prefix;
  25.     $nukeuser = base64_decode($user);
  26.     $nukeuser = addslashes($nukeuser);
  27.     $row = $db->sql_fetchrow($db->sql_query("SELECT active, view FROM ".$prefix."_modules WHERE title='$name'"));
  28.     $mod_active = intval($row['active']);
  29.     $view = intval($row['view']);
  30.     if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) {
  31.     if (!isset($mop)) { $mop="modload"; }
  32.     if (!isset($file)) { $file="index"; }
  33.     if (ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mop)) {
  34.         echo "You are so cool...";
  35.     } else {
  36.         $ThemeSel = get_theme();
  37.         if (file_exists("themes/$ThemeSel/modules/$name/".$file.".php")) {
  38.         $modpath = "themes/$ThemeSel/";
  39.         } else {
  40.         $modpath = "";
  41.         }
  42.         if ($view == 0) {
  43.         $modpath .= "modules/$name/".$file.".php";
  44.             if (file_exists($modpath)) {
  45.             include($modpath);
  46.             } else {
  47.             die ("Sorry, such file doesn't exist...");
  48.         }
  49.         } else if ($view == 1 AND is_user($user) || is_admin($admin)) {
  50.         $modpath .= "modules/$name/".$file.".php";
  51.             if (file_exists($modpath)) {
  52.             include($modpath);
  53.             } else {
  54.             die ("Sorry, such file doesn't exist...");
  55.         }
  56.         } elseif ($view == 1 AND !is_user($user) || !is_admin($admin)) {
  57.         $pagetitle = "- "._ACCESSDENIED."";
  58.         include("header.php");
  59.         title("$sitename: "._ACCESSDENIED."");
  60.         OpenTable();
  61.         echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
  62.             .""._MODULEUSERS.""
  63.             .""._GOBACK."";
  64.         CloseTable();
  65.         include("footer.php");
  66.         die();
  67.         } else if ($view == 2 AND is_admin($admin)) {
  68.         $modpath .= "modules/$name/".$file.".php";
  69.             if (file_exists($modpath)) {
  70.             include($modpath);
  71.             } else {
  72.             die ("Sorry, such file doesn't exist...");
  73.         }
  74.         } elseif ($view == 2 AND !is_admin($admin)) {
  75.         $pagetitle = "- "._ACCESSDENIED."";
  76.         include("header.php");
  77.         title("$sitename: "._ACCESSDENIED."");
  78.         OpenTable();
  79.         echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
  80.             .""._MODULESADMINS.""
  81.             .""._GOBACK."";
  82.         CloseTable();
  83.         include("footer.php");
  84.         die();
  85.         }
  86.     }
  87.     } else {
  88.     include("header.php");
  89.     OpenTable();
  90.     echo "<center>"._MODULENOTACTIVE."<br><br>"
  91.         .""._GOBACK."</center>";
  92.     CloseTable();
  93.     include("footer.php");
  94.     }
  95. } else {
  96.     die ("Sorry, you can't access this file directly...");
  97. }
  98.  
  99. ?>