fix 'Error cronjob->run_job: Permission denied' and add time and login used for debug helps

This commit is contained in:
Eric Seigne 2017-08-20 09:39:51 +02:00
parent dcd1a089b1
commit b77fe285dc

View File

@ -68,9 +68,11 @@ $error=0;
/*
* Main
*/
// current date
$now=dol_now();
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=" . $userlogin . " ***** " . $now . " *****\n";
// Check security key
if ($key != $conf->global->CRON_KEY)
@ -114,7 +116,9 @@ else
exit(-1);
}
}
//erics cf https://www.dolibarr.org/forum/12-howto-help/26035-cron-run-jobs-php-error-permission-denied
$user->getrights();
if (isset($argv[3]) || $argv[3])
{
$id = $argv[3];
@ -138,9 +142,6 @@ if ($result<0)
// TODO This sequence of code must be shared with code into cron_run_jobs.php php page.
// current date
$now=dol_now();
if(is_array($object->lines) && (count($object->lines)>0))
{
// Loop over job