/[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.16 by jonen, Thu May 6 13:02:09 2004 UTC revision 1.20 by jonen, Thu Oct 7 14:08:51 2004 UTC
# Line 13  Line 13 
13  //    $Id$  //    $Id$
14  //    -----------------------------------------------------------------------------  //    -----------------------------------------------------------------------------
15  //    $Log$  //    $Log$
16    //    Revision 1.20  2004/10/07 14:08:51  jonen
17    //    + bufix related to save new-registered user-data
18    //
19    //    Revision 1.19  2004/06/22 09:18:47  jonen
20    //    removed debug dumps
21    //
22    //    Revision 1.17  2004/06/07 16:54:53  joko
23    //    modified cache-key
24    //    added cache-control
25    //
26  //    Revision 1.16  2004/05/06 13:02:09  jonen  //    Revision 1.16  2004/05/06 13:02:09  jonen
27  //    + added/modified functions related to User-Messages  //    + added/modified functions related to User-Messages
28  //  //
# Line 152  class User { Line 162  class User {
162      //$this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );      //$this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );
163      $rpcinfo = $this->site->configuration->get("rpcinfo");      $rpcinfo = $this->site->configuration->get("rpcinfo");
164      //$this->pObject = mkObject('DesignPattern::RemoteProxy', $this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );      //$this->pObject = mkObject('DesignPattern::RemoteProxy', $this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );
165      $this->pObject = mkObject('DesignPattern::RemoteProxy', $this->getUserGuid(), array( key => 1, command => 'getUser', query => $this->getUserGuid(), remote => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );      $cache_key = $this->getUserGuid() . "_user";
166        $this->pObject = mkObject('DesignPattern::RemoteProxy', $cache_key, array( key => 1, command => 'getUser', query => $this->getUserGuid(), remote => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );
167       if ($this->getUserGuid()) {       if ($this->getUserGuid()) {
168        $this->data = $this->pObject->getResult();        $this->data = $this->pObject->getResult();
169      }      }
# Line 167  class User { Line 178  class User {
178      }      }
179    
180      $this->_save("cache");      $this->_save("cache");
181        //$this->_save("commit");
182            
183      //$this->pObject->flushProxy();     // done in "pObject->save"      //$this->pObject->flushProxy();     // done in "pObject->save"
184            
# Line 181  class User { Line 193  class User {
193        $args = array( 'guid' => $this->data[guid], 'data' => $this->data );        $args = array( 'guid' => $this->data[guid], 'data' => $this->data );
194        $this->pObject->backend->send('saveUser', $args, array( utf8 => 1) );        $this->pObject->backend->send('saveUser', $args, array( utf8 => 1) );
195        $this->_save_local();        $this->_save_local();
196          $this->refresh();
197      }      }
198      // invalidate data only if it's not for caching purposes      // invalidate data only if it's not for caching purposes
199      if ($type != 'cache') {      if ($type != 'cache') {
# Line 202  class User { Line 215  class User {
215    }    }
216        
217    function create() {    function create() {
218     $this->_save();      // How THIS can function??? we will fool ourselves...
219     $attr = $this->pObject->getResult();     //$this->_save();
220     //print DumpVar($attr);     //$attr = $this->pObject->getResult();
221     $this->_create($attr);     $this->_create($this->data);
222    }    }
223    
224    function createGuest() {    function createGuest() {
# Line 242  class User { Line 255  class User {
255      global $site;      global $site;
256      //print "saving to backend: " . dumpVar($result) . "<br>";      //print "saving to backend: " . dumpVar($result) . "<br>";
257      if(!$this->pObject) {      if(!$this->pObject) {
258          $cache_key = php::CreateGUID() . "_guest";
259        $rpcinfo = $this->site->configuration->get("rpcinfo");        $rpcinfo = $this->site->configuration->get("rpcinfo");
260        $pObject = mkObject('DesignPattern::RemoteProxy', 'guest', array( key => 1, command => 'createGuestUser', '', remote => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );        $pObject = mkObject('DesignPattern::RemoteProxy', $cache_key, array( key => 1, command => 'createGuestUser', '', remote => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) );
261        $response = $pObject->getResult();        $response = $pObject->getResult();
262      } else {      } else {
263        $response = $this->pObject->backend->send('createGuestUser');        $response = $this->pObject->backend->send('createGuestUser');
# Line 404  class User { Line 418  class User {
418    }    }
419        
420    function refresh() {    function refresh() {
421      if ($this->pObject) {$this->pObject->flushState();}      if ($this->pObject) {$this->pObject->flush();}
422      $this->meta[data_ready] = 0;      $this->meta[data_ready] = 0;
423    }    }
424        

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.20

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