Ignore:
Timestamp:
Aug 4, 2009, 5:32:06 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Dále posunuta funkčnost podpory více světů na server.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/model/user.php

    r54 r57  
    148148      else
    149149      {
    150         $this->Database->update('User', 'Id='.$Row['Id'], array('LastLoginTime' => 'NOW()', 'LastIpAddress' => GetRemoteAddress()));           
     150        $this->Database->update('User', 'Id='.$Row['Id'], array('LastLoginTime' => 'NOW()', 'LastIpAddress' => GetRemoteAddress()));     
    151151        $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $Row['Id']));
    152152        // načtení stavu stromu
     
    216216  function CheckPermission($Module, $Operation, $ItemType = '', $ItemIndex = 0)
    217217  {
    218         $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$Module.'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"');
     218  $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$Module.'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"');
    219219    if($DbResult->num_rows > 0)
    220220    {
     
    272272    return($Output);
    273273  }
     274 
     275  function ServerCount()
     276  {
     277    $DbResult = $this->Database->query('SELECT COUNT(*) FROM Server WHERE User='.$this->User['Id']);
     278    $DbRow = $DbResult->fetch_row();
     279    return($DbRow[0]);
     280  }
     281
     282  function RealmCount()
     283  {
     284    $Total = 0;
     285    $DbResult = $this->Database->query('SELECT Id FROM Server WHERE User='.$this->User['Id']);
     286    while($DbRow = $DbResult->fetch_assoc())
     287    {
     288      $Server = new Server($this->Database, $DbRow['Id']);
     289      $Total += $Server->RealmCount();
     290    }
     291    return($Total);   
     292  }
    274293}
    275294
Note: See TracChangeset for help on using the changeset viewer.