- dont update the session dla, for the xajax notifications query, as it

stops sessions from timing out
- hook to be called when sessions get terminated
This commit is contained in:
Ralf Becker 2008-08-05 11:36:06 +00:00
parent 0587f0585d
commit 4db172a6c2
3 changed files with 24 additions and 7 deletions

View File

@ -342,7 +342,11 @@
}
$GLOBALS['egw_info']['user']['kp3'] = $this->kp3;
$this->update_dla();
// allow xajax / notifications to not update the dla, so sessions can time out again
if (!isset($GLOBALS['egw_info']['flags']['no_dla_update']) || !$GLOBALS['egw_info']['flags']['no_dla_update'])
{
$this->update_dla();
}
$this->account_id = $GLOBALS['egw']->accounts->name2id($this->account_lid,'account_lid','u');
if (!$this->account_id)
{
@ -1431,7 +1435,22 @@
* @return bool did it suceed?
*/
function destroy($sessionid, $kp3)
{}
{
if (!$sessionid && $kp3)
{
return False;
}
$this->log_access($this->sessionid); // log logout-time
error_log(__METHOD__."($sessionid,$kp3) parent::destroy()=$ret");
$GLOBALS['egw']->hooks->process(array(
'location' => 'session_destroyed',
'sessionid' => $sessionid,
),'',true); // true = run hooks from all apps, not just the ones the current user has perms to run
return true;
}
/**
* Functions for appsession data and session cache

View File

@ -133,13 +133,10 @@ class sessions extends sessions_
function destroy($sessionid, $kp3)
{
if (!$sessionid && $kp3)
if (!parent::destroy($sessionid,$kp3))
{
return False;
return false;
}
$this->log_access($this->sessionid); // log logout-time
// Only do the following, if where working with the current user
if ($sessionid == $GLOBALS['egw_info']['user']['sessionid'])
{

View File

@ -103,6 +103,7 @@ function doXMLHTTP()
'disable_Template_class' => True,
'autocreate_session_callback' => 'xajax_redirect',
'no_exception_handler' => true, // we already installed our own
'no_dla_update' => $appName == 'notifications', // otherwise session never time out
)
);
include('./header.inc.php');