Changeset 873 for trunk/Modules/NetworkConfig
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- Location:
- trunk/Modules/NetworkConfig
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfig/Generate.php
r848 r873 1 1 <?php 2 2 3 if (isset($_SERVER['REMOTE_ADDR'])) die();3 if (isset($_SERVER['REMOTE_ADDR'])) die(); 4 4 include_once(dirname(__FILE__).'/../../Application/System.php'); 5 5 $System = new Core(); … … 9 9 $Now = time(); 10 10 $DbResult = $System->Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(`LastTime`)', '(`Changed` = 1) AND (`Enabled` = 1)'); 11 while ($Service = $DbResult->fetch_assoc())11 while ($Service = $DbResult->fetch_assoc()) 12 12 { 13 if ($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period']))13 if ($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period'])) 14 14 { 15 15 $System->Database->update('NetworkConfiguration', '`Id`='.$Service['Id'], array('Changed' => 2)); … … 19 19 $ExecuteParts = explode('|', $Service['Execute']); 20 20 $Output = array(); 21 foreach ($ExecuteParts as $Command)22 if ($Command != '')21 foreach ($ExecuteParts as $Command) 22 if ($Command != '') 23 23 { 24 24 exec($Command, $Output); -
trunk/Modules/NetworkConfig/NetworkConfig.php
r820 r873 80 80 { 81 81 $Output = ''; 82 if ($Parameters >= 3)82 if ($Parameters >= 3) 83 83 { 84 84 $ConfigItemName = $Parameters[2]; 85 if (array_key_exists($ConfigItemName, $this->ConfigItems))85 if (array_key_exists($ConfigItemName, $this->ConfigItems)) 86 86 { 87 87 $ClassName = $this->ConfigItems[$ConfigItemName]; … … 90 90 } else $Output = 'Config item '.$ConfigItemName.' not found'; 91 91 } else $Output = 'Not enough parameters'; 92 return ($Output);92 return ($Output); 93 93 } 94 94 }
Note:
See TracChangeset
for help on using the changeset viewer.