From 29f07d3e897a61812d10e1a3bceb428251a492be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Jan 2017 16:39:35 +0100 Subject: [PATCH] The tutorial to add cron is sometimes false. Quick hack for a solution to hide it. --- htdocs/core/lib/cron.lib.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index aade8149ce5..9afd0e7835b 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -110,21 +110,24 @@ function dol_print_cron_urls() print '<br>'; // Add note - $linuxlike=1; - if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; - if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; - print $langs->trans("Note").': '; - if ($linuxlike) + if (empty($conf->global->CRON_DISABLE_TUTORIAL_CRON)) { - print $langs->trans("CronExplainHowToRunUnix"); - print '<br>'; - print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' > '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>'; + $linuxlike=1; + if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; + if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; + print $langs->trans("Note").': '; + if ($linuxlike) + { + print $langs->trans("CronExplainHowToRunUnix"); + print '<br>'; + print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' > '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>'; + } + else + { + print $langs->trans("CronExplainHowToRunWin"); + } } - else - { - print $langs->trans("CronExplainHowToRunWin"); - } - + return 0; } -- GitLab