www/adiumxtras.com 59:cb77e450f6d7: Trying to add some debug log...

commits at adium.im commits at adium.im
Fri Feb 27 13:16:41 UTC 2015


details:	http://hg.adium.im/www/adiumxtras.com/rev/cb77e450f6d7
revision:	59:cb77e450f6d7
branch:		adiumxtras.com
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Fri Feb 27 14:16:33 2015 +0100

Trying to add some debug logging.

diffs (30 lines):

diff -r 4f65eed337a0 -r cb77e450f6d7 include.php
--- a/include.php	Fri Feb 27 14:04:32 2015 +0100
+++ b/include.php	Fri Feb 27 14:16:33 2015 +0100
@@ -120,21 +120,24 @@
 }
 
 function currentUID() {
-	global $CACHE;
+	global $sql, $CACHE;
 	if (!isset($CACHE['currentUID'])) {
 		list ($user, $token, $mac) = explode(':', $_COOKIE['xtras_pass']);
 
 		if ($mac !== hash_hmac('sha256', $user . ':' . $token, COOKIE_SECRET_KEY)) {
+			error_log("Hash did not match");
 			return false;
 		}
 
 		if (base64_decode($user) !== $_COOKIE['xtras_user']) {
+			error_log("User did not match");
 			return false;
 		}
 
 		$sql->query("SELECT user_id FROM users WHERE username='%s' AND status='Active'", $_COOKIE['xtras_user']);
 
-		if ($sql->num_rows() == 0) {
+		if ($sql->num_rows() === 0) {
+			error_log("user_id not found");
 			return false;
 		} else {
 			$CACHE['currentUID'] = $sql->fetch_row_single();




More information about the commits mailing list