Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (14 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/Referrer/Referrer.php

    r891 r893  
    2020  function DoStart(): void
    2121  {
    22     $this->Excludes[] = $this->System->Config['Web']['Host'];
     22    $this->Excludes[] = Core::Cast($this->System)->Config['Web']['Host'];
    2323    $this->Log();
    2424    $this->System->RegisterPage(['referrer'], 'PageReferrer');
     
    7777  function ShowList()
    7878  {
    79     $Banner = '<a href="https://'.$this->System->Config['Web']['Host'].$this->System->Link('/').'">'.
    80       '<img src="https://'.$this->System->Config['Web']['Host'].$this->System->Link('/banners/wowpreklad_big.jpg').'" '.
     79    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     80    $Banner = '<a href="https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/').'">'.
     81      '<img src="https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/banners/wowpreklad_big.jpg').'" '.
    8182      'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
    8283      'class="banner" height="60" width="468" /></a>';
    8384
    84     $BannerSmall = '<a href="https://'.$this->System->Config['Web']['Host'].$this->System->Link('/').'">'.
    85       '<img src="https://'.$this->System->Config['Web']['Host'].$this->System->Link('/banners/wowpreklad_small.jpg').'" '.
     85    $BannerSmall = '<a href="https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/').'">'.
     86      '<img src="https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/banners/wowpreklad_small.jpg').'" '.
    8687      'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
    8788      'class="banner" height="31" width="88" /></a>';
     
    9293    $Output .= $BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />';
    9394
    94     if ($this->System->User->Licence(LICENCE_ADMIN)) {
     95    if ($User->Licence(LICENCE_ADMIN)) {
    9596
    9697    $MonthAge = 3;
     
    99100    <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců řazený sestupně dle nejnovějších.</div><br />';
    100101
    101     if (!$this->System->User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';
     102    if (!$User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';
    102103    else $Where = '';
    103104    $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '.
     
    123124        array('Name' => 'TotalHits', 'Title' => T('Hits')),
    124125    );
    125     if ($this->System->User->Licence(LICENCE_ADMIN))
     126    if ($User->Licence(LICENCE_ADMIN))
    126127    {
    127128      $TableColumns[] = array('Name' => 'Visible', 'Title' => T('Visible'));
     
    142143          '<td>'.HumanDate($Line['MaxDateLast']).'</td>'.
    143144          '<td>'.$Line['TotalHits'].'</td>';
    144       if ($this->System->User->Licence(LICENCE_ADMIN))
     145      if ($User->Licence(LICENCE_ADMIN))
    145146      {
    146147        $Output .=
     
    183184  function Spam()
    184185  {
    185     if ($this->System->User->Licence(LICENCE_ADMIN))
     186    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     187    if ($User->Licence(LICENCE_ADMIN))
    186188    {
    187189      if (array_key_exists('id', $_GET))
     
    207209  function Edit()
    208210  {
    209     if ($this->System->User->Licence(LICENCE_ADMIN))
     211    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     212    if ($User->Licence(LICENCE_ADMIN))
    210213    {
    211214      if (array_key_exists('id', $_GET))
     
    232235  function EditSave()
    233236  {
    234     if ($this->System->User->Licence(LICENCE_ADMIN))
     237    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     238    if ($User->Licence(LICENCE_ADMIN))
    235239    {
    236240      if ($_POST['Parent'] == '') $_POST['Parent'] = null;
Note: See TracChangeset for help on using the changeset viewer.