- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php
r874 r887 18 18 class ModuleNetworkConfigRouterOS extends AppModule 19 19 { 20 function __construct( $System)20 function __construct(System $System) 21 21 { 22 22 parent::__construct($System); … … 29 29 } 30 30 31 function DoInstall() 31 function DoInstall(): void 32 32 { 33 33 } 34 34 35 function DoUnInstall() 35 function DoUnInstall(): void 36 36 { 37 37 } 38 38 39 function DoStart() 39 function DoStart(): void 40 40 { 41 41 $this->System->Pages['zdarma'] = 'PageFreeAccess'; 42 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-dns', 'ConfigRouterOSDNS');43 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-dhcp', 'ConfigRouterOSDHCP');44 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-signal', 'ConfigRouterOSSignal');45 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-netwatch', 'ConfigRouterOSNetwatch');46 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-netwatch-import', 'ConfigRouterOSNetwatchImport');47 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-firewall-filter', 'ConfigRouterOSFirewallFilter');48 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-firewall-nat', 'ConfigRouterOSFirewallNAT');49 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-firewall-mangle', 'ConfigRouterOSFirewallMangle');50 $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('routeros-queue', 'ConfigRouterOSQueue');42 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-dns', 'ConfigRouterOSDNS'); 43 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-dhcp', 'ConfigRouterOSDHCP'); 44 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-signal', 'ConfigRouterOSSignal'); 45 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-netwatch', 'ConfigRouterOSNetwatch'); 46 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-netwatch-import', 'ConfigRouterOSNetwatchImport'); 47 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-firewall-filter', 'ConfigRouterOSFirewallFilter'); 48 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-firewall-nat', 'ConfigRouterOSFirewallNAT'); 49 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-firewall-mangle', 'ConfigRouterOSFirewallMangle'); 50 ModuleNetworkConfig::Cast($this->System->GetModule('NetworkConfig'))->RegisterConfigItem('routeros-queue', 'ConfigRouterOSQueue'); 51 51 } 52 52 } … … 54 54 class PageFreeAccess extends Page 55 55 { 56 var $FullTitle = 'Přístup zdarma k Internetu'; 57 var $ShortTitle = 'Internet zdarma'; 58 var $ParentClass = 'PagePortal'; 59 var $AddressList = 'free-access'; 60 var $Timeout; 56 public string $AddressList = 'free-access'; 57 public int $Timeout; 61 58 62 function __construct( $System)59 function __construct(System $System) 63 60 { 64 61 parent::__construct($System); 62 $this->FullTitle = 'Přístup zdarma k Internetu'; 63 $this->ShortTitle = 'Internet zdarma'; 64 $this->ParentClass = 'PagePortal'; 65 65 66 $this->Timeout = 24 * 60 * 60; 66 67 } 67 68 68 function Show() 69 function Show(): string 69 70 { 70 71 $IPAddress = GetRemoteAddress(); 71 72 $Output = 'Vaše IP adresa je: '.$IPAddress.'<br/>'; 72 if (IsInternetAddr($IPAddress)) { 73 if (IsInternetAddr($IPAddress)) 74 { 73 75 $Output .= '<p>Internet zdarma je dostupný pouze z vnitřní sítě.</p>'; 74 76 return $Output; … … 117 119 class ScheduleConfigureFreeAccess extends SchedulerTask 118 120 { 119 function Execute() 121 function Execute(): string 120 122 { 121 123 $Output = '';
Note:
See TracChangeset
for help on using the changeset viewer.