diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index e1c9861cc9e..10a2659f6a5 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1008,6 +1008,15 @@ class Cronjob extends CommonObject $retval = $this->lastresult; $error++; } + if (in_array(strtolower(trim($this->methodename)), array('executecli'))) + { + $this->error = $langs->trans('CronMethodNotAllowed', $this->methodename, $this->objectname); + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + $this->lastoutput = $this->error; + $this->lastresult = -1; + $retval = $this->lastresult; + $error++; + } } // Load langs diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 1de1251831a..bb61ed13bbe 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -14,6 +14,7 @@ FileToLaunchCronJobs=Command line to check and launch qualified cron jobs CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes CronExplainHowToRunWin=On Microsoft(tm) Windows environment you can use Scheduled Task tools to run the command line each 5 minutes CronMethodDoesNotExists=Class %s does not contains any method %s +CronMethodNotAllowed=Method %s of class %s is in blacklist of forbidden methods CronJobDefDesc=Cron job profiles are defined into the module descriptor file. When module is activated, they are loaded and available so you can administer the jobs from the admin tools menu %s. CronJobProfiles=List of predefined cron job profiles # Menu