X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=d41930089f6bdf7d40a73bd10073d351fbbc64bf;hb=2c46da5e9d74e87def9ce4db377f26920eb30b28;hp=0583c16dfa297fa40f8b27d8c7b0adcca0bfee66;hpb=b2325fabc64328d53eb19deec62ec078446c0a12;p=mailer.git diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 0583c16dfa..d41930089f 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Alle datenbank-relevanten Funktionen * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -227,7 +222,7 @@ ORDER BY array($mode), __FUNCTION__, __LINE__); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat()); - if (!ifSqlHasZeroNums($result_main)) { + if (!ifSqlHasZeroNumRows($result_main)) { // There are menus available, so we simply display them... :) $GLOBALS['rows'] = ''; while ($content = sqlFetchArray($result_main)) { @@ -259,7 +254,7 @@ ORDER BY ), __FUNCTION__, __LINE__); // Are there some entries? - if (!ifSqlHasZeroNums($result_sub)) { + if (!ifSqlHasZeroNumRows($result_sub)) { // Init counter $count = '0'; @@ -273,7 +268,7 @@ ORDER BY // Full file name for checking menu //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sub_what=' . $content['sub_what']); - $inc = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']); + $inc = sprintf('inc/modules/%s/what-%s.php', $mode, $content['sub_what']); if (isIncludeReadable($inc)) { // Mark currently selected menu - open if ((!empty($what)) && (($what == $content['sub_what']))) { @@ -331,7 +326,7 @@ ORDER BY enableBlockMode(); // Load menu block - $INC = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']); + $INC = sprintf('inc/modules/%s/action-%s.php', $mode, $content['action']); if (isFileReadable($INC)) { // Load include file if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', TRUE, $mode); @@ -572,16 +567,20 @@ function fetchUserData ($value, $column = 'userid') { * login. */ function isAdmin () { + //* DIE: */ reportBug(__FUNCTION__, __LINE__, 'CALLED!'); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CALLED!'); + // Is there cache? if (isset($GLOBALS[__FUNCTION__])) { // Return it - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__])); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__]) . ' - CACHED!'); return $GLOBALS[__FUNCTION__]; } // END - if - // No admin in installation phase! if ((isInstaller()) || (!isAdminRegistered())) { + // No admin in installation phase! $GLOBALS[__FUNCTION__] = FALSE; + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__]) . ' - INSTALLER!'); return FALSE; } // END - if @@ -589,15 +588,18 @@ function isAdmin () { $ret = FALSE; $adminId = '0'; $passwordFromCookie = ''; - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminId); // If admin login is not given take current from cookies... + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isSessionVariableSet(admin_id)=' . intval(isSessionVariableSet('admin_id')) . ',isSessionVariableSet(admin_md5)=' . intval(isSessionVariableSet('admin_md5'))); if ((isSessionVariableSet('admin_id')) && (isSessionVariableSet('admin_md5'))) { + // Debug message + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Getting admin data from session ...'); + // Get admin login and password from session/cookies $adminId = getCurrentAdminId(); $passwordFromCookie = getAdminMd5(); } // END - if - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminId=' . $adminId . ',passwordFromCookie=' . $passwordFromCookie); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminId=' . $adminId . ',passwordFromCookie=' . $passwordFromCookie); // Abort if admin id is zero if (($adminId == '0') || (empty($passwordFromCookie))) { @@ -615,26 +617,26 @@ function isAdmin () { // Search in array for entry if (isset($GLOBALS['admin_hash'])) { // Use cached string - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using admin_hash=' . $GLOBALS['admin_hash'] . ' from cache'); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using admin_hash=' . $GLOBALS['admin_hash'] . ' from cache'); } elseif ((!empty($adminId)) && (!empty($passwordFromCookie)) && (isAdminHashSet($adminId) === TRUE)) { // Get admin hash and hash it $GLOBALS['admin_hash'] = encodeHashForCookie(getAdminHash($adminId)); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valPass=' . $GLOBALS['admin_hash']); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valPass=' . $GLOBALS['admin_hash']); // Count cache hits incrementStatsEntry('cache_hits'); } elseif ((!empty($adminId)) && ((!isExtensionActive('cache')) || (isAdminHashSet($adminId) === FALSE))) { // Get admin hash and hash it $GLOBALS['admin_hash'] = encodeHashForCookie(getAdminHash($adminId)); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valPass=' . $GLOBALS['admin_hash']); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valPass=' . $GLOBALS['admin_hash']); } // Check if password is valid - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '(' . $GLOBALS['admin_hash'] . '==' . $passwordFromCookie . ')='.intval($GLOBALS['admin_hash'] == $passwordFromCookie)); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '(' . $GLOBALS['admin_hash'] . '==' . $passwordFromCookie . ')='.intval($GLOBALS['admin_hash'] == $passwordFromCookie)); $GLOBALS[__FUNCTION__] = ((!empty($GLOBALS['admin_hash'])) && ($GLOBALS['admin_hash'] == $passwordFromCookie)); // Return result of comparision - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__])); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__])); return $GLOBALS[__FUNCTION__]; } @@ -658,12 +660,12 @@ function addMaxReceiveList ($mode, $default = '') { break; default: // Invalid! - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid mode %s detected.", $mode)); + logDebugMessage(__FUNCTION__, __LINE__, sprintf('Invalid mode %s detected.', $mode)); break; } // Some entries are found? - if (!ifSqlHasZeroNums($result)) { + if (!ifSqlHasZeroNumRows($result)) { $OUT = ''; while ($content = sqlFetchArray($result)) { $OUT .= '