- case 'modify': // When the extension got modified
- break;
-
- case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
- break;
-
- default: // Do stuff when extension is loaded
- // When the sql_patches is not installed we cannot load it's configuration... *sigh*
- if (GET_EXT_VERSION('sql_patches') != '') {
- // Init key
- setConfigEntry('secret_key', '');
-
- // Read key from secret file
- if ((getConfig('file_hash') == '') || (getConfig('master_salt') == '') || (getConfig('pass_scramble') == '')) {
- // Cache instance
- // Maybe need setup of secret key!
- loadIncludeOnce('inc/gen_sql_patches.php');
-
- // @TODO Rewrite this to a filter!
- if ((GET_EXT_VERSION('cache') >= '0.1.2') && (isCacheInstanceValid())) {
- // Remove extensions and mod_reg cache file
- loadIncludeOnce('inc/libs/cache_functions.php');
- require(sprintf("%sinc/extensions/ext-cache.php", constant('PATH')));
- if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
- if ($GLOBALS['cache_instance']->loadCacheFile("modreg")) $GLOBALS['cache_instance']->destroyCacheFile();
- } // END - if
- } // END - if
-
- // Test again
- if ((getConfig('file_hash') != '') && (getConfig('master_salt') != '') && (getConfig('pass_scramble') != '')) {
- // File hash fas generated so we can also file the secret file... hopefully.
- $hashFile = sprintf("%sinc/.secret/.%s", constant('PATH'), getConfig('file_hash'));
- if (isFileReadable($hashFile)) {
- // Read file
- setConfigEntry('secret_key', readFromFile($hashFile));
- } else {
- // Remove it from database
- updateConfiguration('file_hash', '');
-
- // Cannot read secret file!
- app_die(__FILE__, __LINE__, "Cannot read secret file! Please try to reload");
- }
- } // END - if
-
- // Transfer words/numbers to constants
- define('POINTS' , getConfig('points_word'));
- define('MT_WORD' , getConfig('mt_word'));
- define('MT_WORD2', getConfig('mt_word2'));
- define('MT_WORD3', getConfig('mt_word3'));
- define('_MAX' , getConfig('rand_no'));
+ default: // Do stuff when extension is loaded
+ // When the sql_patches is not installed we cannot load it's configuration... *sigh*
+ if (GET_EXT_VERSION('sql_patches') != '') {
+ // Init key
+ setConfigEntry('secret_key', '');
+
+ // Read key from secret file
+ if ((getConfig('file_hash') == '') || (getConfig('master_salt') == '') || (getConfig('pass_scramble') == '')) {
+ // Cache instance
+ // Maybe need setup of secret key!
+ loadIncludeOnce('inc/gen_sql_patches.php');
+
+ // @TODO Rewrite this to a filter!
+ if ((GET_EXT_VERSION('cache') >= '0.1.2') && (isCacheInstanceValid())) {
+ // Remove extensions and mod_reg cache file
+ loadIncludeOnce('inc/libs/cache_functions.php');
+ require(sprintf("%sinc/extensions/ext-cache.php", constant('PATH')));
+ if ($GLOBALS['cache_instance']->loadCacheFile('extensions', true)) $GLOBALS['cache_instance']->destroyCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('modreg')) $GLOBALS['cache_instance']->destroyCacheFile();
+ } // END - if
+ } // END - if
+
+ // Test again
+ if ((getConfig('file_hash') != '') && (getConfig('master_salt') != '') && (getConfig('pass_scramble') != '')) {
+ // File hash fas generated so we can also file the secret file... hopefully.
+ $hashFile = sprintf("%sinc/.secret/.%s", constant('PATH'), getConfig('file_hash'));
+ if (isFileReadable($hashFile)) {
+ // Read file
+ setConfigEntry('secret_key', readFromFile($hashFile));