also prevent it in .htacces. You may want to add this to one of your files in /etc...
[mailer.git] / js.php
diff --git a/js.php b/js.php
index a9d9375755100d5fab1089de911009c06371fd60..7fae050e4db804ab424d1ecd8d7774e70df16314 100644 (file)
--- a/js.php
+++ b/js.php
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 10/15/2008 *
- * ===============                              Last change: 10/15/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 10/15/2008 *
+ * ===================                          Last change: 10/15/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : js.php                                           *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Code-Bild fuer verschiedene Zwecke               *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * 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 *
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
 
-// Deactivate caching system in fake-CSS mode
-define('_OB_CACHING', "old");
+// XDEBUG call
+//* DEBUG: */ xdebug_start_trace();
 
-// Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )
-require("inc/libs/security_functions.php");
+// Load security stuff here
+require('inc/libs/security_functions.php');
 
-// Init "action" and "what"
-$GLOBALS['what']   = "";
-$GLOBALS['action'] = "";
+// Init start time
+$GLOBALS['__start_time'] = microtime(TRUE);
 
-// This is a fake-CSS file loader, more a JavaScript loader...
-// This is in one way good and in one not. The whole reset part will be
-// by-passed even in this "faked" CSS mode. The bad news is that this makes all
-// JS calls on this script to CSS calls. So no real "request" like in MVC
-// pattern is given...
-//
-// But mxchange 0.3.0 will show that in better way! :D :D :D
-$GLOBALS['output_mode'] = "1";
-$GLOBALS['module'] = "js";
+/*
+ * This is a fake-CSS file loader, more a JavaScript loader...
+ * This is in one way good and in one not. The whole reset part will be
+ * by-passed even in this "faked" CSS mode. The bad news is that this makes all
+ * JS calls on this script to CSS calls. So no real "request" like in MVC
+ * pattern is given...
+ *
+ * But Mailer-Project 0.3.0 will show that in better way! :D :D :D
+ */
+$GLOBALS['__module']      = 'js';
+$GLOBALS['__output_mode'] = 1;
 
-// Load the required file(s)
-require("inc/config.php");
+// Initialize application
+require('inc/init.php');
 
-// Is this script installed and a JavaScript tag is provied?
-if ((isInstalled()) && (REQUEST_ISSET_GET(('tag')))) {
-       // Set header
-       header("Content-type: text/javascript");
+// Set header and HTTP status
+setContentType('text/javascript');
+setHttpStatus('404 Not Found');
 
+// Is 'js' is provied?
+if (isGetRequestElementSet('js')) {
        // Load header
-       LOAD_INC_ONCE("inc/header.php");
+       loadPageHeader();
 
        // Prepare include file for looking
-       $INC = sprintf("inc/js/tag-%s.php",
-               REQUEST_GET(('tag'))
-       );
+       $inc = sprintf('inc/js/js-%s.php', getRequestElement('js'));
 
        // Is that file readable?
-       if (INCLUDE_READABLE($INC)) {
+       if (isIncludeReadable($inc)) {
+               // Okay, found
+               setHttpStatus('200 OK');
+
                // Include it
-               LOAD_INC_ONCE($INC);
-       } // END - if 
+               loadIncludeOnce($inc);
+       } // END - if
 
        // Load footer
-       LOAD_INC_ONCE("inc/footer.php");
+       loadPageFooter();
 } // END - if
 
 // Shutdown
-shutdown();
+doShutdown();
 
-//
+// [EOF]
 ?>