<?PHP
/************************************************************************/
/* NPDS V : Net Portal Dynamic System .                                 */
/* ===========================                                          */
/*                                                                      */
/* This version name NPDS Copyright (c) 2001-2005 by Philippe Brunier   */
/*                                                                      */
/* 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.       */
/************************************************************************/
include ("grab_globals.php");

function Access_Error () {
  if (file_exists("meta/meta.php"))
     include ("meta/meta.php");
  echo "<title>NPDS</title></head><body bgcolor=\"white\"><br /><p align=\"center\"><span style=\"font-size: 14px; font-family: Arial; font-weight: bold; color: red;\">";
  echo "Access Denied / Acc&egrave;s Refus&eacute;";
  if (cur_charset=="utf-8") echo" / &#x901A;&#x5165;&#x88AB;&#x5426;&#x8BA4;";
  echo "</span>";
  echo "<br /><br /><span style=\"font-size: 12px; font-family: Arial; font-weight: bold; color: black;\">NPDS - Portal System";
  echo "</span></p></body></html>";
  die();
}
function filtre_module($strtmp) {
   if (strstr($strtmp,"..") || stristr($strtmp,"script") || stristr($strtmp,"cookie") || stristr($strtmp,"iframe") || stristr($strtmp,"applet") || stristr($strtmp,"object") || stristr($strtmp,"meta")) {
      Access_Error();
   } else {
      if ($strtmp!="") {
         return (true);
      } else {
         return (false);
      }
   }
}
if (filtre_module($ModPath) and filtre_module($ModStart)) {
   if (!function_exists("Mysql_Connexion")) {include ("mainfile.php");}
   if (file_exists("modules/$ModPath/$ModStart.php")) {
      include("modules/$ModPath/$ModStart.php");
      die();
   } else {
      Access_Error();
   }
} elseif (filtre_module($name) and filtre_module($file)) {
   // phpnuke compatibility
   if (!function_exists("Mysql_Connexion")) {include ("mainfile.php");}
   if (file_exists("modules/$name/$file.php")) {
      include("modules/$name/$file.php");
      die();
   } else {
      Access_Error();
   }
} else {
   Access_Error();
}
?>
