Ignore:
Timestamp:
Jun 1, 2023, 1:31:28 AM (12 months ago)
Author:
chronos
Message:
  • Fixed: More class type casting.
File:
1 edited

Legend:

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

    r9 r10  
    131131  function DoStart(): void
    132132  {
    133     $this->System->User = new User($this->System);
    134     if (isset($_SERVER['REMOTE_ADDR'])) $this->System->User->Check();
     133    Core::Cast($this->System)->User = new User($this->System);
     134    if (isset($_SERVER['REMOTE_ADDR'])) Core::Cast($this->System)->User->Check();
    135135    $this->System->RegisterPage(['userlist'], 'PageUserList');
    136136    $this->System->RegisterPage(['user'], 'PageUser');
    137     $this->System->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback'));
    138     $this->System->FormManager->RegisterClass('UserLogin', array(
     137    Core::Cast($this->System)->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback'));
     138    Core::Cast($this->System)->FormManager->RegisterClass('UserLogin', array(
    139139      'Title' => 'Přihlášení uživatele',
    140140      'SubmitText' => 'Přihlásit',
     
    146146      ),
    147147    ));
    148     $this->System->FormManager->RegisterClass('UserOptions', array(
     148    Core::Cast($this->System)->FormManager->RegisterClass('UserOptions', array(
    149149      'Title' => 'Základní nastavení',
    150150      'Table' => 'User',
     
    158158      ),
    159159    ));
    160     $this->System->FormManager->RegisterClass('UserRegister', array(
     160    Core::Cast($this->System)->FormManager->RegisterClass('UserRegister', array(
    161161      'Title' => 'Registrace uživatele',
    162162      'SubmitText' => 'Registrovat',
     
    170170      ),
    171171    ));
    172     $this->System->FormManager->RegisterClass('PasswordRecovery', array(
     172    Core::Cast($this->System)->FormManager->RegisterClass('PasswordRecovery', array(
    173173      'Title' => 'Obnova hesla',
    174174      'SubmitText' => 'Obnovit',
     
    179179      ),
    180180    ));
    181     $this->System->FormManager->RegisterClass('APIToken', array(
     181    Core::Cast($this->System)->FormManager->RegisterClass('APIToken', array(
    182182      'Title' => 'Přístupový token',
    183183      'Table' => 'APIToken',
     
    187187      ),
    188188    ));
    189     $this->System->FormManager->RegisterClass('User', array(
     189    Core::Cast($this->System)->FormManager->RegisterClass('User', array(
    190190      'Title' => 'Uživatelé',
    191191      'Table' => 'User',
     
    206206      ),
    207207    ));
    208     $this->System->FormManager->RegisterClass('PermissionUserAssignment', array(
     208    Core::Cast($this->System)->FormManager->RegisterClass('PermissionUserAssignment', array(
    209209      'Title' => 'Oprávnění uživatelů',
    210210      'Table' => 'PermissionUserAssignment',
     
    215215      ),
    216216    ));
    217     $this->System->FormManager->RegisterClass('PermissionGroup', array(
     217    Core::Cast($this->System)->FormManager->RegisterClass('PermissionGroup', array(
    218218      'Title' => 'Skupiny oprávnění',
    219219      'Table' => 'PermissionGroup',
     
    224224      ),
    225225    ));
    226     $this->System->FormManager->RegisterClass('PermissionGroupAssignment', array(
     226    Core::Cast($this->System)->FormManager->RegisterClass('PermissionGroupAssignment', array(
    227227      'Title' => 'Přiřazení skupin oprávnění',
    228228      'Table' => 'PermissionGroupAssignment',
     
    233233      ),
    234234    ));
    235     $this->System->FormManager->RegisterClass('PermissionOperation', array(
     235    Core::Cast($this->System)->FormManager->RegisterClass('PermissionOperation', array(
    236236      'Title' => 'Operace oprávnění',
    237237      'Table' => 'PermissionOperation',
     
    244244      ),
    245245    ));
    246     $this->System->FormManager->RegisterFormType('TUser', array(
     246    Core::Cast($this->System)->FormManager->RegisterFormType('TUser', array(
    247247      'Type' => 'Reference',
    248248      'Table' => 'User',
     
    251251      'Filter' => '1',
    252252    ));
    253     $this->System->FormManager->RegisterFormType('TPermissionGroup', array(
     253    Core::Cast($this->System)->FormManager->RegisterFormType('TPermissionGroup', array(
    254254      'Type' => 'Reference',
    255255      'Table' => 'PermissionGroup',
     
    258258      'Filter' => '1',
    259259    ));
    260     $this->System->FormManager->RegisterFormType('TPermissionGroupAssignment', array(
     260    Core::Cast($this->System)->FormManager->RegisterFormType('TPermissionGroupAssignment', array(
    261261      'Type' => 'Reference',
    262262      'Table' => 'PermissionGroupAssignment',
     
    265265      'Filter' => '1',
    266266    ));
    267     $this->System->FormManager->RegisterFormType('TPermissionOperation', array(
     267    Core::Cast($this->System)->FormManager->RegisterFormType('TPermissionOperation', array(
    268268      'Type' => 'Reference',
    269269      'Table' => 'PermissionOperation',
     
    288288  function TopBarCallback()
    289289  {
    290     if ($this->System->User->User['Id'] == null)
     290    if (Core::Cast($this->System)->User->User['Id'] == null)
    291291    {
    292292      $Output = '<a href="'.$this->System->Link('/user/?Action=LoginForm').'">Přihlášení</a> '.
     
    294294    } else
    295295    {
    296       $Output = $this->System->User->User['Name'].
     296      $Output = Core::Cast($this->System)->User->User['Name'].
    297297        ' <a href="'.$this->System->Link('/user/?Action=UserMenu').'">Nabídka</a>'.
    298298        ' <a href="'.$this->System->Link('/user/?Action=Logout').'">Odhlásit</a>';
Note: See TracChangeset for help on using the changeset viewer.