- // Free memory
- SQL_FREERESULT($result);
-
- // Generate random number
- if (isset($GLOBALS['userid'])) {
- define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), $GLOBALS['userid'], ""));
+ // Run the init filter chain
+ runFilterChain('init');
+
+ // Set default 'what' value
+ //* DEBUG: */ OUTPUT_HTML('-'.getModule().'/'.getWhat()."-<br />");
+ if ((!isWhatSet()) && (!isActionSet()) && (getOutputMode() != 1) && (getOutputMode() != -1)) {
+ if (getModule() == 'admin') {
+ // Set 'action' value to 'login' in admin menu
+ setAction(getModeAction(getModule(), getWhat()));
+ } elseif ((getModule() == 'index') || (getModule() == 'login')) {
+ // Set 'what' value to 'welcome' in guest and member menu
+ setWhat('welcome');
+ if (getConfig('index_home') != '') setWhatFromConfig('index_home');
+ } else {
+ // Anything else like begging link
+ setWhat('');
+ }
+ } // END - if
+
+ // Update sending pool
+ if ((getOutputMode() != '1') && (getOutputMode() != '-1')) loadIncludeOnce('inc/pool-update.php'); // Sends out mails in configureable steps
+
+ // 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(), ''));