Changeset 873 for trunk/Modules/Network/HostList.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Network/HostList.php
r833 r873 11 11 function Show() 12 12 { 13 if (!$this->System->User->CheckPermission('Network', 'ShowHostList'))14 return ('Nemáte oprávnění');13 if (!$this->System->User->CheckPermission('Network', 'ShowHostList')) 14 return ('Nemáte oprávnění'); 15 15 16 if (array_key_exists('admin', $_GET)) $Where = 'AND NetworkDevice.Type IN (1,4,5) ';16 if (array_key_exists('admin', $_GET)) $Where = 'AND NetworkDevice.Type IN (1,4,5) '; 17 17 else $Where = ''; 18 18 $Output = '<div align="center" style="font-size: small;"><table class="WideTable">'; … … 22 22 'LEFT JOIN User ON Member.ResponsibleUser = User.Id '. 23 23 'LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE NetworkDevice.Used = 1 '.$Where.'ORDER BY NetworkDevice.Name'); 24 while ($Device = $DbResult->fetch_assoc())24 while ($Device = $DbResult->fetch_assoc()) 25 25 { 26 if ($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = '';26 if ($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = ''; 27 27 $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM NetworkInterface WHERE Device = '.$Device['Id']); 28 28 $DbRow = $DbResult2->fetch_row(); 29 if ($DbRow[0] == 1)29 if ($DbRow[0] == 1) 30 30 { 31 31 $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']); 32 32 $Interface = $DbResult2->fetch_assoc(); 33 if ($Interface['ExternalIP'] == '') $Interface['ExternalIP'] = ' ';34 if ($Interface['LocalIP'] == '') $Interface['LocalIP'] = ' ';35 if ($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';33 if ($Interface['ExternalIP'] == '') $Interface['ExternalIP'] = ' '; 34 if ($Interface['LocalIP'] == '') $Interface['LocalIP'] = ' '; 35 if ($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 36 36 $InterfaceName = $Device['Name']; 37 if ($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name'];37 if ($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name']; 38 38 $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$InterfaceName.'</td><td>'.$Interface['LocalIP'].'</td><td>'.$Interface['ExternalIP'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>'; 39 39 } else … … 41 41 $Output .= '<tr><td colspan="3" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>'; 42 42 $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']); 43 while ($Interface = $DbResult2->fetch_assoc())43 while ($Interface = $DbResult2->fetch_assoc()) 44 44 { 45 if ($Interface['LocalIP'] == '') $Interface['LocalIP'] = ' ';46 if ($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';45 if ($Interface['LocalIP'] == '') $Interface['LocalIP'] = ' '; 46 if ($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 47 47 $InterfaceName = $Device['Name']; 48 if ($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name'];48 if ($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name']; 49 49 $Output .= '<tr><td style="text-align: left; '.$Style.'"> '.$InterfaceName.'</td><td>'.$Interface['LocalIP'].'</td><td> </td><td> </td><td> </td><td> </td></tr>'; 50 50 } … … 52 52 } 53 53 $Output .= '</table></div>'; 54 return ($Output);54 return ($Output); 55 55 } 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.