X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload_cache-admin.php;h=11d80fe5118e3fcb59c2df467d4a561e719f8b5b;hb=d1637dad0b2ca0e5fb411ee0843f01bfb4cc94e0;hp=eb4de0475df0a4f9de57791b46952f5a57c041f1;hpb=d016e24dd4686f613a17733b96bc28fac936a4ac;p=mailer.git diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index eb4de0475d..11d80fe511 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Mehr Cache-Dateien nachladen * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -33,12 +38,12 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); } // END - if // Let's start with the admins table... -if (($GLOBALS['cache_instance']->loadCacheFile("admins")) && ($GLOBALS['cache_instance']->extensionVersionMatches("admins"))) { +if (($GLOBALS['cache_instance']->loadCacheFile('admins')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) { // Load cache $GLOBALS['cache_array']['admins'] = $GLOBALS['cache_instance']->getArrayFromCache(); @@ -54,7 +59,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile("admins")) && ($GLOBALS['cache_in // Rewrite all entries foreach ($GLOBALS['cache_array']['admins'] as $key=>$entryArray) { // Rewrite the entry - if ($key == "aid") { + if ($key == 'aid') { // Rewrite admin id (use login name as index) $GLOBALS['cache_array']['admins']['aid'][$GLOBALS['cache_array']['admins']['login'][$idx]] = $entryArray[$idx]; } else { @@ -79,19 +84,19 @@ if (($GLOBALS['cache_instance']->loadCacheFile("admins")) && ($GLOBALS['cache_in $GLOBALS['cache_instance']->destroyCacheFile(); unset($GLOBALS['cache_array']['admins']); } -} elseif ((getConfig('cache_admins') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) { +} elseif ((getConfig('cache_admins') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file - $GLOBALS['cache_instance']->init("ADMINS"); - $GLOBALS['cache_instance']->storeExtensionVersion("admins"); + $GLOBALS['cache_instance']->init('ADMINS'); + $GLOBALS['cache_instance']->storeExtensionVersion('admins'); // Load every data from DB to cache file - $ADD = RUN_FILTER('sql_admin_extra_data'); + $add = runFilterChain('sql_admin_extra_data'); // Query the database about this - $result_admins = SQL_QUERY("SELECT id AS aid, login, password, email".$ADD." + $result_admins = SQL_QUERY('SELECT id AS aid, login, password, email'.$add.' FROM `{!_MYSQL_PREFIX!}_admins` -ORDER BY login", __FILE__, __LINE__); - while($dummy = SQL_FETCHARRAY($result_admins)) { +ORDER BY login', __FILE__, __LINE__); + while ($dummy = SQL_FETCHARRAY($result_admins)) { // Save row $GLOBALS['cache_instance']->addRow($dummy); } // END - while @@ -102,23 +107,23 @@ ORDER BY login", __FILE__, __LINE__); // Close cache $GLOBALS['cache_instance']->finalize(); - // Reload the cache - LOAD_INC(__FILE__); + // Include loader again + require(__FILE__); } // Next cached table are the admins_acls... -if (GET_EXT_VERSION("admins") >= "0.3") { +if (GET_EXT_VERSION('admins') >= '0.3') { // Check for cache file - if (($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) && ($GLOBALS['cache_instance']->extensionVersionMatches("admins"))) { + if (($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) { // Load referal system from cache $GLOBALS['cache_array']['admin_acls'] = $GLOBALS['cache_instance']->getArrayFromCache(); - } elseif ((getConfig('cache_acls') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) { + } elseif ((getConfig('cache_acls') == 'Y') && (getOutputMode() != '1') && (getOutputMode() != '-1')) { // Create cache file here - $GLOBALS['cache_instance']->init("ADMINS_ACLS"); - $GLOBALS['cache_instance']->storeExtensionVersion("admins"); + $GLOBALS['cache_instance']->init('ADMINS_ACLS'); + $GLOBALS['cache_instance']->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__); + // Load all modules and their data (column 'id' is no longer required) + $result = SQL_QUERY('SELECT 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)) { @@ -132,8 +137,8 @@ if (GET_EXT_VERSION("admins") >= "0.3") { // Close cache $GLOBALS['cache_instance']->finalize(); - // Reload the cache - LOAD_INC(__FILE__); + // Include loader again + require(__FILE__); } } // END - if