Fixes for missing secret file
[mailer.git] / inc / extensions / ext-sql_patches.php
index 8854323..2efdb59 100644 (file)
@@ -636,7 +636,7 @@ default: // Do stuff when extension is loaded
                        // Maybe need setup of secret key!
                        require_once(PATH."inc/gen_sql_patches.php");
 
-                       if (GET_EXT_VERSION("cache") >= "0.1.2") {
+                       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (is_object($cacheInstance))) {
                                // Remove extensions and mod_reg cache file
                                require_once(PATH."inc/libs/cache_functions.php");
                                require_once(PATH."inc/extensions/ext-cache.php");
@@ -653,8 +653,11 @@ default: // Do stuff when extension is loaded
                                // Read file
                                $_CONFIG['secret_key'] = implode("", file($hashFile));
                        } else {
+                               // Remove it from database
+                               UPDATE_CONFIG("file_hash", "");
+
                                // Cannot read secret file!
-                               mxchange_die("Cannot read secret file!");
+                               mxchange_die("Cannot read secret file! Please try to reload");
                        }
                } // END - if