Changeset 575
- Timestamp:
- Oct 2, 2013, 8:26:20 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Update.php
r548 r575 250 250 if($Def['Type'] == 'Password') $Output .= '<input type="password" name="'.$Def['Name'].'"/>'; 251 251 if($Def['Type'] == 'Integer') $Output .= '<input type="text" name="'.$Def['Name'].'" value="'.$Value.'"/>'; 252 if($Def['Type'] == 'Float') $Output .= '<input type="text" name="'.$Def['Name'].'" value="'.$Value.'"/>'; 252 253 if($Def['Type'] == 'Boolean') $Output .= '<input type="text" name="'.$Def['Name'].'" value="'.$Value.'"/>'; 253 254 } … … 270 271 $Value = $_POST[$Def['Name']]; 271 272 if($Def['Type'] == 'Integer') if(array_key_exists($Def['Name'], $_POST)) 273 $Value = $_POST[$Def['Name']]; 274 if($Def['Type'] == 'Float') if(array_key_exists($Def['Name'], $_POST)) 272 275 $Value = $_POST[$Def['Name']]; 273 276 if($Def['Type'] == 'Boolean') if(array_key_exists($Def['Name'], $_POST)) -
trunk/Common/Version.php
r574 r575 1 1 <?php 2 2 3 $Revision = 57 4; // Subversion revision3 $Revision = 575; // Subversion revision 4 4 $DatabaseRevision = 574; // SQL structure revision 5 $ReleaseTime = '2013- 09-29';5 $ReleaseTime = '2013-10-02'; -
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r548 r575 12 12 $StartTime = time(); 13 13 14 // Load netwatch status from all DHCP routers 14 15 $DbResult3 = $System->Database->query('SELECT DHCP, AddressRange, Mask FROM `NetworkSubnet` WHERE (`Configure` = 1) AND (`Member` IS NULL) GROUP BY DHCP'); 15 //echo($DbResult3->num_rows);16 16 while($Subnet = $DbResult3->fetch_assoc()) 17 17 { … … 24 24 foreach($List as $Properties) 25 25 { 26 //echo($Properties['host'].', ');27 26 if($Properties['status'] == 'up') 28 27 { 29 $Online = 1; 30 $Values = array('Online' => $Online, 'LastOnline' => 'NOW()'); 31 //echo($Properties['host']." up\n"); 32 } else 33 { 34 $Online = 0; 35 $Values = array('Online' => $Online); 36 //echo($Properties['host']." down\n"); 37 } 38 39 $DbResult = $System->Database->update('NetworkInterface', '`LocalIP` = "'.$Properties['host'].'"', $Values); 28 $DbResult = $System->Database->update('NetworkInterface', '`LocalIP` = "'.$Properties['host'].'"', 29 array('Online' => $Online, 'LastOnline' => TimeToMysqlDateTime($StartTime))); 30 } 40 31 } 41 } 32 } 33 $DbResult = $System->Database->update('NetworkInterface', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0)); 42 34 43 35 // Update device online state 44 $DbResult = $System->Database->select('Network Device', 'Id', '`Used`=1');36 $DbResult = $System->Database->select('NetworkInterface', '`Device`, SUM(`Online`) AS `SumOnline`', '`Online` = 1 GROUP BY `Device`'); 45 37 while($Device = $DbResult->fetch_assoc()) 46 38 { 47 $DbResult2 = $System->Database->select('NetworkInterface', 'SUM(`Online`) AS `SumOnline`', '`Device`='.$Device['Id']); 48 $DbRow = $DbResult2->fetch_array(); 49 if($DbRow['SumOnline'] > 0) $Online = 1; 50 else $Online = 0; 51 $Values = array('Online' => $Online); 52 if($Online == 1) $Values['LastOnline'] = 'NOW()'; 53 $System->Database->update('NetworkDevice', 'Id='.$Device['Id'], $Values); 39 if($Device['SumOnline'] > 0) 40 $System->Database->update('NetworkDevice', 'Id='.$Device['Device'], array('LastOnline' => TimeToMysqlDateTime($StartTime))); 54 41 } 42 $DbResult = $System->Database->update('NetworkDevice', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0)); 55 43 56 44 // Update interface online statistics
Note:
See TracChangeset
for help on using the changeset viewer.