- don't drop TABLE_PANEL_DISKSPACE and TABLE_PANEL_DISKSPACE_ADMINS (used in traffic-cron);

- using correct variable for sql-query in getNextCronjobs();
- let includeCronjobs() return the list of crons to run because of all the global variables;
- include required classes/functions to cronfiles;
This commit is contained in:
Michael Kaufmann (d00p)
2010-01-27 07:47:51 +00:00
parent 3e09f51686
commit ddde0f7aff
6 changed files with 28 additions and 13 deletions

View File

@@ -26,7 +26,7 @@ function getNextCronjobs()
{
global $db;
$sql = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND (";
$query = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND (";
$intervals = getIntervalOptions();
@@ -36,14 +36,14 @@ function getNextCronjobs()
if($name == '0') continue;
if($x == 0) {
$sql.= 'DATE_ADD(FROM_UNIXTIME(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
$query.= 'DATE_ADD(FROM_UNIXTIME(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
} else {
$sql.= ' OR DATE_ADD(UNIX_TIMESTAMP(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
$query.= ' OR DATE_ADD(UNIX_TIMESTAMP(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
}
$x++;
}
$sql.= ');';
$query.= ');';
$result = $db->query($query);