Ignore:
Timestamp:
Apr 6, 2015, 1:03:33 PM (10 years ago)
Author:
chronos
Message:
  • Added: Support for Internet free access. Unregistered users are redirected to activation page where they can found useful information and activate free access for 24 hours.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Scheduler/Scheduler.php

    r730 r735  
    6464          $DbResult = $this->Database->query('SELECT `Scheduler`.*, `SchedulerAction`.`Class` AS `Class` FROM `Scheduler` '.
    6565                'LEFT JOIN `SchedulerAction` ON `SchedulerAction`.`Id` = `Scheduler`.`Action` '.
    66                 'WHERE (`Scheduler`.`Enabled`=1) AND (`Scheduler`.`ScheduledTime` > `Scheduler`.`LastExecutedTime`)');
     66                'WHERE (`Scheduler`.`Enabled`=1) AND (((`Scheduler`.`ScheduledTime` < "'.TimeToMysqlDateTime(time()).'") AND '.
     67                ' (`Scheduler`.`LastExecutedTime` < `Scheduler`.`ScheduledTime`)) OR '.
     68                '(`Scheduler`.`ScheduledTime` IS NULL))');
    6769          while($DbRow = $DbResult->fetch_assoc())
    6870          {
     
    7678                          $this->Database->update('Scheduler', 'Id='.$DbRow['Id'],
    7779                          array('Log' => $Output, 'LastExecutedTime' => 'NOW()'));
     80                          if($DbRow['ScheduledTime'] == '') $NewScheduledTime = time() + $DbRow['Period'];
     81                            else $NewScheduledTime = MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period']; 
    7882                        if($DbRow['Period'] != '') $this->Database->update('Scheduler', 'Id='.$DbRow['Id'],
    79                                 array('ScheduledTime' => TimeToMysqlDateTime((MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period']))));                       
     83                                array('ScheduledTime' => TimeToMysqlDateTime($NewScheduledTime)));                       
    8084          }     
    8185          echo('.');
Note: See TracChangeset for help on using the changeset viewer.