Home » Authentication » LiveUser » Bug #9290
onIdled, postIdled, onExpired, postExpired
Details
| Request #9290 | onIdled, postIdled, onExpired, postExpired |
|---|---|
| Submitted | 2006-11-09 14:34 UTC |
| From | suttner at anduras dot de |
| Status | Feedback |
| Package | LiveUser |
| PHP Version | 5.1.2 |
| OS | Ubuntu Dapper Drake |
| Roadmaps | (Not assigned) |
Comments
[2006-11-09 14:34 UTC] suttner at anduras dot de
Description:
------------
I have created a patch, that it is possible to get the onIdled event before the logout. Additional the postIdled event was added. (same to onExpired, postExpired).
It is required, because without this fix, it is not possible to do some stuff before the user is logged out.
Test script:
---------------
--- LiveUser.php.old 2006-11-08 11:49:42.000000000 +0100
+++ LiveUser.php 2006-11-08 11:50:10.000000000 +0100
@@ -979,17 +979,19 @@
if ($this->getProperty('expireTime') > 0
&& ($this->getProperty('currentLogin') + $this->getProperty('expireTime')) < $now
) {
+ $this->dispatcher->post($this, 'onExpired');
$this->logout(false);
$this->_status = LIVEUSER_STATUS_EXPIRED;
- $this->dispatcher->post($this, 'onExpired');
+ $this->dispatcher->post($this, 'postExpired');
// Check if maximum idle time is reached.
} elseif ($this->getProperty('idleTime') > 0
&& array_key_exists('idle', $_SESSION[$this->_options['session']['varname']])
&& ($_SESSION[$this->_options['session']['varname']]['idle'] + $this->getProperty('idleTime')) < $now
) {
+ $this->dispatcher->post($this, 'onIdled');
$this->logout(false);
$this->_status = LIVEUSER_STATUS_IDLED;
- $this->dispatcher->post($this, 'onIdled');
+ $this->dispatcher->post($this, 'postIdled');
}
}
}