Changeset 932
- Timestamp:
- May 11, 2022, 4:54:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigLinux/Generators/CheckPorts.php
r887 r932 10 10 else if ($Protocol == 'udp') $Prefix = 'udp://'; 11 11 else throw new Exception('Unsupported protocol "'.$Protocol.'"'); 12 if ($Socket = @fsockopen($Prefix.$IP, $Port, $ErrorNumber, $ErrorString, $Timeout))12 try 13 13 { 14 fclose($Socket); 15 $State = 1; 14 $LastErrorReporting = error_reporting(); 15 error_reporting(0); 16 if ($Socket = @fsockopen($Prefix.$IP, $Port, $ErrorNumber, $ErrorString, $Timeout)) 17 { 18 fclose($Socket); 19 $State = 1; 20 } 21 } 22 finally 23 { 24 error_reporting($LastErrorReporting); 16 25 } 17 26 return $State; … … 28 37 'FROM `NetworkPort` '. 29 38 'LEFT JOIN `NetworkInterface` ON `NetworkInterface`.`Id`=`NetworkPort`.`Interface` '. 30 'WHERE (`NetworkPort`.`Enabled`=1) AND (`NetworkInterface`.`LocalIP` !="")'); 39 'LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id`=`NetworkInterface`.`Device` '. 40 'WHERE (`NetworkPort`.`Enabled`=1) AND (`NetworkInterface`.`LocalIP` !="") AND (`NetworkInterface`.`Enabled`=1) AND'. 41 '(`NetworkDevice`.`Used`=1)'); 31 42 while ($DbRow = $DbResult->fetch_assoc()) 32 43 $Ports[$DbRow['Id']] = $DbRow;
Note:
See TracChangeset
for help on using the changeset viewer.