Changeset 111 for branches


Ignore:
Timestamp:
Jan 19, 2014, 12:43:49 AM (11 years ago)
Author:
chronos
Message:
  • Opraveno: Namísto číselného id anonyma používat null hodnotu.
Location:
branches/php
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/php

    • Property svn:ignore
      •  

        old new  
        1 
        21config.php
        3 
        42error.log
         3.project
  • branches/php/Base/User.php

    r22 r111  
    1111  function LoadData()
    1212  {
    13     $DbResult = $this->System->Database->select('User', '*', 'Id='.$this->Id);
    14     if($DbResult->num_rows > 0)
    15     {
    16       $this->Data = $DbResult->fetch_assoc();
    17       if($this->Data['Rank'] == '') $this->Data['Rank'] = 0;
    18     } else throw new Exception('User with id '.$this->Id.' not found');
     13        if($this->Id != null)
     14        {
     15      $DbResult = $this->System->Database->select('User', '*', 'Id='.$this->Id);
     16      if($DbResult->num_rows > 0)
     17      {
     18        $this->Data = $DbResult->fetch_assoc();
     19        if($this->Data['Rank'] == '') $this->Data['Rank'] = 0;
     20      } else throw new Exception('User with id '.$this->Id.' not found');
     21        } else $this->Data = array();
    1922  }
    2023
  • branches/php/Base/UserOnline.php

    r22 r111  
    77  var $Id;
    88  var $User;
    9   var $AnonymousUserId;
    109
    1110  function __construct($System)
    1211  {
    1312    parent::__construct($System);
    14     $this->Id = 0;
    15     $this->AnonymousUserId = 98;
    16     $this->User = $this->AnonymousUserId;
     13    $this->Id = null;
    1714  }
    1815
     
    3128    {
    3229      // Create new record
    33       $this->System->Database->insert('UserOnline', array('User' => $this->AnonymousUserId,
     30      $this->System->Database->insert('UserOnline', array('User' => null,
    3431        'ActivityTime' => 'NOW()', 'SessionId' => '"'.session_id().'"',
    3532        'IpAddress' => '"'.$this->System->GetRemoteAddress().'"',
     
    5451    {
    5552      $this->System->Database->update('UserOnline', 'SessionId="'.session_id().'"',
    56         array('User' => $this->AnonymousUserId));
    57       $this->User = $this->AnonymousUserId;
     53        array('User' => null));
     54      $this->User = null;
    5855    }
    5956  }
  • branches/php/CustomOutput.php

    r28 r111  
    4545      $Output .= '<li>'.$this->System->HTML->MakeLink($this->System->Localization->Translate('Links'), $this->System->Navigation->MakeLink('Main', 'Links')).'</li>';
    4646      $Output .= '<li>'.$this->System->HTML->MakeLink($this->System->Localization->Translate('Contact'), $this->System->Navigation->MakeLink('Main', 'Contact')).'</li>';
    47     if($this->System->UserOnline->User == $this->System->UserOnline->AnonymousUserId)
     47    if($this->System->UserOnline->User == null)
    4848    {
    4949      $Output .= '</ul>';
  • branches/php/Module/User/Controller.php

    r22 r111  
    66include_once(dirname(__FILE__).'/../../Base/HTML/ListWebObject.php');
    77include_once(dirname(__FILE__).'/../../Base/HTML/Controller.php');
    8 include_once(dirname(__FILE__).'/../Lift/Controller.php');
    98
    109class UserLoginWebObject extends AddWebObject
Note: See TracChangeset for help on using the changeset viewer.