]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load-admins.php
Heacy rewrite/cleanup:
[mailer.git] / inc / loader / load-admins.php
index c34f9585bed3616ce8d942263334b8de87321a47..18c65bd2ecbd4bf68c055b7296a66dc1ea766a7f 100644 (file)
@@ -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 *
 // 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');