X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload-admins.php;h=18c65bd2ecbd4bf68c055b7296a66dc1ea766a7f;hb=15e0995f7a4a4b2c9b1b1a9273f785cf13605829;hp=c34f9585bed3616ce8d942263334b8de87321a47;hpb=8fad776382e63b3f73f8dbe289f229d79cfc2c22;p=mailer.git diff --git a/inc/loader/load-admins.php b/inc/loader/load-admins.php index c34f9585be..18c65bd2ec 100644 --- a/inc/loader/load-admins.php +++ b/inc/loader/load-admins.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -38,9 +38,10 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif (isInstallationPhase()) { - // Use this code if you don't want to run this cache loader on installation phase - return; +} elseif (isInstaller()) { + // Do not run in installation phase + //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Run from installation phase.'); + return FALSE; } // Let's start with the admins table... @@ -81,7 +82,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('admin')) && ($GLOBALS['cache_ins $GLOBALS['cache_instance']->removeCacheFile(); unset($GLOBALS['cache_array']['admin']); } -} elseif (isHtmlOutputMode()) { +} elseif ((isHtmlOutputMode()) || (isAjaxOutputMode()) || (isRawOutputMode())) { // Create cache file $GLOBALS['cache_instance']->init(); @@ -89,7 +90,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('admin')) && ($GLOBALS['cache_ins $add = runFilterChain('sql_admin_extra_data'); // Query the database about this - $result = SQL_QUERY('SELECT + $result = sqlQuery('SELECT `id` AS `admin_id`, `login`, `password`, @@ -99,13 +100,13 @@ FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `login` ASC', __FILE__, __LINE__); - while ($row = SQL_FETCHARRAY($result)) { + while ($row = sqlFetchArray($result)) { // Save row $GLOBALS['cache_instance']->addRow($row); } // END - while // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Close cache $GLOBALS['cache_instance']->storeExtensionVersion('admins'); @@ -152,21 +153,21 @@ if (isExtensionInstalledAndNewer('admins', '0.3')) { // This may drive a lot messages to the logfile //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'No entry found in admin_acls to rewrite.'); } - } elseif (isHtmlOutputMode()) { + } elseif ((isHtmlOutputMode()) || (isAjaxOutputMode()) || (isRawOutputMode())) { // Create cache file here $GLOBALS['cache_instance']->init(); // Load all admins and their data - $result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC,`action_menu` ASC,`what_menu` ASC', __FILE__, __LINE__); + $result = sqlQuery('SELECT * FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC,`action_menu` ASC,`what_menu` ASC', __FILE__, __LINE__); // Add all rows - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Add row to cache file $GLOBALS['cache_instance']->addRow($content); } // END - while // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Close cache $GLOBALS['cache_instance']->storeExtensionVersion('admins');