Changeset 663
- Timestamp:
- Jun 3, 2014, 10:36:43 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r662 r663 1 1 <?php 2 2 3 $Revision = 66 2; // Subversion revision3 $Revision = 663; // Subversion revision 4 4 $DatabaseRevision = 662; // SQL structure revision 5 $ReleaseTime = strtotime('2014-0 5-31');5 $ReleaseTime = strtotime('2014-06-03'); -
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r658 r663 30 30 else $Online = 0; 31 31 32 $DbResult = $System->Database->select('NetworkInterface', '`Id`,`Online`', '`LocalIP` = "'.$Properties['host'].'";');33 while($DbRow = $DbResult->fetch_assoc())34 {35 $LastOnline = $DbRow['Online'];36 $Interface = $DbRow['Id'];37 38 // Record state changes39 if($Online != $LastOnline)40 {41 $System->Database->insert('NetworkInterfaceUpDown', array(42 'Interface' => $Interface, 'State' => $Online, 'Time' => TimeToMysqlDateTime($StartTime)));43 }44 }45 46 32 if($Online) 47 33 { 34 // Set only online state 35 $DbResult = $System->Database->select('NetworkInterface', '`Id`, `Online`', '`LocalIP` = "'.$Properties['host'].'";'); 36 while($DbRow = $DbResult->fetch_assoc()) 37 { 38 $LastOnline = $DbRow['Online']; 39 $Interface = $DbRow['Id']; 40 41 // Record state changes 42 if($Online != $LastOnline) 43 { 44 $System->Database->insert('NetworkInterfaceUpDown', array( 45 'Interface' => $Interface, 'State' => $Online, 'Time' => TimeToMysqlDateTime($StartTime))); 46 } 47 } 48 48 49 $DbResult = $System->Database->update('NetworkInterface', '`LocalIP` = "'.$Properties['host'].'"', 49 50 array('Online' => 1, 'LastOnline' => TimeToMysqlDateTime($StartTime))); 50 51 } 51 52 } 53 } 54 55 // Set offline state for not updated interfaces 56 $DbResult = $System->Database->select('NetworkInterface', 'Id', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"'); 57 while($DbRow = $DbResult->fetch_assoc()) 58 { 59 $System->Database->insert('NetworkInterfaceUpDown', array( 60 'Interface' => $DbRow['Id'], 'State' => 0, 'Time' => TimeToMysqlDateTime($StartTime))); 52 61 } 53 62 $DbResult = $System->Database->update('NetworkInterface', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
Note:
See TracChangeset
for help on using the changeset viewer.