Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (21 months ago)
Author:
chronos
Message:
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/FrontPage/FrontPage.php

    r888 r893  
    2929  function HandleLoginForm()
    3030  {
     31    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    3132    global $Message, $MessageType;
    3233
     
    3940          if (array_key_exists('StayLogged', $_POST)) $StayLogged = true;
    4041            else $StayLogged = false;
    41           $this->System->User->Login($_POST['LoginUser'], $_POST['LoginPass'], $StayLogged);
    42           if ($this->System->User->Role == LICENCE_ANONYMOUS)
     42          $User->Login($_POST['LoginUser'], $_POST['LoginPass'], $StayLogged);
     43          if ($User->Role == LICENCE_ANONYMOUS)
    4344          {
    4445            $Message = T('Incorrect name or password');
     
    4647          } else
    4748          {
    48             $Message = sprintf(T('Login successful. Welcome <strong>%s</strong>!'), $this->System->User->Name);
     49            $Message = sprintf(T('Login successful. Welcome <strong>%s</strong>!'), $User->Name);
    4950            $MessageType = MESSAGE_INFORMATION;
    5051          }
     
    5556        }
    5657      } else
    57         if ($_GET['action'] == 'logout')
     58      if ($_GET['action'] == 'logout')
     59      {
     60        if ($User->Role != LICENCE_ANONYMOUS)
    5861        {
    59           if ($this->System->User->Role != LICENCE_ANONYMOUS)
    60           {
    61             $this->System->ModuleManager->Modules['Log']->WriteLog('Odhlášení', LOG_TYPE_USER);
    62             $this->System->User->Logout();
    63             $Message = T('You were logged out');
    64             $MessageType = MESSAGE_INFORMATION;
    65           }
     62          ModuleLog::Cast($this->System->GetModule('Log'))->WriteLog('Odhlášení', LOG_TYPE_USER);
     63          $User->Logout();
     64          $Message = T('You were logged out');
     65          $MessageType = MESSAGE_INFORMATION;
    6666        }
     67      }
    6768    }
    6869  }
     
    123124    // Echo text even if it is hidden because of caching by external searching engines
    124125    return '<div style="'.$HideWelcome.'">'.
    125       '<div id="bannertitle">'.$this->System->Config['Web']['Title'].'</div>'.
     126      '<div id="bannertitle">'.Core::Cast($this->System)->Config['Web']['Title'].'</div>'.
    126127      T('Open web system for translation texts from game World of Warcraft (WoW).<br/>'.
    127128      '<ul>'.
Note: See TracChangeset for help on using the changeset viewer.