/[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.12 by joko, Mon Mar 3 21:20:47 2003 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    -----------------------------------------------------------------------------  //    -----------------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.12  2003/03/03 21:20:47  joko
7    //    mungled the namespaces
8    //
9    //    Revision 1.11  2003/02/14 14:22:06  joko
10    //    + always (re-)tries to connect
11    //
12    //    Revision 1.10  2003/02/13 21:58:39  joko
13    //    + caching mechanisms more configurable now
14    //
15    //    Revision 1.9  2003/02/09 17:46:26  joko
16    //    + now utilizing DesignPattern::RemoteProxy and Data::Deep
17    //
18  //    Revision 1.8  2002/12/28 01:16:42  jonen  //    Revision 1.8  2002/12/28 01:16:42  jonen
19  //    + added clear of $this->state[autologout] at 'hadTimeout()'  //    + added clear of $this->state[autologout] at 'hadTimeout()'
20  //  //
# Line 105  class User { Line 117  class User {
117    
118    
119    function _loadData() {    function _loadData() {
120      $this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );      $this->meta[data_ready] = 1;
121        //$this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );
122        $rpcinfo = $this->site->configuration->get("rpcinfo");
123        $this->pObject = mkObject('DesignPattern::RemoteProxy', $this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );
124      if ($this->getUserGuid()) {      if ($this->getUserGuid()) {
125        $this->data = $this->pObject->getAttributes();        $this->data = $this->pObject->getAttributes();
126      }      }
     $this->meta[data_ready] = 1;  
127    }    }
128    
129    function _saveData($newRawData) {    function _saveData($newRawData) {
# Line 166  class User { Line 180  class User {
180      //$this->_init($objectId);      //$this->_init($objectId);
181    }    }
182    
   function _getHKR($key) {  
     $attr_arr = split('\.', $key);  
     $attr_hkr = '["' . join('"]["', $attr_arr) . '"]';  
     return $attr_hkr;  
   }  
   
183    function get($attr) {    function get($attr) {
184      $this->_doDataReady();      $this->_doDataReady();
185      $hkr = $this->_getHKR($attr);      $deep = new Data_Deep($this->data);
186      $evalstr = 'return $this->data' . $hkr . ';';      return $deep->get($attr);
     $val = eval($evalstr);  
     return $val;  
187    }    }
188    function set($attr, $val) {    function set($attr, $val) {
189      $this->_doDataReady();      $this->_doDataReady();
190      $hkr = $this->_getHKR($attr);      $deep = new Data_Deep($this->data);
191      $evalstr = '$this->data' . $hkr . ' = \'' . $val . '\';';      $deep->set($attr, $val);
     eval($evalstr);  
192    }    }
193        
194    function isLoggedOn() {    function isLoggedOn() {
# Line 209  class User { Line 214  class User {
214          $this->state[guid] = $row[guid];          $this->state[guid] = $row[guid];
215          $this->state[status] = $this->meta[logontoken];          $this->state[status] = $this->meta[logontoken];
216          $this->_saveState();          $this->_saveState();
217        $this->site->log( get_class($this) . "->login ok", LOG_DEBUG );        $this->site->log( get_class($this) . "->login ok", PEAR_LOG_NOTICE );
218        return 1;        return 1;
219      } else {      } else {
220        return 0;        return 0;
# Line 257  class User { Line 262  class User {
262      // get information about user from site      // get information about user from site
263        $userid = $this->getUserId();        $userid = $this->getUserId();
264    
265        $this->site->log( get_class($this) . "->logout: userid $userid", LOG_DEBUG );        $this->site->log( get_class($this) . "->logout: userid $userid", PEAR_LOG_NOTICE );
266            
267      // get information about session from php      // get information about session from php
268        $session_id = session_id();        $session_id = session_id();

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

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