| 1 |
<? |
<? |
| 2 |
|
/** |
| 3 |
|
* This file contains the Tracker::User module. |
| 4 |
|
* |
| 5 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 6 |
|
* @package org.netfrag.flib |
| 7 |
|
* @name Tracker::User |
| 8 |
|
* |
| 9 |
|
*/ |
| 10 |
|
|
| 11 |
|
|
| 12 |
// ----------------------------------------------------------------------------- |
// ----------------------------------------------------------------------------- |
| 13 |
// $Id$ |
// $Id$ |
| 14 |
// ----------------------------------------------------------------------------- |
// ----------------------------------------------------------------------------- |
| 15 |
// $Log$ |
// $Log$ |
| 16 |
|
// Revision 1.14 2003/07/02 11:02:09 joko |
| 17 |
|
// + fixed bug with create/_create |
| 18 |
|
// |
| 19 |
|
// Revision 1.13 2003/04/04 02:15:09 joko |
| 20 |
|
// renamed method of helper object |
| 21 |
|
// |
| 22 |
|
// Revision 1.12 2003/03/03 21:20:47 joko |
| 23 |
|
// mungled the namespaces |
| 24 |
|
// |
| 25 |
// Revision 1.11 2003/02/14 14:22:06 joko |
// Revision 1.11 2003/02/14 14:22:06 joko |
| 26 |
// + always (re-)tries to connect |
// + always (re-)tries to connect |
| 27 |
// |
// |
| 29 |
// + caching mechanisms more configurable now |
// + caching mechanisms more configurable now |
| 30 |
// |
// |
| 31 |
// Revision 1.9 2003/02/09 17:46:26 joko |
// Revision 1.9 2003/02/09 17:46:26 joko |
| 32 |
// + now utilizing Data::Driver::Proxy and Data::Deep |
// + now utilizing DesignPattern::RemoteProxy and Data::Deep |
| 33 |
// |
// |
| 34 |
// Revision 1.8 2002/12/28 01:16:42 jonen |
// Revision 1.8 2002/12/28 01:16:42 jonen |
| 35 |
// + added clear of $this->state[autologout] at 'hadTimeout()' |
// + added clear of $this->state[autologout] at 'hadTimeout()' |
| 99 |
// |
// |
| 100 |
// ----------------------------------------------------------------------------- |
// ----------------------------------------------------------------------------- |
| 101 |
|
|
| 102 |
|
|
| 103 |
|
/** |
| 104 |
|
* This is the User class. |
| 105 |
|
* |
| 106 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 107 |
|
* @package org.netfrag.flib |
| 108 |
|
* @name Tracker::User |
| 109 |
|
* |
| 110 |
|
*/ |
| 111 |
class User { |
class User { |
| 112 |
|
|
| 113 |
var $state; |
var $state; |
| 145 |
$this->meta[data_ready] = 1; |
$this->meta[data_ready] = 1; |
| 146 |
//$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) ); |
| 147 |
$rpcinfo = $this->site->configuration->get("rpcinfo"); |
$rpcinfo = $this->site->configuration->get("rpcinfo"); |
| 148 |
$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 ) ); |
$this->pObject = mkObject('DesignPattern::RemoteProxy', $this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1, rpcinfo => $rpcinfo, cache => array( db => 1, session => 1 ), connect => 1 ) ); |
| 149 |
if ($this->getUserGuid()) { |
if ($this->getUserGuid()) { |
| 150 |
$this->data = $this->pObject->getAttributes(); |
$this->data = $this->pObject->getResult(); |
| 151 |
} |
} |
| 152 |
} |
} |
| 153 |
|
|
| 180 |
|
|
| 181 |
function create() { |
function create() { |
| 182 |
$this->_save(); |
$this->_save(); |
| 183 |
$attr = $this->pObject->getAttributes(); |
$attr = $this->pObject->getResult(); |
| 184 |
//print DumpVar($attr); |
//print DumpVar($attr); |
| 185 |
$this->_create($attr); |
$this->_create($attr); |
| 186 |
} |
} |
| 187 |
|
|
| 188 |
function _create($result) { |
function _create($result) { |
| 189 |
|
global $site; |
| 190 |
//print "saving to backend: " . dumpVar($result) . "<br>"; |
//print "saving to backend: " . dumpVar($result) . "<br>"; |
| 191 |
$response = $this->pObject->backend->send('createUser', array('data' => $result) ); |
$response = $this->pObject->backend->send('createUser', array('data' => $result) ); |
| 192 |
$objectId = $response[oid]; |
$objectId = $response[oid]; |