Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
Location:
trunk/Modules/NetworkConfig
Files:
2 edited

Legend:

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

    r848 r873  
    11<?php
    22
    3 if(isset($_SERVER['REMOTE_ADDR'])) die();
     3if (isset($_SERVER['REMOTE_ADDR'])) die();
    44include_once(dirname(__FILE__).'/../../Application/System.php');
    55$System = new Core();
     
    99$Now = time();
    1010$DbResult = $System->Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(`LastTime`)', '(`Changed` = 1) AND (`Enabled` = 1)');
    11 while($Service = $DbResult->fetch_assoc())
     11while ($Service = $DbResult->fetch_assoc())
    1212{
    13   if($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period']))
     13  if ($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period']))
    1414  {
    1515    $System->Database->update('NetworkConfiguration', '`Id`='.$Service['Id'], array('Changed' => 2));
     
    1919    $ExecuteParts = explode('|', $Service['Execute']);
    2020    $Output = array();
    21     foreach($ExecuteParts as $Command)
    22       if($Command != '')
     21    foreach ($ExecuteParts as $Command)
     22      if ($Command != '')
    2323      {
    2424        exec($Command, $Output);
  • trunk/Modules/NetworkConfig/NetworkConfig.php

    r820 r873  
    8080  {
    8181    $Output = '';
    82     if($Parameters >= 3)
     82    if ($Parameters >= 3)
    8383    {
    8484      $ConfigItemName = $Parameters[2];
    85       if(array_key_exists($ConfigItemName, $this->ConfigItems))
     85      if (array_key_exists($ConfigItemName, $this->ConfigItems))
    8686      {
    8787        $ClassName = $this->ConfigItems[$ConfigItemName];
     
    9090      } else $Output = 'Config item '.$ConfigItemName.' not found';
    9191    } else $Output = 'Not enough parameters';
    92     return($Output);
     92    return ($Output);
    9393  }
    9494}
Note: See TracChangeset for help on using the changeset viewer.