//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
if ($logout) {
// Then redirect to logout
- LOAD_URL("modules.php?module=admin&logout=1&".$EXT_LOAD_MODE."=sql_patches");
+ LOAD_URL("modules.php?module=admin&logout=1&".$EXT_LOAD_MODE."=sql_patches");
} else {
// Add temporary filter
REGISTER_FILTER('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true);
if (($ext_name == "sql_patches") && (($load_mode == "register") || ($load_mode == "remove"))) {
// Then redirect to logout
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
- LOAD_URL("modules.php?module=admin&logout=1&".$load_mode."=sql_patches");
+ LOAD_URL("modules.php?module=admin&logout=1&".$load_mode."=sql_patches");
} // END - if
}
incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
+ array($mod), __FILE__, __LINE__);
list($name) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
}
if (EXT_IS_ACTIVE($modSplit[0])) {
// The prefix is an extension's name, so let's set it
$extension = $modSplit[0]; $mod = $modSplit[1];
- }
- }
+ } // END - if
+ } // END - if
// Major error in module registry is the default
$ret = "major";
// Check if script is installed if not return a "done" to prevent some errors
- if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
+ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+ // Not installed or no admin registered or in installation phase
+ return "done";
+ } // END - if
+
+ // Init variables
+ $locked = "Y";
+ $hidden = "N";
+ $admin = "N";
+ $mem = "N";
+ $found = false;
// Check if cache is latest version
- $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
if (GET_EXT_VERSION("cache") >= "0.1.2") {
// Is the module cached?
if (isset($GLOBALS['cache_array']['modules']['locked'][$mod_chk])) {
}
} elseif (!EXT_IS_ACTIVE("cache")) {
// Check for module in database
- $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod_chk), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
+ array($mod_chk), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Read data
list($locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
} elseif (($admin == "Y") && (!IS_ADMIN())) {
// Only the Admin is allowed to enter this module!
$ret = "admin_only";
+ } else {
+ // @TODO Nothing helped???
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("ret=%s,locked=%s,admin=%s,mem=%s",
+ $ret,
+ $locked,
+ $admin,
+ $mem
+ ));
}
} // END - if
// Still no luck or not found?
if (($ret == "cache_miss") || (!$found)) {
- // ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
+ // ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
// Data is missing so we add it
if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {