Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / admin / admin-inc.php
index 4a94e8f9b9fee1f1f7017f03b55e353995a7531f..6eee1eddf6e93996b89532899bfbb5c77fb54678 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -53,7 +53,7 @@ function addAdminAccount ($adminLogin, $passHash, $adminEmail, $accessLevel = 'd
                array($adminLogin), __FUNCTION__, __LINE__);
 
        // Is the entry there?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Is ext-admins installed and version at least 0.3.0?
                if (isExtensionInstalledAndNewer('admins', '0.3.0')) {
                        // Ok, let's create the admin login
@@ -135,6 +135,8 @@ function ifAdminLoginDataIsValid ($adminLogin, $adminPassword) {
 
 // Only be executed on cookie checking
 function ifAdminCookiesAreValid ($adminLogin, $passHash) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLogin=' . $adminLogin . ',passHash=' . $passHash . ' - CALLED!');
+
        // First of all, no admin login is found
        $ret = '404';
 
@@ -161,7 +163,7 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) {
        } // END - if
 
        // Return status
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret='.$ret);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret=' . $ret . ' - EXIT!');
        return $ret;
 }
 
@@ -280,7 +282,7 @@ ORDER BY
        `id` DESC", __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                $OUT .= '<ul class="admin_menu_main">';
 
                // Load all 'action' menus
@@ -363,7 +365,7 @@ ORDER BY
                array($mainContent['main_action']), __FUNCTION__, __LINE__);
 
        // Remember the count for later checks
-       setAdminMenuHasEntries($mainContent['main_action'], ((!ifSqlHasZeroNums($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
+       setAdminMenuHasEntries($mainContent['main_action'], ((!ifSqlHasZeroNumRows($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
 
        // Start li-tag for sub menu content
        $OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '"' . addStyleMenuContent('admin', $mainContent['main_action'], $action) . '>';
@@ -374,7 +376,7 @@ ORDER BY
                $SUB = TRUE;
 
                // Are there entries?
-               if (!ifSqlHasZeroNums($result_what)) {
+               if (!ifSqlHasZeroNumRows($result_what)) {
                        // Start HTML code
                        $OUT .= '<ul class="admin_menu_sub">';
 
@@ -541,7 +543,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
 
        $result = sqlQueryEscaped("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load menu as selection
                $OUT = '<select name="' . $mode . '_menu';
                if (!isValidId($defid)) $OUT .= '[' . intval($defid) . ']';
@@ -1150,7 +1152,7 @@ function sendAdminPasswordResetLink ($email) {
                array($email), __FUNCTION__, __LINE__);
 
        // Is there an account?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // No account found
                return '{--ADMIN_NO_LOGIN_WITH_EMAIL--}';
        } // END - if