]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load-admins.php
www is out-dated
[mailer.git] / inc / loader / load-admins.php
index f769d6b98cfa4cd42a03e121d53393d36cb9d2d1..80f822a05eaef59eb905ecec350cfa63c7733ce0 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -90,14 +90,14 @@ if (($GLOBALS['cache_instance']->loadCacheFile('admin')) && ($GLOBALS['cache_ins
 
        // Query the database about this
        $result = SQL_QUERY('SELECT
-       `id` AS admin_id, `login`, `password`, `email`' . $add . '
+       `id` AS admin_id, `login`,`password`,`email`' . $add . '
 FROM
        `{?_MYSQL_PREFIX?}_admins`
 ORDER BY
        `login` ASC', __FILE__, __LINE__);
-       while ($dummy = SQL_FETCHARRAY($result)) {
+       while ($row = SQL_FETCHARRAY($result)) {
                // Save row
-               $GLOBALS['cache_instance']->addRow($dummy);
+               $GLOBALS['cache_instance']->addRow($row);
        } // END - while
 
        // Free memory
@@ -140,17 +140,20 @@ if (isExtensionInstalledAndNewer('admins', '0.3')) {
                                $GLOBALS['cache_instance']->removeCacheFile();
                                unset($GLOBALS['cache_array']['admin_acls']);
                        }
-               } else {
+               } elseif (count($GLOBALS['cache_array']['admin_acls']) > 0) {
                        // Nope, cache file is corrupted!
                        $GLOBALS['cache_instance']->removeCacheFile();
                        unset($GLOBALS['cache_array']['admin_acls']);
+               } elseif (isDebugModeEnabled()) {
+                       // This may drive a lot messages to the logfile
+                       //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'No entry found in admin_acls to rewrite.');
                }
        } elseif (isHtmlOutputMode()) {
                // Create cache file here
                $GLOBALS['cache_instance']->init();
 
-               // 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` ASC, `action_menu` ASC, `what_menu` ASC', __FILE__, __LINE__);
+               // 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__);
 
                // Add all rows
                while ($content = SQL_FETCHARRAY($result)) {