Ignore:
Timestamp:
Dec 29, 2020, 11:11:12 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Modules dependencies evaluation.
  • Modified: Better installation/uninstallation of models in more modules.
File:
1 edited

Legend:

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

    r887 r890  
    6565  }
    6666
     67  static function GetDesc(): ModelDesc
     68  {
     69    $Desc = new ModelDesc('User');
     70    $Column = $Desc->AddString('Login');
     71    $Column->Unique = true;
     72    $Column = $Desc->AddString('Name');
     73    $Column->Unique = true;
     74    $Desc->AddString('Password');
     75    $Desc->AddString('Salt');
     76    $Desc->AddString('Email');
     77    $Desc->AddString('LastIpAddress');
     78    $Desc->AddString('LastLoginTime');
     79    $Desc->AddDateTime('RegistrationTime');
     80    $Desc->AddBoolean('Locked');
     81    $Desc->AddString('InitPassword');
     82    return $Desc;
     83  }
     84
    6785  function Check(): void
    6886  {
     
    435453  }
    436454}
     455
     456class UserOnline extends Model
     457{
     458  static function GetDesc(): ModelDesc
     459  {
     460    $Desc = new ModelDesc('UserOnline');
     461    $Desc->Memory = true;
     462    $Column = $Desc->AddReference('User', 'User');
     463    $Column->Nullable = true;   
     464    $Desc->AddDateTime('ActivityTime');
     465    $Desc->AddDateTime('LoginTime');
     466    $Desc->AddString('SessionId');
     467    $Desc->AddString('IpAddress');
     468    $Desc->AddString('HostName');
     469    $Desc->AddString('ScriptName');
     470    $Desc->AddBoolean('StayLogged');
     471    $Desc->AddString('StayLoggedHash');
     472    return $Desc;
     473  }
     474}
     475
     476class PermissionGroup extends Model
     477{
     478  static function GetDesc(): ModelDesc
     479  {
     480    $Desc = new ModelDesc('PermissionGroup');
     481    $Desc->AddString('Description');
     482    return $Desc;
     483  }
     484}
     485
     486class PermissionGroupAssignment extends Model
     487{
     488  static function GetDesc(): ModelDesc
     489  {
     490    $Desc = new ModelDesc('PermissionGroupAssignment');
     491    $Desc->AddReference('Group', 'PermissionGroup');
     492    $Column = $Desc->AddReference('AssignedGroup', 'PermissionGroup');
     493    $Column->Nullable = true;
     494    $Column = $Desc->AddReference('AssignedOperation', 'PermissionOperation');
     495    $Column->Nullable = true;
     496    return $Desc;
     497  }
     498}
     499
     500class PermissionOperation extends Model
     501{
     502  static function GetDesc(): ModelDesc
     503  {
     504    $Desc = new ModelDesc('PermissionOperation');
     505    $Desc->AddReference('Module', 'Module');
     506    $Desc->AddString('Operation');
     507    $Desc->AddString('Item');
     508    $Desc->AddInteger('ItemId');
     509    $Desc->Indices = array('Operation', 'Item', 'ItemId');
     510    return $Desc;
     511  }
     512}
     513
     514class PermissionUserAssignment extends Model
     515{
     516  static function GetDesc(): ModelDesc
     517  {
     518    $Desc = new ModelDesc('PermissionUserAssignment');
     519    $Desc->AddReference('User', 'User');
     520    $Column = $Desc->AddReference('AssignedGroup', 'PermissionGroup');
     521    $Column->Nullable = true;
     522    $Column = $Desc->AddReference('AssignedOperation', 'PermissionOperation');
     523    $Column->Nullable = true;
     524    return $Desc;
     525  }
     526}
Note: See TracChangeset for help on using the changeset viewer.