Merge pull request #27537 from libremaster/develop

NEW: cronjob: deny to launch a method from a deactivated module
This commit is contained in:
Laurent Destailleur 2024-01-15 20:20:26 +01:00 committed by GitHub
commit 941dbbde78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1223,6 +1223,16 @@ class Cronjob extends CommonObject
// Run a method
if ($this->jobtype == 'method') {
// Deny to launch a method from a deactivated module
if (!empty($this->module_name) && !isModEnabled(strtolower($this->module_name))) {
$this->error = $langs->transnoentitiesnoconv('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 classes
if (!$error) {
$ret = dol_include_once($this->classesname);