From: Arun Persaud Date: Fri, 5 Feb 2010 04:19:18 +0000 (-0800) Subject: BUGFIX: timestamp was not always updated when user made a move X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=3851854ad07430dc62337d482e811bf9363480a5 BUGFIX: timestamp was not always updated when user made a move this happend when the user wasn't logged in, but made a move by using an email link for example. Should be fixed now. --- diff --git a/include/game.php b/include/game.php index de19cab..0a40bab 100644 --- a/include/game.php +++ b/include/game.php @@ -24,10 +24,6 @@ if(!$myid) global $GAME,$RULES,$CARDS; -/* the user has done something, update the timestamp */ -if(isset($_SESSION['id'])) - DB_update_user_timestamp($_SESSION['id']); - /* get some information from the DB */ $gameid = DB_get_gameid_by_hash($me); $myname = DB_get_name('hash',$me); @@ -288,6 +284,16 @@ display_table(); * play: game in progress * gameover: are we revisiting a game */ + +/* the user has done something, update the timestamp. Use $myid in + * active games and check for session-id in old games (myid might be wrong in that case) + */ +if($mystatus!='gameover') + DB_update_user_timestamp($myid); + else + if(isset($_SESSION['id'])) + DB_update_user_timestamp($_SESSION['id']); + switch($mystatus) { case 'start':