From 546a89429f5d881f6b64e7c32114c243dd91b00f Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Tue, 25 Nov 2014 01:21:19 +0300 Subject: [PATCH] isForkable fix --- intaro.intarocrm/classes/general/ICrmOrderActions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 9d3adcc2..c6011cb6 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -1089,7 +1089,7 @@ class ICrmOrderActions */ public static function forkedOrderAgent() { - if(self::isForkable()&& is_callable('curl_init')) { + if(self::isForkable() && is_callable('curl_init')) { $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, ($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . @@ -1533,9 +1533,11 @@ class ICrmOrderActions */ public static function isForkable() { $fork = COption::GetOptionString('main', 'agents_use_crontab', 'N'); - if($fork === 'N') return true; + if($fork === 'N') { + $dir = $_SERVER['DOCUMENT_ROOT'] . '/retailcrm/agent.php'; + return file_exists($dir) && is_dir($dir); + } - $dir = $_SERVER['DOCUMENT_ROOT'] . '/retailcrm/agent.php'; - return file_exists($dir) && is_dir($dir); + return false; } }