First batch of removal of the headers needed for revision-functions.php
[mailer.git] / modules.php
index 7e8a0b2ea9657d6cbacc8cd7557a5c0a0ac96b90..914724847e6027565c8601416c2ce7cd097b611d 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Hauptladedatei. Laedt alle benoetigten Dateien   *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $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 - 2009 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2013 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 *
 require('inc/libs/security_functions.php');
 
 // Init start time
-$GLOBALS['startTime'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
 
 // Init output mode and module
-$GLOBALS['output_mode'] = '0';
-$GLOBALS['module'] = '';
+$GLOBALS['__module']      = 'unknown';
+$GLOBALS['__output_mode'] = '0';
 
 // Needed include files
 require('inc/config-global.php');
 
-// Set content type
-setContentType('text/html');
-
-// Fix missing module to 'index'
-if (!isGetRequestElementSet('module')) setRequestGetElement('module', 'index');
-
-// The header file
-loadIncludeOnce('inc/header.php');
-
-// Modules are by default not valid!
-$isModuleValid = false;
-$URL = '';
-$check = 'failed';
-
-// Is the maintenance mode active or goes all well?
-if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (!isAdmin()) && (getModule() != 'admin')) {
-       // Maintain mode is active and you are no admin
-       addFatalMessage(__FILE__, __LINE__, getMessage('LANG_DOWN_MAINTAINCE'));
-} elseif ((SQL_IS_LINK_UP()) && (getTotalFatalErrors() == '0')) {
-       // Construct module name
-       $GLOBALS['module_inc'] =  sprintf("inc/modules/%s.php", getModule());
-
-       // Check module permission (again)
-       $check = checkModulePermissions();
-       switch ($check) {
-               case 'cache_miss': // The cache is gone
-               case 'admin_only': // Admin-only access
-               case 'mem_only': // Member-only access
-               case 'done': // All fine!
-                       // Does the module exists on local file system?
-                       if ((isIncludeReadable($GLOBALS['module_inc'])) && (getTotalFatalErrors() == '0')) {
-                               // Module is valid, active and located on the local disc...
-                               $isModuleValid = true;
-                       } elseif (getTotalFatalErrors() == '0') {
-                               // Module not found!
-                               addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
-                       }
-                       break;
-
-               case '404':
-                       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
-                       break;
-
-               case 'locked':
-                       if (!isIncludeReadable($GLOBALS['module_inc'])) {
-                               // Module does addionally not exists
-                               addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
-                       } // END - if
-
-                       // Add fatal message
-                       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_LOCKED'), getModule()));
-                       break;
-
-               default:
-                       logDebugMessage(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, getModule()));
-                       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_UNKNOWN'), $check));
-                       break;
-       } // END - switch
-} elseif (getTotalFatalErrors() == '0') {
-       // MySQL problems!
-       addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_ERRORS'));
-}
-
-if (($isModuleValid === true) && (isset($GLOBALS['module_inc']))) {
-       // Everything is okay so we can load the module
-       loadIncludeOnce($GLOBALS['module_inc']);
-} // END - if
-
-// Add the footer (this will call shutdown())
-loadIncludeOnce('inc/footer.php');
+// Include module
+doIncludeModule();
 
 // [EOF]
 ?>