Changeset 343 for trunk/Modules/User/user.php
- Timestamp:
- Jan 17, 2012, 1:00:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/user.php
r341 r343 26 26 define('USER_EVENT_OPTIONS_CHANGED', 4); 27 27 28 class User extends OldModule28 class User extends Model 29 29 { 30 30 var $Dependencies = array('Log'); … … 34 34 var $AnonymousUserId = 98; 35 35 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 } 36 54 37 55 function Check() … … 266 284 } 267 285 286 class 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 268 302 class ModuleUser extends Module 269 303 { 270 function __construct($Database )271 { 272 parent::__construct($Database );304 function __construct($Database, $System) 305 { 306 parent::__construct($Database, $System); 273 307 $this->Name = 'User'; 274 308 $this->Version = '1.0'; … … 277 311 $this->Description = 'User management'; 278 312 $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 } 281 330 } 282 331
Note:
See TracChangeset
for help on using the changeset viewer.