| 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 |
// |
// |
| 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) { |
| 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() { |
| 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; |
| 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(); |