Ignore:
Timestamp:
Jan 17, 2012, 1:00:26 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Správa uživatelů je nyní přetvořena na modul modulárního systému.
  • Upraveno: Hlavní objekt System je nyní odvozen z třídy ModularSystem.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/user.php

    r341 r343  
    2626define('USER_EVENT_OPTIONS_CHANGED', 4);
    2727
    28 class User extends OldModule
     28class User extends Model
    2929{
    3030  var $Dependencies = array('Log');
     
    3434  var $AnonymousUserId = 98;
    3535  var $OnlineStateTimeout = 600; // in seconds
     36
     37  function __construct($Database, $System)
     38  {
     39    parent::__construct($Database, $System);
     40    $this->Name = 'User';
     41    $this->AddPropertyString('Login');   
     42    $this->AddPropertyString('Name');   
     43    $this->AddPropertyString('Password');   
     44    $this->AddPropertyString('Email');   
     45    $this->AddPropertyString('LastIpAddress');   
     46    $this->AddPropertyDateTime('LastLoginTime');
     47    $this->AddPropertyDateTime('RegistrationTime');
     48    $this->AddPropertyOneToMany('User', 'User');
     49    $this->AddPropertyBoolean('Locked');
     50    $this->AddPropertyInteger('ICQ');
     51    $this->AddPropertyString('PhoneNumber');   
     52    $this->AddPropertyString('InitPassword');   
     53  }   
    3654
    3755  function Check()
     
    266284}
    267285
     286class UserOnline extends Model
     287{
     288  function __construct($Database, $System)
     289  {
     290    parent::__construct($Database, $System);
     291    $this->Name = 'UserOnline';
     292    $this->AddPropertyOneToMany('User', 'User');
     293    $this->AddPropertyDateTime('ActivityTime');
     294    $this->AddPropertyDateTime('LoginTime');
     295    $this->AddPropertyString('SessionId');   
     296    $this->AddPropertyString('IpAddress');   
     297    $this->AddPropertyString('HostName');   
     298    $this->AddPropertyString('ScriptName');   
     299  }   
     300}
     301
    268302class ModuleUser extends Module
    269303{
    270   function __construct($Database)
    271   {
    272     parent::__construct($Database);
     304  function __construct($Database, $System)
     305  {
     306    parent::__construct($Database, $System);
    273307    $this->Name = 'User';
    274308    $this->Version = '1.0';
     
    277311    $this->Description = 'User management';
    278312    $this->Dependencies = array();
    279     //$this->Models = array('User', 'UserOnline');
    280   }
     313    $this->Models = array('User', 'UserOnline');
     314  }
     315 
     316  function Init()
     317  {     
     318    $this->System->Models['User'] = new User($this->Database, $this->System);
     319  }
     320 
     321  function Install()
     322  {
     323    parent::Install();
     324  }
     325
     326  function UnInstall()
     327  {
     328    parent::UnInstall();
     329  }
    281330}
    282331
Note: See TracChangeset for help on using the changeset viewer.