/[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.9 by joko, Sun Feb 9 17:46:26 2003 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    -----------------------------------------------------------------------------  //    -----------------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.9  2003/02/09 17:46:26  joko
7    //    + now utilizing Data::Driver::Proxy and Data::Deep
8    //
9  //    Revision 1.8  2002/12/28 01:16:42  jonen  //    Revision 1.8  2002/12/28 01:16:42  jonen
10  //    + added clear of $this->state[autologout] at 'hadTimeout()'  //    + added clear of $this->state[autologout] at 'hadTimeout()'
11  //  //
# Line 105  class User { Line 108  class User {
108    
109    
110    function _loadData() {    function _loadData() {
111      $this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );      $this->meta[data_ready] = 1;
112        //$this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );
113        $rpcinfo = $this->site->configuration->get("rpcinfo");
114        $this->pObject = mkObject('Data::Driver::Proxy', $this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1, rpcinfo => $rpcinfo ) );
115      if ($this->getUserGuid()) {      if ($this->getUserGuid()) {
116        $this->data = $this->pObject->getAttributes();        $this->data = $this->pObject->getAttributes();
117      }      }
     $this->meta[data_ready] = 1;  
118    }    }
119    
120    function _saveData($newRawData) {    function _saveData($newRawData) {
# Line 166  class User { Line 171  class User {
171      //$this->_init($objectId);      //$this->_init($objectId);
172    }    }
173    
   function _getHKR($key) {  
     $attr_arr = split('\.', $key);  
     $attr_hkr = '["' . join('"]["', $attr_arr) . '"]';  
     return $attr_hkr;  
   }  
   
174    function get($attr) {    function get($attr) {
175      $this->_doDataReady();      $this->_doDataReady();
176      $hkr = $this->_getHKR($attr);      $deep = new Data_Deep($this->data);
177      $evalstr = 'return $this->data' . $hkr . ';';      return $deep->get($attr);
     $val = eval($evalstr);  
     return $val;  
178    }    }
179    function set($attr, $val) {    function set($attr, $val) {
180      $this->_doDataReady();      $this->_doDataReady();
181      $hkr = $this->_getHKR($attr);      $deep = new Data_Deep($this->data);
182      $evalstr = '$this->data' . $hkr . ' = \'' . $val . '\';';      $deep->set($attr, $val);
     eval($evalstr);  
183    }    }
184        
185    function isLoggedOn() {    function isLoggedOn() {
# Line 209  class User { Line 205  class User {
205          $this->state[guid] = $row[guid];          $this->state[guid] = $row[guid];
206          $this->state[status] = $this->meta[logontoken];          $this->state[status] = $this->meta[logontoken];
207          $this->_saveState();          $this->_saveState();
208        $this->site->log( get_class($this) . "->login ok", LOG_DEBUG );        $this->site->log( get_class($this) . "->login ok", PEAR_LOG_NOTICE );
209        return 1;        return 1;
210      } else {      } else {
211        return 0;        return 0;
# Line 257  class User { Line 253  class User {
253      // get information about user from site      // get information about user from site
254        $userid = $this->getUserId();        $userid = $this->getUserId();
255    
256        $this->site->log( get_class($this) . "->logout: userid $userid", LOG_DEBUG );        $this->site->log( get_class($this) . "->logout: userid $userid", PEAR_LOG_NOTICE );
257            
258      // get information about session from php      // get information about session from php
259        $session_id = session_id();        $session_id = session_id();

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

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