From 467313e5c50e81200eb146b0947c2c3ad2ab2b8c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 10 May 2008 20:05:12 +0000 Subject: [PATCH] "extra param to session::create() to not create a session, eg. for GroupDAV clients know to not support cookies, eg. Apple's iCal" --- groupdav.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/groupdav.php b/groupdav.php index e5646f06dd..281cf3f21e 100644 --- a/groupdav.php +++ b/groupdav.php @@ -28,7 +28,11 @@ function check_access(&$account) 'passwd' => $_SERVER['PHP_AUTH_PW'], 'passwd_type' => 'text', ); - if (!($sessionid = $GLOBALS['egw']->session->create($account))) + // no session for clients known to NOT use it (no cookie support) + $no_session = strpos($_SERVER['HTTP_USER_AGENT'],'DAVKit') !== false; // Apple iCal + //error_log("GroupDAV PHP_AUTH_USER={$_SERVER['PHP_AUTH_USER']}, HTTP_USER_AGENT={$_SERVER['HTTP_USER_AGENT']} --> no_session=".(int)$no_session); + + if (!($sessionid = $GLOBALS['egw']->session->create($account,'','',$no_session))) { header('WWW-Authenticate: Basic realm="'.groupdav::REALM.'"'); header("HTTP/1.1 401 Unauthorized");