Ignore:
Timestamp:
Apr 15, 2013, 11:08:49 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Skritpy generátorů nastavení routerů přetvořeny na aplikační moduly NetworkConfig.
Location:
trunk/Modules/NetworkConfig
Files:
1 added
1 copied

Legend:

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

    r521 r522  
    22
    33if(isset($_SERVER['REMOTE_ADDR'])) die();
    4 include('../../Common/Global.php');
    5 $Database = &$System->Database;
     4include_once(dirname(__FILE__).'/../../Common/Global.php');
    65
    76$Now = time();
    8 $DbResult = $Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed = 1) AND (Enabled = 1)');
     7$DbResult = $System->Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed = 1) AND (Enabled = 1)');
    98while($Service = $DbResult->fetch_assoc())
    109{
    1110  if($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period']))
    1211  {
    13     $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 2));
     12    $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 2));
    1413    $ExecutionStart = time();
    1514    //echo($Service['Caption'].'...');
     
    2524    //echo("Done\n");
    2625    $ExecutionTime = time() - $ExecutionStart;
    27     $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime));
    28     $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Log' => implode("\n", $Output)));
     26    $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime));
     27    $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Log' => implode("\n", $Output)));
    2928  }
    3029}
Note: See TracChangeset for help on using the changeset viewer.