Changeset 817
- Timestamp:
- Mar 16, 2016, 8:51:59 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/FormClasses.php
r786 r817 143 143 'States' => array('<span style="color:red;">Nedostupný</span>', '<span style="color:green;">Dostupný</span>'), 144 144 ), 145 'TNetworkConfigurationState' => array(146 'Type' => 'Enumeration',147 'States' => array('Neplánováno', 'V plánu', 'Provádí se'),148 ),149 145 'TAntennaPolarity' => array( 150 146 'Type' => 'Enumeration', -
trunk/Application/UpdateTrace.php
r814 r817 1970 1970 $Manager->Execute('ALTER TABLE `NetworkDevice` CHANGE `LastOnline` `LastOnline` DATETIME NULL;'); 1971 1971 $Manager->Execute('UPDATE `NetworkDevice` SET `LastOnline` = NULL WHERE `LastOnline` = "0000-00-00 00:00:00"'); 1972 } 1973 1974 function UpdateTo817($Manager) 1975 { 1976 $Manager->Execute('ALTER TABLE `NetworkConfiguration` ADD `SysName` VARCHAR(255) NOT NULL FIRST;'); 1977 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="LinuxDNS" WHERE `Id`=1'); 1978 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="LinuxIptables" WHERE `Id`=2'); 1979 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="LinuxTrafficShaping" WHERE `Id`=3'); 1980 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="LinuxDHCP" WHERE `Id`=4'); 1981 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="LinuxVPN" WHERE `Id`=5'); 1982 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosDHCP" WHERE `Id`=7'); 1983 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosNetwatch" WHERE `Id`=8'); 1984 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosQueue" WHERE `Id`=9'); 1985 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosFirewallNAT" WHERE `Id`=10'); 1986 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosFirewallMangle" WHERE `Id`=11'); 1987 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosFirewallFilter" WHERE `Id`=12'); 1988 $Manager->Execute('UPDATE `NetworkConfiguration` SET `SysName`="RouterosDNS" WHERE `Id`=13'); 1989 $Manager->Execute('ALTER TABLE `NetworkConfiguration` DROP `Execute`;'); 1972 1990 } 1973 1991 … … 2061 2079 807 => array('Revision' => 808, 'Function' => 'UpdateTo808'), 2062 2080 808 => array('Revision' => 814, 'Function' => 'UpdateTo814'), 2081 814 => array('Revision' => 817, 'Function' => 'UpdateTo817'), 2063 2082 )); 2064 2083 } -
trunk/Application/Version.php
r815 r817 1 1 <?php 2 2 3 $Revision = 81 5; // Subversion revision4 $DatabaseRevision = 81 4; // SQL structure revision5 $ReleaseTime = strtotime('2016-03- 09');3 $Revision = 817; // Subversion revision 4 $DatabaseRevision = 817; // SQL structure revision 5 $ReleaseTime = strtotime('2016-03-16'); -
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 { -
trunk/Packages/Common/AppModule.php
r791 r817 69 69 $this->License = ''; 70 70 $this->Version = ''; 71 $this->Creator = '';72 71 $this->Description = ''; 73 72 $this->Dependencies = array(); 74 73 $this->Type = ModuleType::Normal; 75 74 } 76 75 77 76 function Install() 78 77 { -
trunk/Packages/Common/Application.php
r790 r817 1 1 <?php 2 3 class ModelDef 4 { 5 var $OnChange; 6 7 function __construct() 8 { 9 $this->OnChange = array(); 10 } 11 12 function DoOnChange() 13 { 14 foreach($this->OnChange as $Callback) 15 { 16 call_user_func($Callback); 17 } 18 } 19 20 function RegisterOnChange($SysName, $Callback) 21 { 22 $this->OnChange[$SysName] = $Callback; 23 } 24 25 function UnregisterOnChange($SysName) 26 { 27 unset($this->OnChange[$SysName]); 28 } 29 } 2 30 3 31 class Application extends System … … 7 35 var $ModuleManager; 8 36 var $Modules; 9 37 var $Models; 38 10 39 function __construct() 11 40 { … … 14 43 $this->ModuleManager = new AppModuleManager($this); 15 44 $this->Modules = array(); 45 $this->Models = array(); 46 } 47 48 function RegisterModel($SysName, $Model) 49 { 50 $NewModelDef = new ModelDef(); 51 $NewModelDef->Title = $Model['Title']; 52 $this->Models[$SysName] = $NewModelDef; 16 53 } 17 54 55 function UnregisterModel($SysName) 56 { 57 unset($this->Models[$SysName]); 58 } 59 18 60 function Run() 19 61 {
Note:
See TracChangeset
for help on using the changeset viewer.