Changeset 817 for trunk/Modules
- Timestamp:
- Mar 16, 2016, 8:51:59 PM (9 years ago)
- Location:
- trunk/Modules
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Customer/Customer.php
r793 r817 13 13 $this->Dependencies = array('User'); 14 14 } 15 15 16 16 function DoStart() 17 17 { -
trunk/Modules/Network/Network.php
r815 r817 171 171 'API' => array('Type' => 'TDeviceAPIType', 'Caption' => 'API', 'Default' => '', 'Null' => true), 172 172 ), 173 'AfterInsert' => array($this, 'AfterInsertNetworkDevice'), 174 'AfterModify' => array($this, 'AfterModifyNetworkDevice'), 175 'AfterDelete' => array($this, 'AfterModifyNetworkDevice'), 173 176 )); 174 177 $this->System->FormManager->RegisterClass('NetworkDeviceType', array( … … 201 204 'Ports' => array('Type' => 'TDevicePortListInterface', 'Caption' => 'Síťové porty', 'Default' => ''), 202 205 ), 206 'AfterInsert' => array($this, 'AfterInsertNetworkInterface'), 207 'AfterModify' => array($this, 'AfterModifyNetworkInterface'), 208 'AfterDelete' => array($this, 'AfterModifyNetworkInterface'), 203 209 )); 204 210 $this->System->FormManager->RegisterClass('NetworkInterfaceType', array( … … 594 600 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Network', 595 601 array('ModuleNetwork', 'ShowDashboardItem')); 596 } 597 602 603 $this->System->RegisterModel('NetworkDevice', array( 604 'Title' => 'Síťové zařízení', 605 )); 606 $this->System->RegisterModel('NetworkInterface', array( 607 'Title' => 'Síťové rozhraní', 608 )); 609 } 610 611 function AfterInsertNetworkDevice($Form) 612 { 613 $this->System->Models['NetworkDevice']->DoOnChange(); 614 } 615 616 function AfterModifyNetworkDevice($Form, $Id) 617 { 618 $this->System->Models['NetworkDevice']->DoOnChange(); 619 } 620 621 function AfterInsertNetworkInterface($Form) 622 { 623 $this->System->Models['NetworkInterface']->DoOnChange(); 624 } 625 626 function AfterModifyNetworkInterface($Form, $Id) 627 { 628 $this->System->Models['NetworkInterface']->DoOnChange(); 629 } 630 598 631 function ShowDashboardItem() 599 632 { -
trunk/Modules/NetworkConfig/Generate.php
r790 r817 13 13 if($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period'])) 14 14 { 15 $System->Database->update('NetworkConfiguration', ' Id='.$Service['Id'], array('Changed' => 2));15 $System->Database->update('NetworkConfiguration', '`Id`='.$Service['Id'], array('Changed' => 2)); 16 16 $ExecutionStart = time(); 17 17 //echo($Service['Caption'].'...'); … … 27 27 //echo("Done\n"); 28 28 $ExecutionTime = time() - $ExecutionStart; 29 $System->Database->update('NetworkConfiguration', ' Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime));30 $System->Database->update('NetworkConfiguration', ' Id='.$Service['Id'], array('Log' => implode("\n", $Output)));29 $System->Database->update('NetworkConfiguration', '`Id`='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime)); 30 $System->Database->update('NetworkConfiguration', '`Id`='.$Service['Id'], array('Log' => implode("\n", $Output))); 31 31 } 32 32 } -
trunk/Modules/NetworkConfig/NetworkConfig.php
r781 r817 51 51 ), 52 52 )); 53 $this->System->FormManager->RegisterFormType('TNetworkConfigurationState', array( 54 'Type' => 'Enumeration', 55 'States' => array('Neplánováno', 'V plánu', 'Provádí se'), 56 )); 57 53 58 $this->System->RegisterCommandLine('config', array($this, 'Config')); 59 $this->System->Models['NetworkDevice']->RegisterOnChange('NetworkConfig', array($this, 'DoNetworkChange')); 60 $this->System->Models['NetworkInterface']->RegisterOnChange('NetworkConfig', array($this, 'DoNetworkChange')); 61 } 62 63 function DoNetworkChange() 64 { 65 $this->Database->query('UPDATE `NetworkConfiguration` SET `Changed`=1 WHERE '. 66 '(`Id`=1) OR (`Id`=7) OR (`Id`=8) OR (`Id`=9) OR (`Id`=10) OR (`Id`=11) OR (`Id`=12) OR (`Id`=13)'); 54 67 } 55 68 -
trunk/Modules/NetworkConfigRouterOS/Generators/DHCP.php
r781 r817 20 20 $Items = array(); 21 21 $Server = 'dhcp'.$Subnet['Id']; 22 $DbResult2 = $this->Database->query('SELECT NetworkInterface.*, NetworkDevice.Name AS DeviceName FROM `NetworkInterface` '. 23 ' LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device WHERE '. 24 ' CompareNetworkPrefix(INET_ATON(LocalIP), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].') AND (`MAC` != "00:00:00:00:00:00") ORDER BY `LocalIP`'); 22 $DbResult2 = $this->Database->query('SELECT `NetworkInterface`.*, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '. 23 'LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` '. 24 'WHERE CompareNetworkPrefix(INET_ATON(`LocalIP`), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].') '. 25 'AND (`MAC` != "00:00:00:00:00:00") ORDER BY `LocalIP`'); 25 26 while($Interface = $DbResult2->fetch_assoc()) 26 27 {
Note:
See TracChangeset
for help on using the changeset viewer.