More rewrites of constants and fix for loading mass-included scripts by GET_DIR_AS_AR...
[mailer.git] / inc / mysql-manager.php
index 6b244371c278f309b049efa4f6221b62aade5e79..f1a90a82bde87f14eb7279694520284d0d2d515f 100644 (file)
@@ -44,7 +44,7 @@ function ADD_MODULE_TITLE ($mod) {
        $result = false;
 
        // Is the script installed?
-       if (isBooleanConstantAndTrue('mxchange_installed')) {
+       if (isInstalled()) {
                // Check if cache is valid
                if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($mod, $GLOBALS['cache_array']['modules']['module']))) {
                        // Load from cache
@@ -100,7 +100,7 @@ function CHECK_MODULE ($mod) {
        $ret = "major";
 
        // Check if script is installed if not return a "done" to prevent some errors
-       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isInstalling()) || (!isBooleanConstantAndTrue('admin_registered'))) {
+       if ((!isInstalled()) || (isInstalling()) || (!isAdminRegistered())) {
                // Not installed or no admin registered or in installation phase
                return "done";
        } // END - if
@@ -916,8 +916,12 @@ function GET_ACTION ($MODE, &$wht) {
                // Free memory
                SQL_FREERESULT($result);
        } elseif ((GET_EXT_VERSION("sql_patches") == "") && ($MODE != "admin")) {
-               // No sql_patches installed!
-               LOAD_URL("admin.php");
+               // No sql_patches installed, but maybe we need to register an admin?
+               if (isAdminRegistered()) {
+                       // Redirect
+                       // @TODO Why does this lead into an endless loop but we still need it???
+                       LOAD_URL("admin.php");
+               } // END - if
        }
 
        // Return action value