From: <ral...@us...> - 2008-10-26 12:51:00
|
Author: ralfbecker Date: Sun Oct 26 13:18:57 2008 New Revision: 26280 URL: http://www.egroupware.org/viewvc?rev=3D26280&view=3Drev Log: Allow HTTP basic auth user to contain a domain to switch instances, as it's done in the webgui login (for WebDAV or GroupDAV) Modified: trunk/phpgwapi/inc/class.egw_session.inc.php trunk/phpgwapi/inc/functions.inc.php Modified: trunk/phpgwapi/inc/class.egw_session.inc.php URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/class.egw_session.= inc.php?rev=3D26280&r1=3D26279&r2=3D26280&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/phpgwapi/inc/class.egw_session.inc.php (original) +++ trunk/phpgwapi/inc/class.egw_session.inc.php Sun Oct 26 13:18:57 2008 @@ -219,7 +219,7 @@ $config->value('num_unsuccessful_ip',$GLOBALS['egw_info']['server']['nu= m_unsuccessful_ip']); $config->value('install_id',$GLOBALS['egw_info']['server']['install_id'= ]); $config->value('sessions_timeout',$GLOBALS['egw_info']['server']['sessi= ons_timeout']); - $config->value('sessions_app_timeout',$GLOBALS['egw_info']['server']['s= essions_app_timeout']); + $config->value('max_history',$GLOBALS['egw_info']['server']['max_histor= y']); $config->save_repository(); } self::set_cookiedomain(); @@ -414,12 +414,17 @@ $this->login .=3D '@'.$this->account_domain; } $now =3D time(); + //error_log(__METHOD__."($login,$passwd,$passwd_type,$no_session,$auth_c= heck) account_lid=3D$this->account_lid, account_domain=3D$this->account_dom= ain, default_domain=3D{$GLOBALS['egw_info']['server']['default_domain']}, u= ser/domain=3D{$GLOBALS['egw_info']['user']['domain']}"); = // This is to ensure that we authenticate to the correct domain (might n= ot be default) // if no domain is given we use the default domain, so we dont need to r= e-create everything if (!$GLOBALS['egw_info']['user']['domain'] && $this->account_domain =3D= =3D $GLOBALS['egw_info']['server']['default_domain']) { $GLOBALS['egw_info']['user']['domain'] =3D $this->account_domain; + } + elseif (!$this->account_domain && $GLOBALS['egw_info']['user']['domain']) + { + $this->account_domain =3D $GLOBALS['egw_info']['user']['domain']; } elseif($this->account_domain !=3D $GLOBALS['egw_info']['user']['domain']) { @@ -1154,7 +1159,7 @@ /** * Search the instance matching the request * - * @param string $login on login $_POST['login'] + * @param string $login on login $_POST['login'], $_SERVER['PHP_AUTH_USER= '] or $_SERVER['REMOTE_USER'] * @param string $domain_requested usually $_REQUEST['domain'] * @param string &$default_domain usually $default_domain get's set eg. b= y sitemgr * @param string $server_name usually $_SERVER['SERVER_NAME'] Modified: trunk/phpgwapi/inc/functions.inc.php URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/functions.inc.php?= rev=3D26280&r1=3D26279&r2=3D26280&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/phpgwapi/inc/functions.inc.php (original) +++ trunk/phpgwapi/inc/functions.inc.php Sun Oct 26 13:18:57 2008 @@ -108,8 +108,9 @@ /*************************************************************************= ***\ * Multi-Domain support = * \*************************************************************************= ***/ -$GLOBALS['egw_info']['user']['domain'] =3D egw_session::search_instance($_= POST['login'],$_REQUEST['domain'], - $GLOBALS['egw_info']['server']['default_domain'],$_SERVER['SERVER_NAME'],= $GLOBALS['egw_domain']); +$GLOBALS['egw_info']['user']['domain'] =3D egw_session::search_instance( + isset($_POST['login']) ? $_POST['login'] : (isset($_SERVER['PHP_AUTH_USER= ']) ? $_SERVER['PHP_AUTH_USER'] : $_SERVER['REMOTE_USER']), + $_REQUEST['domain'],$GLOBALS['egw_info']['server']['default_domain'],$_SE= RVER['SERVER_NAME'],$GLOBALS['egw_domain']); = $GLOBALS['egw_info']['server']['db_host'] =3D $GLOBALS['egw_domain'][$GLOB= ALS['egw_info']['user']['domain']]['db_host']; $GLOBALS['egw_info']['server']['db_port'] =3D $GLOBALS['egw_domain'][$GLOB= ALS['egw_info']['user']['domain']]['db_port']; |