From 1c878f804eeafc5f73ad84953506f0506e1f9fa6 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 11 Sep 2014 22:06:42 +0200 Subject: [PATCH] Commented out noisy debug lines (maybe another branch is needed for debug-only). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/libs/wernis_functions.php | 5 +++-- inc/modules/admin/admin-inc.php | 6 +++--- inc/mysql-manager.php | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 922cb56ff8..74bba7142c 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -219,8 +219,8 @@ function doAdminTestWernisApi () { // Prepare the request data $requestData = array( - 't_uid' => getWernisRefid(), - 't_md5' => getWernisPassMd5() + 't_uid' => getWernisRefid(), + 't_md5' => getWernisPassMd5() ); // Return the result from the lower functions @@ -268,6 +268,7 @@ function executeWernisApiWithdraw ($wdsId, $userMd5, $amount) { // Return the result from the lower functions $return = sendWernisApiRequest('book.php', $requestData); + // Did it went smoothly? if (isHttpResponseStatusOkay($return)) { // All fine! $result = TRUE; diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index d7e17155c6..c63c3c4f40 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -135,7 +135,7 @@ function ifAdminLoginDataIsValid ($adminLogin, $adminPassword) { // Only be executed on cookie checking function ifAdminCookiesAreValid ($adminLogin, $passHash) { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLogin=' . $adminLogin . ',passHash=' . $passHash . ' - CALLED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLogin=' . $adminLogin . ',passHash=' . $passHash . ' - CALLED!'); // First of all, no admin login is found $ret = '404'; @@ -147,7 +147,7 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) { if ($adminHash != '-1') { // Now, we need to encode the password in the same way the one is encoded in database $testHash = encodeHashForCookie($adminHash); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLogin=' . $adminLogin . ',passHash='.$passHash.',adminHash='.$adminHash.',testHash='.$testHash); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLogin=' . $adminLogin . ',passHash='.$passHash.',adminHash='.$adminHash.',testHash='.$testHash); // If they both match, the login data is valid if ($testHash != $passHash) { @@ -163,7 +163,7 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) { } // END - if // Return status - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret=' . $ret . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret=' . $ret . ' - EXIT!'); return $ret; } diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index ccda58a7a7..382fb9b43b 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -568,12 +568,12 @@ function fetchUserData ($value, $column = 'userid') { */ function isAdmin () { //* DIE: */ reportBug(__FUNCTION__, __LINE__, 'CALLED!'); - /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CALLED!'); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CALLED!'); // Is there cache? if (isset($GLOBALS[__FUNCTION__])) { // Return it - /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__]) . ' - CACHED!'); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__]) . ' - CACHED!'); return $GLOBALS[__FUNCTION__]; } // END - if @@ -590,21 +590,21 @@ function isAdmin () { $passwordFromCookie = ''; // 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'))); + //* 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 ...'); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Getting admin data from session ...'); // Get admin login and password from session/cookies $adminId = getCurrentAdminId(); $passwordFromCookie = getAdminMd5(); } // END - if - /* NOISY-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))) { // A very noisy debug message ... - /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Current adminId is zero. isSessionVariableSet(admin_id)=' . intval(isSessionVariableSet('admin_id')) . ',isSessionVariableSet(admin_md5)=' . intval(isSessionVariableSet('admin_md5'))); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Current adminId is zero. isSessionVariableSet(admin_id)=' . intval(isSessionVariableSet('admin_id')) . ',isSessionVariableSet(admin_md5)=' . intval(isSessionVariableSet('admin_md5'))); // Abort here now $GLOBALS[__FUNCTION__] = FALSE; @@ -617,26 +617,26 @@ function isAdmin () { // Search in array for entry if (isset($GLOBALS['admin_hash'])) { // Use cached string - /* NOISY-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)); - /* NOISY-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)); - /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valPass=' . $GLOBALS['admin_hash']); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valPass=' . $GLOBALS['admin_hash']); } // Check if password is valid - /* NOISY-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 - /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__])); + //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isAdmin()=' . intval($GLOBALS[__FUNCTION__])); return $GLOBALS[__FUNCTION__]; } -- 2.39.5