]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/action-
All, except security block, include()/require() rewritten to own LOAD_INC()/LOAD_INC_...
[mailer.git] / inc / modules / guest / action-
index c10ba15b5adc03de849ae54915b136f3c60bd44c..84177b62368cc03a82f25a329a3217728dd4da44 100644 (file)
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
+       addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE, "");
+       return;
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
 }
 
 // Add description as navigation point
-ADD_DESCR("guest", basename(__FILE__));
+ADD_DESCR("guest", __FILE__);
 
 // Load the include file
-$INC = sprintf(PATH."inc/modules/guest/what-%s.php", $GLOBALS['what']);
-if (file_exists($INC))
-{
+$INC = sprintf("inc/modules/guest/what-%s.php", $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the guest action module
-       include($INC);
-}
- else
-{
-       ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
+       LOAD_INC($INC);
+} elseif ($IS_VALID) {
+       addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
+} else {
+       addFatalMessage(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
 }
+
 //
 ?>