3 * Class for the current logged in user.
5 * @author Ant P <p@cpi.merseine.nu>
6 * @license file://../COPYING
9 class User_Authenticated
extends User_Registered
11 public $cached = false;
13 function __construct($userid)
18 // Needed to stop memcache'd copy getting out of sync with the database
21 if ( $this->attrcache
['last_passive_date'] < T_NOW
- 30
22 ||
! empty($_POST) ) {
23 $this->sync($this->attrcache
['userid']);
30 private function sync($userid)
32 parent
::__construct($userid);
34 /* Update last active thing */
35 if ( $this->getopt('alwaysonline') ||
! empty($_POST) ) {
36 $qx = 'UPDATE LOW_PRIORITY users SET useragent = ?, last_ip = INET_ATON(?), '.
37 'last_passive_date = UNIX_TIMESTAMP(), last_active_date = last_passive_date WHERE userid = @userid';
39 $qx = 'UPDATE LOW_PRIORITY users SET useragent = ?, last_ip = INET_ATON(?), '.
40 'last_passive_date = UNIX_TIMESTAMP() WHERE userid = @userid';
42 SO2
::$DB->q($qx, array(substr($_SERVER['HTTP_USER_AGENT'], 0, 130), $_SERVER['REMOTE_ADDR']));
46 private function reload()
48 SO2
::$Page->usernav
= array (
49 $this->attrcache
['alias'].' ('.$this->attrcache
['points'].'ยค)' => 'user'