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

Legend:

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

    r8 r10  
    2323    $Query = 'SELECT `Contact`.`Value`, `Contact`.`Description`, (SELECT `Name` FROM `ContactCategory` WHERE `ContactCategory`.`Id` = `Contact`.`Category`) AS `Category` '.
    2424      'FROM `Contact` WHERE `User` = '.
    25       $this->System->User->User['Id'];
     25      Core::Cast($this->System)->User->User['Id'];
    2626    $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T');
    2727    $DbRow = $DbResult->fetch_row();
     
    6060  {
    6161    $Output = '';
    62     if ($this->System->User->User['Id'] != null)
     62    if (Core::Cast($this->System)->User->User['Id'] != null)
    6363    {
    6464      $Actions = '';
     
    7575      $Output .= $this->Panel('Nabídka uživatele', $Actions);
    7676      $Output .= '</td><td style="vertical-align:top;">';
    77       if ($this->System->User->User['Id'] != null)
    78         {
    79           $Form = new Form($this->System->FormManager);
     77      if (Core::Cast($this->System)->User->User['Id'] != null)
     78        {
     79          $Form = new Form(Core::Cast($this->System)->FormManager);
    8080          $Form->SetClass('UserOptions');
    81           $Form->LoadValuesFromDatabase($this->System->User->User['Id']);
     81          $Form->LoadValuesFromDatabase(Core::Cast($this->System)->User->User['Id']);
    8282          $Form->OnSubmit = '?Action=UserOptionsSave';
    8383          $Output .= $Form->ShowViewForm();
     
    100100      if ($Action == 'LoginForm')
    101101      {
    102         $Form = new Form($this->System->FormManager);
     102        $Form = new Form(Core::Cast($this->System)->FormManager);
    103103        $Form->SetClass('UserLogin');
    104104        $Form->OnSubmit = '?Action=Login';
     
    111111        if (array_key_exists('Username', $_POST) and array_key_exists('Password', $_POST))
    112112        {
    113           $Form = new Form($this->System->FormManager);
     113          $Form = new Form(Core::Cast($this->System)->FormManager);
    114114          $Form->SetClass('UserLogin');
    115115          $Form->OnSubmit = '?Action=Login';
    116116          if (array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true;
    117117            else $StayLogged = false;
    118           $Result = $this->System->User->Login($_POST['Username'], $_POST['Password'], $StayLogged);
     118          $Result = Core::Cast($this->System)->User->Login($_POST['Username'], $_POST['Password'], $StayLogged);
    119119          $Output .= $this->SystemMessage('Přihlášení', $Result);
    120120          if ($Result <> USER_LOGGED_IN)
     
    134134      if ($Action == 'Logout')
    135135      {
    136         if ($this->System->User->User['Id'] != null)
    137         {
    138           $Output .= $this->SystemMessage('Odhlášení', $this->System->User->Logout());
     136        if (Core::Cast($this->System)->User->User['Id'] != null)
     137        {
     138          $Output .= $this->SystemMessage('Odhlášení', Core::Cast($this->System)->User->Logout());
    139139        } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen');
    140140      } else
    141141      if ($Action == 'UserOptions')
    142142      {
    143         if ($this->System->User->User['Id'] != null)
    144         {
    145           $Form = new Form($this->System->FormManager);
     143        if (Core::Cast($this->System)->User->User['Id'] != null)
     144        {
     145          $Form = new Form(Core::Cast($this->System)->FormManager);
    146146          $Form->SetClass('UserOptions');
    147           $Form->LoadValuesFromDatabase($this->System->User->User['Id']);
     147          $Form->LoadValuesFromDatabase(Core::Cast($this->System)->User->User['Id']);
    148148          $Form->OnSubmit = '?Action=UserOptionsSave';
    149149          $Output .= $Form->ShowEditForm();
     
    152152      if ($Action == 'UserOptionsSave')
    153153      {
    154         $Form = new Form($this->System->FormManager);
     154        $Form = new Form(Core::Cast($this->System)->FormManager);
    155155        $Form->SetClass('UserOptions');
    156156        $Form->LoadValuesFromForm();
    157         $Form->SaveValuesToDatabase($this->System->User->User['Id']);
     157        $Form->SaveValuesToDatabase(Core::Cast($this->System)->User->User['Id']);
    158158        $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.');
    159159        $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $Form->Values['Name']);
    160         $Form->LoadValuesFromDatabase($this->System->User->User['Id']);
     160        $Form->LoadValuesFromDatabase(Core::Cast($this->System)->User->User['Id']);
    161161        $Form->OnSubmit = '?Action=UserOptionsSave';
    162162        $Output .= $Form->ShowEditForm();
     
    164164      if ($Action == 'UserRegister')
    165165      {
    166         $Form = new Form($this->System->FormManager);
     166        $Form = new Form(Core::Cast($this->System)->FormManager);
    167167        $Form->SetClass('UserRegister');
    168168        //$Form->LoadValuesFromForm();
     
    173173      {
    174174        $Output .= $this->SystemMessage('Potvrzení registrace',
    175           $this->System->User->RegisterConfirm($_GET['User'], $_GET['H']));
     175        Core::Cast($this->System)->User->RegisterConfirm($_GET['User'], $_GET['H']));
    176176      } else
    177177      if ($Action == 'PasswordRecovery')
    178178      {
    179         $Form = new Form($this->System->FormManager);
     179        $Form = new Form(Core::Cast($this->System)->FormManager);
    180180        $Form->SetClass('PasswordRecovery');
    181181        $Form->OnSubmit = '?Action=PasswordRecovery2';
     
    184184      if ($Action == 'PasswordRecovery2')
    185185      {
    186         $Form = new Form($this->System->FormManager);
     186        $Form = new Form(Core::Cast($this->System)->FormManager);
    187187        $Form->SetClass('PasswordRecovery');
    188188        $Form->LoadValuesFromForm();
    189         $Result = $this->System->User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     189        $Result = Core::Cast($this->System)->User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    190190        $Output .= $this->SystemMessage('Obnova hesla', $Result);
    191191        if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
     
    196196      if ($Action == 'PasswordRecoveryConfirm')
    197197      {
    198         $Output .= $this->SystemMessage('Obnova hesla', $this->System->User->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
     198        $Output .= $this->SystemMessage('Obnova hesla', Core::Cast($this->System)->User->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
    199199      } else
    200200      if ($Action == 'UserRegisterSave')
    201201      {
    202         $Form = new Form($this->System->FormManager);
     202        $Form = new Form(Core::Cast($this->System)->FormManager);
    203203        $Form->SetClass('UserRegister');
    204204        $Form->LoadValuesFromForm();
    205         $Result = $this->System->User->Register($Form->Values['Login'], $Form->Values['Password'],
     205        $Result = Core::Cast($this->System)->User->Register($Form->Values['Login'], $Form->Values['Password'],
    206206          $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']);
    207207        $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
Note: See TracChangeset for help on using the changeset viewer.