/[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.5 by joko, Thu Dec 12 21:34:32 2002 UTC revision 1.6 by jonen, Wed Dec 18 22:46:06 2002 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    -----------------------------------------------------------------------------  //    -----------------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.6  2002/12/18 22:46:06  jonen
7    //    + added function 'getUserGuid()'
8    //       (returns user's 'guid' read from database at function 'login()'  (now))
9    //    + function '_loadData()' loads user remote now via 'getUserGuid()'
10    //
11  //    Revision 1.5  2002/12/12 21:34:32  joko  //    Revision 1.5  2002/12/12 21:34:32  joko
12  //    + fix in 'function update': invalidate data only if it's not for caching purposes  //    + fix in 'function update': invalidate data only if it's not for caching purposes
13  //  //
# Line 93  class User { Line 98  class User {
98    
99    
100    function _loadData() {    function _loadData() {
101      $this->pObject = new ProxyObject($this->state[id]);      $this->pObject = new ProxyObject($this->getUserGuid(), array( remote => 1, classname => "NetPerson", guid => 1) );
102      if ($this->state[id]) {      if ($this->getUserGuid()) {
103        $this->data = $this->pObject->getAttributes();        $this->data = $this->pObject->getAttributes();
104      }      }
105      $this->meta[data_ready] = 1;      $this->meta[data_ready] = 1;
# Line 172  class User { Line 177  class User {
177    function login($user,$passwd) {    function login($user,$passwd) {
178          connectdb();          connectdb();
179          //$sql = "SELECT * FROM td_users WHERE uname='$user'";          //$sql = "SELECT * FROM td_users WHERE uname='$user'";
180          $sql = "SELECT user_oid, uname, pass FROM td_users WHERE uname='$user'";          $sql = "SELECT user_oid, guid, uname, pass FROM td_users WHERE uname='$user'";
181          if ($res=send_sql($sql)) {          if ($res=send_sql($sql)) {
182                  $row = mysql_fetch_array($res,MYSQL_ASSOC);                  $row = mysql_fetch_array($res,MYSQL_ASSOC);
183                  if (!is_array($row)) { return 0; }                  if (!is_array($row)) { return 0; }
# Line 181  class User { Line 186  class User {
186        //return $uservars_db;        //return $uservars_db;
187        // store 1st priority user-data to state        // store 1st priority user-data to state
188          $this->state[id] = $row[user_oid];          $this->state[id] = $row[user_oid];
189            $this->state[guid] = $row[guid];
190          $this->state[status] = $this->meta[logontoken];          $this->state[status] = $this->meta[logontoken];
191          $this->_saveState();          $this->_saveState();
192        $this->site->log( get_class($this) . "->login ok", LOG_DEBUG );        $this->site->log( get_class($this) . "->login ok", LOG_DEBUG );
# Line 227  class User { Line 233  class User {
233      global $site;      global $site;
234    
235      // get information about user from site      // get information about user from site
236        $userid = $this->state[id];        $userid = $this->getUserId();
237    
238        $this->site->log( get_class($this) . "->logout: userid $userid", LOG_DEBUG );        $this->site->log( get_class($this) . "->logout: userid $userid", LOG_DEBUG );
239            
# Line 306  class User { Line 312  class User {
312      return $this->state[id];      return $this->state[id];
313    }    }
314    
315      function getUserGuid() {
316        return $this->state[guid];
317      }
318    
319    function getPostVars() {    function getPostVars() {
320      return $this->state[postvars];      return $this->state[postvars];

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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