summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2010-02-04 20:19:18 -0800
committerArun Persaud <arun@nubati.net>2010-02-04 20:26:51 -0800
commit3851854ad07430dc62337d482e811bf9363480a5 (patch)
treec0f57cf38dbb8a77be8126416acd09100181fe8d
parente2d7a3291f85403b4faf6f8be7e30caeefb0c1a3 (diff)
downloade-DoKo-3851854ad07430dc62337d482e811bf9363480a5.tar.gz
e-DoKo-3851854ad07430dc62337d482e811bf9363480a5.tar.bz2
e-DoKo-3851854ad07430dc62337d482e811bf9363480a5.zip
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.
-rw-r--r--include/game.php14
1 files changed, 10 insertions, 4 deletions
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':