Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (4 years ago)
Author:
chronos
Message:
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Network/UserHosts.php

    r874 r887  
    33class PageNetworkHostList extends Page
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1111  }
    1212
    13   function Show()
     13  function Show(): string
    1414  {
    1515    global $Config;
    1616
    17     if ($this->System->User->User['Id'] == '') return $this->SystemMessage('Nepovolený přístup', 'Nemáte oprávnění pro tuto operaci');
     17    if (ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id'] == '') return $this->SystemMessage('Nepovolený přístup', 'Nemáte oprávnění pro tuto operaci');
    1818    $Output = '<div align="center" style="font-size: small;"><table class="WideTable">';
    1919    $Output .= '<tr><th>Jméno počítače</th><th>Místní adresa</th><th>Veřejná adresa</th><th>Fyzická adresa</th><th>Typ</th><th>Naposledy online</th></tr>';
    2020    $DbResult = $this->Database->query('SELECT NetworkDevice.*, NetworkDeviceType.Name AS HostType FROM NetworkDevice '.
    2121      'LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type '.
    22       'WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = (SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->User->User['Id'].') ORDER BY NetworkDevice.Name');
     22      'WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = (SELECT Customer FROM UserCustomerRel WHERE User='.ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id'].') ORDER BY NetworkDevice.Name');
    2323    while ($Device = $DbResult->fetch_assoc())
    2424    {
Note: See TracChangeset for help on using the changeset viewer.