destroy the session-cache on login/logout

This commit is contained in:
Ralf Becker 2005-11-28 12:47:35 +00:00
parent 6fa4221c46
commit 46adb5d50b

View File

@ -34,7 +34,9 @@
/* Make sure the header.inc.php is current. */ /* Make sure the header.inc.php is current. */
if (!isset($GLOBALS['egw_domain']) || $GLOBALS['egw_info']['server']['versions']['header'] < $GLOBALS['egw_info']['server']['versions']['current_header']) if (!isset($GLOBALS['egw_domain']) || $GLOBALS['egw_info']['server']['versions']['header'] < $GLOBALS['egw_info']['server']['versions']['current_header'])
{ {
echo '<center><b>You need to port your settings to the new header.inc.php version by running <a href="setup/manageheader.php">setup/headeradmin</a>.</b></center>'; echo '<center><b>You need to update your header.inc.php file to version '.
$GLOBALS['egw_info']['server']['versions']['current_header'].
' by running <a href="setup/manageheader.php">setup/headeradmin</a>.</b></center>';
exit; exit;
} }
@ -46,12 +48,13 @@
} }
// check if we can restore the eGW enviroment from the php-session // check if we can restore the eGW enviroment from the php-session
if ($GLOBALS['egw_info']['server']['sessions_type'] == 'php4-restore' && $_REQUEST['sessionid'] && if ($GLOBALS['egw_info']['server']['sessions_type'] == 'php4-restore' && $_REQUEST['sessionid'])
$GLOBALS['egw_info']['flags']['currentapp'] != 'login' && $GLOBALS['egw_info']['flags']['currentapp'] != 'logout')
{ {
session_name('sessionid'); session_name('sessionid');
session_start(); session_start();
if ($GLOBALS['egw_info']['flags']['currentapp'] != 'login' && $GLOBALS['egw_info']['flags']['currentapp'] != 'logout')
{
if (is_array($_SESSION['egw_info_cache']) && is_array($_SESSION['egw_included_files']) && $_SESSION['egw_object_cache']) if (is_array($_SESSION['egw_info_cache']) && is_array($_SESSION['egw_included_files']) && $_SESSION['egw_object_cache'])
{ {
// marking the context as restored from the session, used by session->verify to not read the date from the db again // marking the context as restored from the session, used by session->verify to not read the date from the db again
@ -79,6 +82,13 @@
} }
//echo "<p>could not restore egw_info and the egw-object!!!</p>\n"; //echo "<p>could not restore egw_info and the egw-object!!!</p>\n";
} }
else // destroy the session-cache if called by login or logout
{
unset($_SESSION['egw_info_cache']);
unset($_SESSION['egw_included_files']);
unset($_SESSION['egw_object_cache']);
}
}
include(EGW_API_INC.'/common_functions.inc.php'); include(EGW_API_INC.'/common_functions.inc.php');
print_debug('sane environment','messageonly','api'); print_debug('sane environment','messageonly','api');
@ -107,7 +117,6 @@
{ {
$GLOBALS['egw_info']['user']['domain'] = get_var('domain',array('GET','COOKIE'),false); $GLOBALS['egw_info']['user']['domain'] = get_var('domain',array('GET','COOKIE'),false);
} }
if (@isset($GLOBALS['egw_domain'][$GLOBALS['egw_info']['user']['domain']])) if (@isset($GLOBALS['egw_domain'][$GLOBALS['egw_info']['user']['domain']]))
{ {
$GLOBALS['egw_info']['server']['db_host'] = $GLOBALS['egw_domain'][$GLOBALS['egw_info']['user']['domain']]['db_host']; $GLOBALS['egw_info']['server']['db_host'] = $GLOBALS['egw_domain'][$GLOBALS['egw_info']['user']['domain']]['db_host'];