Skip to content
Snippets Groups Projects
Commit cb8260f0 authored by Prasad's avatar Prasad
Browse files

Fixes #502: Extend support to detect cron trigger from CLI (cgi-fcgi etc... generic)

parent 90c47717
No related branches found
No related tags found
1 merge request!311Language italian translation
......@@ -37,7 +37,11 @@ if($php < 50300){
$mailbody ="Instance dir : $root_directory <br/> Site Url : $site_URL <br/> Host Name : $hostName<br/>";
$mailSubject = "[Alert] ";
if(PHP_SAPI === "cli" || (isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)){
function vtigercron_detect_run_in_cli(){
return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0));
}
if(vtigercron_detect_run_in_cli() || (isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)){
$cronTasks = false;
if (isset($_REQUEST['service'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment