Ignore:
Timestamp:
May 8, 2019, 8:22:45 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Made some links to follow http/https protocol.
  • Modified: Simplified .htaccess.
Location:
trunk/Modules/NetworkConfigRouterOS
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/DHCP.php

    r817 r860  
    2828        $Name = $Interface['DeviceName'];
    2929        if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
    30         $Items[] = array('mac-address' => $Interface['MAC'], 'address' => $Interface['LocalIP'], 'server' => $Server, 'comment' => $Name);
     30        $Items[] = array('mac-address' => $Interface['MAC'], 'address' => $Interface['LocalIP'], 'server' => $Server, 'comment' => $Name, 'lease-time' => '24h');
    3131      }
    3232
  • trunk/Modules/NetworkConfigRouterOS/Generators/FirewallNAT.php

    r781 r860  
    110110
    111111    // Accept free-access clients
    112     $Items[] = array('chain' => 'dstnat', 'dst-address' => '!10.145.0.0/16',
    113         'src-address-list' => 'free-access', 'in-interface' => $LocalInterface,
    114         'action' => 'accept', 'comment' => 'Free_access');
     112    //$Items[] = array('chain' => 'dstnat', 'dst-address' => '!10.145.0.0/16',
     113    //    'src-address-list' => 'free-access', 'in-interface' => $LocalInterface,
     114    //    'action' => 'accept', 'comment' => 'Free_access');
    115115    // Redirect unregistred clients to free access activation page
    116     $Items[] = array('chain' => 'dstnat', 'dst-address' => '!10.145.0.0/16',
    117         'src-address-list' => 'unregistred', 'in-interface' => $LocalInterface, 'protocol' => 'tcp',
    118         'action' => 'dst-nat', 'to-addresses' => '10.145.64.70', 'to-ports' => 8080, 'comment' => 'Redirect_unregistred');
     116    //$Items[] = array('chain' => 'dstnat', 'dst-address' => '!10.145.0.0/16',
     117    //    'src-address-list' => 'unregistred', 'in-interface' => $LocalInterface, 'protocol' => 'tcp',
     118    //    'action' => 'dst-nat', 'to-addresses' => '10.145.64.70', 'to-ports' => 8080, 'comment' => 'Redirect_unregistred');
    119119
    120120    // Masquerade hosts without public ip
  • trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php

    r852 r860  
    6565      }
    6666    }
     67    echo("transakce\n");
    6768    $this->Database->Transaction($Queries);
     69    echo("done\n");
    6870
    6971    // Set offline all interfaces which were not updated as online
     
    9092    }
    9193    $Queries[] = $this->Database->GetUpdate('NetworkDevice', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
     94    echo("Transakce 2\n");
    9295    $this->Database->Transaction($Queries);
     96    echo("done\n");
    9397  }
    9498
  • trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php

    r818 r860  
    6969  {
    7070    $IPAddress = GetRemoteAddress();
    71     if(IsInternetAddr($IPAddress))
    72       return('<p>Internet zdarma je dostupný pouze z vnitřní sítě.</p>');
     71    $Output = 'Vaše IP adresa je: '.$IPAddress.'<br/>';
     72    if(IsInternetAddr($IPAddress)) {
     73      $Output .= '<p>Internet zdarma je dostupný pouze z vnitřní sítě.</p>';
     74      return($Output);
     75    }
    7376    $Time = time();
    7477
     
    99102      }
    100103    }
    101     $Output = '<div style="text-align:center;"><h3>Vítejte v síti ZděchovNET</h3></div>';
    102     //$Output .= 'Vaše adresa IP je: '.GetRemoteAddress().'<br/>';
     104    $Output .= '<div style="text-align:center;"><h3>Vítejte v síti ZděchovNET</h3></div>';
    103105    $Output .= '<p>Pro přístup k Internetu zdarma sdílenou rychlostí 128/128 kbit/s klikněte na odkaz níže.
    104106      Internet bude zpřístupněn po dobu 24 hodin. Po uplynutí této doby je potřeba provést novou aktivaci.</p>';
  • trunk/Modules/NetworkConfigRouterOS/Routerboard.php

    r854 r860  
    88  var $UserName;
    99  var $Password;
    10   var $PrivateKey = '~/.ssh/id_dsa';
     10  var $PrivateKey = '~/.ssh/id_rsa';
    1111  var $MaxBurstLineCount = 100;
    1212  var $Debug = false;
     
    5252      $Commands = str_replace('$', '\$', $Commands);
    5353      //$Commands = str_replace(' ', '\ ', $Commands);
    54       $Command = $this->SSHPath.' -o ConnectTimeout='.$this->Timeout.' -l '.$this->UserName.' -o HostKeyAlgorithms=+ssh-dss -o KexAlgorithms=diffie-hellman-group14-sha1 -i '.$this->PrivateKey.' '.$this->HostName.' "'.$Commands.'"';
     54      if ($this->PrivateKey != '') $PrivKey = ' -i '.$this->PrivateKey;
     55        else $PrivKey = '';
     56
     57      $Command = $this->SSHPath.' -oBatchMode=no -o ConnectTimeout='.$this->Timeout.' -l '.$this->UserName.
     58        $PrivKey.' '.$this->HostName.' "'.$Commands.'"';
    5559      if($this->Debug) echo($Command);
    5660      $Output = array();
Note: See TracChangeset for help on using the changeset viewer.