- Timestamp:
- Oct 2, 2010, 4:24:15 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/block/index.php
r163 r291 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html><head> 3 <meta http-equiv="Content-Language" content="cs"> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <title>Centrála - Nepovolený přístup</title> 6 </head><body> 1 <?php 2 include_once('../global.php'); 7 3 8 Pokračujte na hlavní stránku serveru Centrála <a href="http://centrala.zdechov.net/">zde</a> 9 </body></html> 4 class BlockPage extends Page 5 { 6 var $FullTitle = 'Blokování internetu'; 7 var $ShortTitle = 'Blokování internetu'; 8 var $Reasons = array( 9 0 => 'Internet máte povolen, avšak došlo k chybě při kontrole přístupů k Internetu.', 10 1 => 'Váš počítač má blokován přístup k internetu. Pravděpodobně je váš účet v mínusu.', 11 2 => 'Váš účet je v mínusu. Zaplaťte prosím chybějící peníze.', 12 3 => 'Přistupovat k internetu můžete pouze pomocí VPN(Virtuální Privátní Sítě). Aktivujte toto připojení.', 13 4 => 'Váš počítač není registrován. Zaregistrujte jej prosím.' 14 ); 15 16 function Show() 17 { 18 $Output = '<br/><div style="font-size: 20 pt;">Máte blokován přístup k Internetu.</div> 19 <br/> 20 <strong>Důvod:</strong> '; 21 22 $DbResult = $this->Database->query('SELECT * FROM NetworkInterface WHERE LocalIP="'.$_SERVER['REMOTE_ADDR'].'"'); 23 if($DbResult->num_rows > 0) 24 { 25 $Interface = $DbResult->fetch_array(); 26 $DbResult = $this->Database->select('NetworkDevice', '*', 'Id='.$Interface['Device']); 27 $Device = $DbResult->fetch_array(); 28 $DbResult = $this->Database->select('Member', '*', 'Id='.$Device['Member']); 29 $Member = $DbResult->fetch_array(); 30 31 if($Member['Blocked'] == 1) 32 { 33 $Output .= $this->Reasons[1]; 34 } else $Output .= $this->Reasons[0]; 35 } else $Output .= $this->Reasons[4]; 36 37 $Output .= '<br><br>V případě problémů kontaktujte správce na telefonu 737785792<br/><br/>'; 38 $Output .= 'Pokračujte na portál sítě <a href="http://centrala.zdechov.net/">centrala.zdechov.net</a> 39 </body></html>'; 40 return($Output); 41 } 42 } 43 44 $System->AddModule(new BlockPage()); 45 $System->Modules['BlockPage']->GetOutput(); 46 47 ?> -
trunk/index.php
r263 r291 44 44 $OnlineComputers = $DbRow[0]; 45 45 46 $Output = '<img alt="" src="images/favicons/comp. gif" width="16" height="16" /> '.$OnlineComputers.' / '.$TotalComputers.' ';46 $Output = '<img alt="" src="images/favicons/comp.png" width="16" height="16" /> '.$OnlineComputers.' / '.$TotalComputers.' '; 47 47 48 48 $DbResult = $this->Database->select('Member', 'COUNT(*)', 'MemberState=0'); … … 54 54 $OnlineUser = $DbRow[0]; 55 55 56 $Output .= '<img alt="" src="images/favicons/house. gif" width="16" height="16" /> '.$OnlineUser.' / '.$TotalUser.' ';56 $Output .= '<img alt="" src="images/favicons/house.png" width="16" height="16" /> '.$OnlineUser.' / '.$TotalUser.' '; 57 57 58 58 $NetworkUsage = 0; 59 $Output .= '<img alt="" src="images/favicons/usage. gif" width="16" height="16" /> '.$NetworkUsage.' % ';59 $Output .= '<img alt="" src="images/favicons/usage.png" width="16" height="16" /> '.$NetworkUsage.' % '; 60 60 61 61 //$Output .= 'Server běží: '.$this->GetServerUptime().' '; … … 67 67 { 68 68 $DbRow = $DbResult->fetch_assoc(); 69 $Output2 .= ' <img alt="" src="images/favicons/money. gif" width="16" height="16" /> '.$DbRow['Money'].' Kč';69 $Output2 .= ' <img alt="" src="images/favicons/money.png" width="16" height="16" /> '.$DbRow['Money'].' Kč'; 70 70 } 71 71 } -
trunk/system/generators/firewall_nat.php
r288 r291 13 13 14 14 $InetInterface = $Config['MainRouter']['InetInterface']; 15 $IPCentrala = '10.145.64.8'; 15 16 16 17 $Items = array(); 18 19 /* 17 20 // NTP redirect 18 21 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.1', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_4'); … … 22 25 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.250', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_3'); 23 26 $Items[] = array('chain' => 'srcnat', 'src-address' => '10.145.66.253', 'protocol' => 'udp', 'src-port' => 123, 'action' => 'src-nat', 'to-addresses' => '10.145.64.1', 'comment' => 'NTP_redirect_6'); 27 */ 24 28 25 29 // Chain for inet interface … … 43 47 $Name = RouterOSIdent($Name); 44 48 echo($Name.'('.$Interface['LocalIP'].'), '); 45 $Items[] = array('chain' => 'inet-out', 'src-address' => $Interface['LocalIP'], 'action' => 'src-nat', 'to-addresses' => $Interface['ExternalIP'], 'comment' => $Name.'-out'); 46 $Items[] = array('chain' => 'inet-in', 'dst-address' => $Interface['ExternalIP'], 'action' => 'dst-nat', 'to-addresses' => $Interface['LocalIP'], 'comment' => $Name.'-in'); 49 if($Member['Blocked'] == 0) 50 { 51 $Items[] = array('chain' => 'inet-out', 'src-address' => $Interface['LocalIP'], 'action' => 'src-nat', 'to-addresses' => $Interface['ExternalIP'], 'comment' => $Name.'-out'); 52 $Items[] = array('chain' => 'inet-in', 'dst-address' => $Interface['ExternalIP'], 'action' => 'dst-nat', 'to-addresses' => $Interface['LocalIP'], 'comment' => $Name.'-in'); 53 } else 54 { 55 $Items[] = array('chain' => 'dstnat', 'src-address' => $Interface['LocalIP'], 'dst-port' => 80, 'action' => 'dst-nat', 'to-addresses' => $IPCentrala, 'to-ports' => 81, 'comment' => $Name.'-out'); 56 } 47 57 } 48 58 … … 53 63 $Subnet['Name'] = RouterOSIdent('subnet-'.$Subnet['Name']); 54 64 echo($Subnet['Name'].'('.$Subnet['AddressRange'].'/'.$Subnet['Mask'].'), '); 55 $NewAddress = new NetworkAddressIPv4(); 56 $NewAddress->AddressFromString($Subnet['ExtAddressRange']); 57 $NewAddress->Prefix = $Subnet['ExtMask']; 58 $Range = $NewAddress->GetRange(); 59 if($Subnet['ExtMask'] != 32) $Range = $Range['From']->AddressToString().'-'.$Range['To']->AddressToString(); 60 else $Range = $Range['From']->AddressToString(); 61 if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange']; 62 else $Src = $Subnet['AddressRange'].'/'.$Subnet['Mask']; 63 $Items[] = array('chain' => 'inet-out', 'src-address' => $Src, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-out'); 65 if($Member['Blocked'] == 0) 66 { 67 $NewAddress = new NetworkAddressIPv4(); 68 $NewAddress->AddressFromString($Subnet['ExtAddressRange']); 69 $NewAddress->Prefix = $Subnet['ExtMask']; 70 $Range = $NewAddress->GetRange(); 71 if($Subnet['ExtMask'] != 32) $Range = $Range['From']->AddressToString().'-'.$Range['To']->AddressToString(); 72 else $Range = $Range['From']->AddressToString(); 73 if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange']; 74 else $Src = $Subnet['AddressRange'].'/'.$Subnet['Mask']; 75 $Items[] = array('chain' => 'inet-out', 'src-address' => $Src, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-out'); 64 76 65 $NewAddress = new NetworkAddressIPv4(); 66 $NewAddress->AddressFromString($Subnet['AddressRange']); 67 $NewAddress->Prefix = $Subnet['Mask']; 68 $Range = $NewAddress->GetRange(); 69 if($Subnet['Mask'] != 32) $Range = $Range['From']->AddressToString().'-'.$Range['To']->AddressToString(); 70 else $Range = $Range['From']->AddressToString(); 71 if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange']; 72 else $Dest = $Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask']; 73 $Items[] = array('chain' => 'inet-in', 'dst-address' => $Dest, 'action' => 'dst-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-in'); 77 $NewAddress = new NetworkAddressIPv4(); 78 $NewAddress->AddressFromString($Subnet['AddressRange']); 79 $NewAddress->Prefix = $Subnet['Mask']; 80 $Range = $NewAddress->GetRange(); 81 if($Subnet['Mask'] != 32) $Range = $Range['From']->AddressToString().'-'.$Range['To']->AddressToString(); 82 else $Range = $Range['From']->AddressToString(); 83 if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange']; 84 else $Dest = $Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask']; 85 $Items[] = array('chain' => 'inet-in', 'dst-address' => $Dest, 'action' => 'dst-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-in'); 86 } else 87 { 88 if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange']; 89 else $Src = $Subnet['AddressRange'].'/'.$Subnet['Mask']; 90 $Items[] = array('chain' => 'dstnat', 'src-address' => $Src, 'dst-port' => 80, 'action' => 'dst-nat', 'to-addresses' => $IPCentrala, 'to-ports' => 81, 'comment' => $Subnet['Name'].'-out'); 91 } 74 92 } 75 93 echo("\n");
Note:
See TracChangeset
for help on using the changeset viewer.