Ignore:
Timestamp:
Mar 24, 2009, 7:28:33 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Konfigurační skripty síťových zařízení opraveny pro nové tabulky Member a Subject.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/system/generators/nat_routerboard.php

    r161 r171  
    11<?php
     2
    23include_once('../../global.php');
    34
     
    89$Commands[] = '/ip firewall nat { remove [find] }';
    910
    10 $DbResult = $Database->select('users', 'CONCAT(second_name, " ", first_name) as fullname, id');
    11 while($User = $DbResult->fetch_array())
     11$DbResult = $Database->query('SELECT Member.*, Subject.* FROM Member ON Member.Subject = Subject.Id');
     12while($Member = $DbResult->fetch_assoc())
    1213{
    13   echo($User['fullname']."\n");
    14   $DbResult2 = $Database->select('hosts', '*', '(external_ip <> "") AND (user='.$User['id'].') AND (IP != external_ip) ORDER BY id DESC');
    15   while($Host = $DbResult2->fetch_array())
     14  echo($Member['Name']."\n");
     15  $DbResult2 = $Database->select('hosts', '*', '(external_ip <> "") AND (user='.$Member['Id'].') AND (IP != external_ip) ORDER BY id DESC');
     16  while($Host = $DbResult2->fetch_assoc())
    1617  {
    1718    echo($Host['name']."\n");
     
    2829
    2930$Commands = addslashes(implode(';', $Commands));
    30 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa '.$Router.' "'.$Commands.'"';
    31 //echo($Command."\n");
    32 exec($Command, $Output);
     31$Command = '/usr/bin/ssh -l admin-ssh -i id_dsa '.$Router.' "'.$Commands.'"';
     32echo($Command."\n");
     33//exec($Command, $Output);
    3334//array_pop($Output);
    3435//print_r($Output);
Note: See TracChangeset for help on using the changeset viewer.