From: <jl...@us...> - 2009-11-22 17:49:23
|
Author: jlehrke Date: Sun Nov 22 18:49:09 2009 New Revision: 28454 URL: http://www.egroupware.org/viewvc/egroupware?rev=28454&view=rev Log: Add multi-domain support for SyncML Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php URL: http://www.egroupware.org/viewvc/egroupware/trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php?rev=28454&r1=28453&r2=28454&view=diff ============================================================================== --- trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php (original) +++ trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php Sun Nov 22 18:49:09 2009 @@ -311,11 +311,21 @@ $parts = explode('@',$this->_locName); $this->_account_domain = array_pop($parts); } + $GLOBALS['egw_info']['user']['domain'] = $this->_account_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']; + $GLOBALS['egw_info']['server']['db_user'] = $GLOBALS['egw_domain'][$this->_account_domain]['db_user']; + $GLOBALS['egw_info']['server']['db_pass'] = $GLOBALS['egw_domain'][$this->_account_domain]['db_pass']; + $GLOBALS['egw_info']['server']['db_type'] = $GLOBALS['egw_domain'][$this->_account_domain]['db_type']; + // It work -- don't ask me why. + $this->db = new egw_db($GLOBALS['egw_info']['server']); + $this->db->connect(); + #Horde::logMessage('SyncML: authenticate with username: ' . $this->_locName . ' and password: ' . $this->_password, __FILE__, __LINE__, PEAR_LOG_DEBUG); - if ($GLOBALS['sessionid'] = $GLOBALS['egw']->session->create($this->_locName,$this->_password,'text')) { - + if (($GLOBALS['sessionid'] = $GLOBALS['egw']->session->create($this->_locName,$this->_password,'text'))) { if ($GLOBALS['egw_info']['user']['apps']['syncml']) { $this->_isAuthorized = true; Horde::logMessage('SyncML_EGW: Authentication of ' . $this->_locName . '/' . $GLOBALS['sessionid'] . ' succeded' , __FILE__, __LINE__, PEAR_LOG_DEBUG); @@ -328,6 +338,7 @@ Horde::logMessage('SyncML: Authentication of ' . $this->_locName . ' failed' , __FILE__, __LINE__, PEAR_LOG_INFO); } } else { + if ($this->log) error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n".var_export($GLOBALS['egw_info'], true)."\n",3,$this->logfile); // store sessionID in a variable, because ->verify maybe resets that value $sessionID = session_id(); $GLOBALS['egw_info']['user']['domain'] = $this->_account_domain; |