/[cvs]/nfo/php/libs/org.netfrag.flib/Tracker/User.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.flib/Tracker/User.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by jonen, Sat Dec 28 01:16:42 2002 UTC revision 1.11 by joko, Fri Feb 14 14:22:06 2003 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    -----------------------------------------------------------------------------  //    -----------------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.11  2003/02/14 14:22:06  joko
7    //    + always (re-)tries to connect
8    //
9    //    Revision 1.10  2003/02/13 21:58:39  joko
10    //    + caching mechanisms more configurable now
11    //
12    //    Revision 1.9  2003/02/09 17:46:26  joko
13    //    + now utilizing Data::Driver::Proxy and Data::Deep
14    //
15  //    Revision 1.8  2002/12/28 01:16:42  jonen  //    Revision 1.8  2002/12/28 01:16:42  jonen
16  //    + added clear of $this->state[autologout] at 'hadTimeout()'  //    + added clear of $this->state[autologout] at 'hadTimeout()'
17  //  //
# Line 105  class User { Line 114  class User {
114    
115    
116    function _loadData() {    function _loadData() {
117      $this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );      $this->meta[data_ready] = 1;
118        //$this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );
119        $rpcinfo = $this->site->configuration->get("rpcinfo");
120        $this->pObject = mkObject('Data::Driver::Proxy', $this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );
121      if ($this->getUserGuid()) {      if ($this->getUserGuid()) {
122        $this->data = $this->pObject->getAttributes();        $this->data = $this->pObject->getAttributes();
123      }      }
     $this->meta[data_ready] = 1;  
124    }    }
125    
126    function _saveData($newRawData) {    function _saveData($newRawData) {
# Line 166  class User { Line 177  class User {
177      //$this->_init($objectId);      //$this->_init($objectId);
178    }    }
179    
   function _getHKR($key) {  
     $attr_arr = split('\.', $key);  
     $attr_hkr = '["' . join('"]["', $attr_arr) . '"]';  
     return $attr_hkr;  
   }  
   
180    function get($attr) {    function get($attr) {
181      $this->_doDataReady();      $this->_doDataReady();
182      $hkr = $this->_getHKR($attr);      $deep = new Data_Deep($this->data);
183      $evalstr = 'return $this->data' . $hkr . ';';      return $deep->get($attr);
     $val = eval($evalstr);  
     return $val;  
184    }    }
185    function set($attr, $val) {    function set($attr, $val) {
186      $this->_doDataReady();      $this->_doDataReady();
187      $hkr = $this->_getHKR($attr);      $deep = new Data_Deep($this->data);
188      $evalstr = '$this->data' . $hkr . ' = \'' . $val . '\';';      $deep->set($attr, $val);
     eval($evalstr);  
189    }    }
190        
191    function isLoggedOn() {    function isLoggedOn() {
# Line 209  class User { Line 211  class User {
211          $this->state[guid] = $row[guid];          $this->state[guid] = $row[guid];
212          $this->state[status] = $this->meta[logontoken];          $this->state[status] = $this->meta[logontoken];
213          $this->_saveState();          $this->_saveState();
214        $this->site->log( get_class($this) . "->login ok", LOG_DEBUG );        $this->site->log( get_class($this) . "->login ok", PEAR_LOG_NOTICE );
215        return 1;        return 1;
216      } else {      } else {
217        return 0;        return 0;
# Line 257  class User { Line 259  class User {
259      // get information about user from site      // get information about user from site
260        $userid = $this->getUserId();        $userid = $this->getUserId();
261    
262        $this->site->log( get_class($this) . "->logout: userid $userid", LOG_DEBUG );        $this->site->log( get_class($this) . "->logout: userid $userid", PEAR_LOG_NOTICE );
263            
264      // get information about session from php      // get information about session from php
265        $session_id = session_id();        $session_id = session_id();

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.11

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed