require($INC);
}
-// Non-database functions
-require('inc/functions.php');
-
-// Wrapper functions
-require('inc/wrapper-functions.php');
-
// Load more function libraries or includes
-foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'language-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
+foreach (array('functions', 'request-functions', 'session-functions', 'code-functions', 'inc-functions', 'language-functions', 'filters', 'mysql-manager', 'extensions', 'handler', 'hooks') as $lib) {
// Load special functions
loadIncludeOnce('inc/' . $lib . '.php');
} // END - foreach
// Set error handler
set_error_handler('__errorHandler');
+// Disable block-mode by default
+enableBlockMode(false);
+
// Init error handler
initErrorHandler();
initRequest();
// Set important header_sent
-$GLOBALS['header_sent'] = 0;
+if (!isset($GLOBALS['header_sent'])) $GLOBALS['header_sent'] = 0;
// Init fatal messages
initFatalMessages();
// Load configuration file(s) here
loadIncludeOnce('inc/load_config.php');
+ // Load database layer here
+ loadIncludeOnce('inc/db/lib.php');
+
// Check for write-permission for config.php and inc directory
if (!isModuleSet()) setModule(REQUEST_GET('module'));
if (!isModuleSet()) setModule('index');
// Update sending pool
if ((getOutputMode() != '1') && (getOutputMode() != '-1')) loadIncludeOnce('inc/pool-update.php'); // Sends out mails in configureable steps
- // Load all active extension including language files when not upgrading.
- // Check module for testing and count one click
- if (checkModulePermissions(getModule()) == 'done') countModuleHit(getModule());
+ // Check module for permissions
+ $checkModule = checkModulePermissions(getModule());
+ if ($checkModule != 'done') {
+ // Not fine!
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Check of module %s results in unpexted value: %s",
+ getModule(),
+ $checkModule
+ ));
+ } // END - if
// Shall we activate the exchange?
if (getConfig('activate_xchange') > 0) activateExchange();
// Is the extension sql_patches installed and at least 0.3.6?
if (GET_EXT_VERSION('sql_patches') >= '0.3.6') {
// Generate random number
- define('RAND_NUMBER', generateRandomCode(10, mt_rand(10000,32766), getUserId(), ''));
+ setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getUserId(), ''));
} else {
// Generate weak (!!!) code
- define('RAND_NUMBER', mt_rand(1000000, 9999999));
+ setConfigEntry('RAND_NUMBER', mt_rand(1000000, 9999999));
}
} else {
// Wrong database?