"extra param to session::create() to not create a session, eg. for GroupDAV clients know to not support cookies, eg. Apple's iCal"

This commit is contained in:
Ralf Becker 2008-05-10 20:04:37 +00:00
parent 6d274a7aca
commit 496f8b9c1a

View File

@ -559,9 +559,10 @@
* @param string $login user login
* @param string $passwd user password
* @param string $passwd_type type of password being used, ie plaintext, md5, sha1
* @param boolean $no_session_needed=false dont create a real session, eg. for GroupDAV clients using only basic auth, no cookie support
* @return string session id
*/
function create($login,$passwd = '',$passwd_type = '')
function create($login,$passwd = '',$passwd_type = '',$no_session=false)
{
if (is_array($login))
{
@ -638,16 +639,16 @@
$GLOBALS['egw_info']['user']['account_id'] = $this->account_id;
$GLOBALS['egw']->accounts->accounts($this->account_id);
$this->sessionid = $this->new_session_id();
$this->sessionid = $no_session ? 'no-session' : $this->new_session_id();
$this->kp3 = md5($GLOBALS['egw']->common->randomstring(15));
if ($GLOBALS['egw_info']['server']['usecookies'])
if ($GLOBALS['egw_info']['server']['usecookies'] && !$no_session)
{
$this->egw_setcookie('sessionid',$this->sessionid);
$this->egw_setcookie('kp3',$this->kp3);
$this->egw_setcookie('domain',$this->account_domain);
}
if ($GLOBALS['egw_info']['server']['usecookies'] || isset($_COOKIE['last_loginid']))
if ($GLOBALS['egw_info']['server']['usecookies'] && !$no_session || isset($_COOKIE['last_loginid']))
{
$this->egw_setcookie('last_loginid', $this->account_lid ,$now+1209600); /* For 2 weeks */
$this->egw_setcookie('last_domain',$this->account_domain,$now+1209600);