prepare for more cronjob-mess :)

This commit is contained in:
Michael Kaufmann (d00p)
2010-01-25 13:40:17 +00:00
parent 28feb0d1b2
commit 6e5746a598
6 changed files with 94 additions and 60 deletions

View File

@@ -15,30 +15,12 @@
* @version $Id: $
*/
function includeCronjobs($path, $debugHandler)
function includeCronjobs($debugHandler)
{
$cronbasedir = makeCorrectDir($path);
$crondir = new DirectoryIterator($cronbasedir);
foreach($crondir as $file)
$cronjobs = getNextCronjobs();
if($cronjobs !== false)
{
if($file->isDot()) continue;
if($file->isFile())
{
if(fileowner(__FILE__) == $file->getOwner()
&& filegroup(__FILE__) == $file->getGroup()
&& $file->isReadable())
{
fwrite($debugHandler, 'Including ...' . $file->getPathname() . "\n");
include_once($file->getPathname());
}
else
{
fwrite($debugHandler, 'WARNING! uid and/or gid of "' . __FILE__ . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!' . "\n");
fclose($debugHandler);
die('WARNING! uid and/or gid of "' . __FILE__ . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!');
}
}
// [...]
}
}