From 54e479c408eadb7e1038a1855be17b7537c2b571 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 7 Apr 2007 09:44:39 +0000 Subject: [PATCH] "get WebDAV working again after the last change in the session class: we can NOT clean the whole egw_info/server array, as this also cleans the variables set in the header, which get not re-read --> we need to keep the important values: sessions_type and default_domain" --- phpgwapi/inc/class.sessions.inc.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index 121ab49e1c..400d8128ee 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -557,12 +557,20 @@ $now = time(); /* This is to ensure that we authenticate to the correct domain (might not be default) */ - if($this->account_domain != $GLOBALS['egw_info']['user']['domain']) + // if no domain is given we use the default domain, so we dont need to re-create everything + if (!$GLOBALS['egw_info']['user']['domain'] && $this->account_domain == $GLOBALS['egw_info']['server']['default_domain']) + { + $GLOBALS['egw_info']['user']['domain'] = $this->account_domain; + } + elseif($this->account_domain != $GLOBALS['egw_info']['user']['domain']) { $GLOBALS['egw']->ADOdb = null; $GLOBALS['egw_info']['user']['domain'] = $this->account_domain; - // reset the db all other phpgwapi data - $GLOBALS['egw_info']['server'] = array(); + // reset the db and all other (non-header!) egw_info/server data + $GLOBALS['egw_info']['server'] = array( + 'sessions_type' => $GLOBALS['egw_info']['server']['sessions_type'], + 'default_domain' => $GLOBALS['egw_info']['server']['default_domain'], + ); $GLOBALS['egw_info']['server']['db_host'] = $GLOBALS['egw_domain'][$this->account_domain]['db_host']; $GLOBALS['egw_info']['server']['db_port'] = $GLOBALS['egw_domain'][$this->account_domain]['db_port']; $GLOBALS['egw_info']['server']['db_name'] = $GLOBALS['egw_domain'][$this->account_domain]['db_name'];