From ba639e20eb85a5bbe1c84e2308a166eae10b2e0a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 3 Feb 2007 12:48:36 +0000 Subject: [PATCH] make sure the session table is empty after conversion and the current session being killed. This makes sure the user converting does not inherit wrong user settings becuase the 3.0.x users table being completely new. git-svn-id: file:///svn/phpbb/trunk@6964 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_convert.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index c8f50a6f21..9a5177c941 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -191,7 +191,28 @@ class install_convert extends module 'TITLE' => $lang['CONVERT_COMPLETE'], 'BODY' => $lang['CONVERT_COMPLETE_EXPLAIN'], )); - + + // If we reached this step (conversion completed) we want to purge the cache and log the user out. + // This is for making sure the session get not screwed due to the 3.0.x users table being completely new. + $cache->purge(); + + // Make sure this session gets killed + $user->session_kill(); + + switch ($db->sql_layer) + { + case 'sqlite': + case 'firebird': + $db->sql_query('DELETE FROM ' . SESSIONS_KEYS_TABLE); + $db->sql_query('DELETE FROM ' . SESSIONS_TABLE); + break; + + default: + $db->sql_query('TRUNCATE TABLE ' . SESSIONS_KEYS_TABLE); + $db->sql_query('TRUNCATE TABLE ' . SESSIONS_TABLE); + break; + } + break; } }