]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load_cache-admin.php
Previous fix fixed, a lot constants rewritten (unfinished)
[mailer.git] / inc / loader / load_cache-admin.php
index 336732ba9aabe3f213eadda4a5da50cb9f5d7efe..5f240f552632a7ca7b4d2065ec024cba0657c0f9 100644 (file)
@@ -37,6 +37,9 @@ if (!defined('__SECURITY')) {
        require($INC);
 } // END - if
 
+// Make cacheInstance global
+global $cacheInstance;
+
 // Let's start with the admins table...
 if (($cacheInstance->loadCacheFile("admins")) && ($cacheInstance->extensionVersionMatches("admins"))) {
        // Load cache
@@ -80,20 +83,17 @@ if (($cacheInstance->loadCacheFile("admins")) && ($cacheInstance->extensionVersi
                $cacheInstance->destroyCacheFile();
                unset($cacheArray['admins']);
        }
-} elseif (($_CONFIG['cache_admins'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_admins') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
        // Create cache file
        $cacheInstance->init("ADMINS");
        $cacheInstance->storeExtensionVersion("admins");
 
        // Load every data from DB to cache file
-       $ADD = ", id, id";
-       if (GET_EXT_VERSION("admins") >= "0.3")   $ADD  = ", default_acl AS def_acl";
-       if (GET_EXT_VERSION("admins") >= "0.6.7") $ADD .= ", la_mode";
-       if (GET_EXT_VERSION("admins") >= "0.7.0") $ADD .= ", login_failtures, UNIX_TIMESTAMP(last_failture) AS last_failture";
+       $ADD = RUN_FILTER('sql_admin_extra_data');
 
        // Query the database about this
        $result_admins = SQL_QUERY("SELECT id AS aid, login, password, email".$ADD."
-FROM "._MYSQL_PREFIX."_admins
+FROM `{!_MYSQL_PREFIX!}_admins`
 ORDER BY login", __FILE__, __LINE__);
        while($dummy = SQL_FETCHARRAY($result_admins)) {
                // Save row
@@ -117,13 +117,13 @@ if (GET_EXT_VERSION("admins") >= "0.3") {
                // Load referal system from cache
                global $cacheArray;
                $cacheArray['admin_acls'] = $cacheInstance->getArrayFromCache();
-       } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       } elseif ((getConfig('cache_acls') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
                // Create cache file here
                $cacheInstance->init("ADMINS_ACLS");
                $cacheInstance->storeExtensionVersion("admins");
 
                // Load all modules and their data
-               $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
+               $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
 
                // Add all rows
                while ($data = SQL_FETCHARRAY($result)) {