From e165593ed237f7074acb289691a54c4a676be1a2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 4 Aug 2015 14:49:01 +0000 Subject: [PATCH] add HTTP User-Agent to pseudo session id, to eg. distinguish sessions from different WebDAV clients in access-log --- phpgwapi/inc/class.egw_session.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_session.inc.php b/phpgwapi/inc/class.egw_session.inc.php index 68921b8984..190d023e67 100644 --- a/phpgwapi/inc/class.egw_session.inc.php +++ b/phpgwapi/inc/class.egw_session.inc.php @@ -825,7 +825,8 @@ class egw_session $sessionid = md5($_SERVER['PHP_AUTH_USER'].':'.$_SERVER['PHP_AUTH_PW'].':'.$_SERVER['HTTP_HOST'].':'. EGW_SERVER_ROOT.':'.self::getuser_ip().':'.filemtime(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'). // for ActiveSync we add the DeviceID - (isset($_GET['DeviceId']) && $_SERVER['SCRIPT_NAME'] === '/Microsoft-Server-ActiveSync' ? ':'.$_GET['DeviceId'] : '')); + (isset($_GET['DeviceId']) && $_SERVER['SCRIPT_NAME'] === '/Microsoft-Server-ActiveSync' ? ':'.$_GET['DeviceId'] : ''). + ':'.$_SERVER['HTTP_USER_AGENT']); //error_log(__METHOD__."($only_basic_auth) HTTP_HOST=$_SERVER[HTTP_HOST], PHP_AUTH_USER=$_SERVER[PHP_AUTH_USER], DeviceId=$_GET[DeviceId]: sessionid=$sessionid"); } // same for digest auth @@ -836,7 +837,8 @@ class egw_session // can't use full $_SERVER['PHP_AUTH_DIGEST'], as it changes (contains eg. the url) $data = egw_digest_auth::parse_digest($_SERVER['PHP_AUTH_DIGEST']); $sessionid = md5($data['username'].':'.$data['realm'].':'.$data['nonce'].':'.$_SERVER['HTTP_HOST']. - EGW_SERVER_ROOT.':'.self::getuser_ip().':'.filemtime(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php')); + EGW_SERVER_ROOT.':'.self::getuser_ip().':'.filemtime(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'). + ':'.$_SERVER['HTTP_USER_AGENT']); } elseif(!$only_basic_auth && isset($_REQUEST[self::EGW_SESSION_NAME])) {