From ed1760b4812684de57aa109c2b03f16a33476878 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sun, 23 Mar 2008 12:13:06 +0000 Subject: [PATCH] factorized user reset (and comm array clean added) --- web/Obj/brisk.phh | 2 +- web/index_rd.php | 9 +++++++-- web/index_wr.php | 8 +++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index e3dd54b..62b7cb1 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -62,7 +62,7 @@ define(BRISK_SINGLE_SESS, ""); $G_false = FALSE; $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 ); -$G_brisk_version = "spawn-0.10.4"; +$G_brisk_version = "spawn-0.10.5"; $root_wellarr = Array ( 'Benvenuto in brisk (Ver. '.$G_brisk_version.'), NOVITA\': dimensionamento dinamico dell\'area dati e ottimizzazione della stessa, versione beta2.', 'Se vuoi iscriverti alla Mailing List, cliccala!' ); diff --git a/web/index_rd.php b/web/index_rd.php index 288415c..cc30e3e 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -248,13 +248,18 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if ($user->the_end == TRUE) { log_rd2("LOGOUT BYE BYE!!"); log_auth($user->sess, "Explicit logout."); + + $user->reset(); + /* factorized with ->reset() $tmp_sess = $user->sess; $user->sess = ""; step_unproxy($tmp_sess); - $user->name = ""; + while (array_pop($user->comm) != NULL); + $user->step = 0; $user->the_end = FALSE; - + */ + if ($user->subst == 'sitdown') { log_load("ROOM WAKEUP"); $room->room_wakeup(&$user); diff --git a/web/index_wr.php b/web/index_wr.php index ea364cd..d7ccac2 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -57,12 +57,18 @@ log_wr('POSTSPLIT: '.$argz[0]); if ($argz[0] == 'shutdown') { log_auth($user->sess, "Shutdown session."); + + $user->reset(); + /* factorized with ->reset() $tmp_sess = $user->sess; $user->sess = ""; step_unproxy($tmp_sess); $user->name = ""; + while (array_pop($user->comm) != NULL); + $user->step = 0; $user->the_end = FALSE; - + */ + log_rd2("AUTO LOGOUT."); if ($user->subst == 'sitdown' || $user->stat == 'table') $room->room_wakeup(&$user); -- 2.17.1