Ignore:
Timestamp:
Mar 16, 2016, 8:51:59 PM (9 years ago)
Author:
chronos
Message:
Location:
trunk/Modules/NetworkConfig
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfig/Generate.php

    r790 r817  
    1313  if($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period']))
    1414  {
    15     $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 2));
     15    $System->Database->update('NetworkConfiguration', '`Id`='.$Service['Id'], array('Changed' => 2));
    1616    $ExecutionStart = time();
    1717    //echo($Service['Caption'].'...');
     
    2727    //echo("Done\n");
    2828    $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)));
    3131  }
    3232}
  • trunk/Modules/NetworkConfig/NetworkConfig.php

    r781 r817  
    5151      ),
    5252    ));
     53    $this->System->FormManager->RegisterFormType('TNetworkConfigurationState', array(
     54      'Type' => 'Enumeration',
     55      'States' => array('Neplánováno', 'V plánu', 'Provádí se'),
     56    ));
     57   
    5358    $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)');
    5467  }
    5568
Note: See TracChangeset for help on using the changeset viewer.