1
0
mirror of synced 2024-11-22 21:36:10 +03:00

isForkable fix

This commit is contained in:
Grigory Pomadchin 2014-11-25 01:21:19 +03:00
parent 07d4eb31c7
commit 546a89429f

View File

@ -1089,7 +1089,7 @@ class ICrmOrderActions
*/ */
public static function forkedOrderAgent() { public static function forkedOrderAgent() {
if(self::isForkable()&& is_callable('curl_init')) { if(self::isForkable() && is_callable('curl_init')) {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch,CURLOPT_URL, curl_setopt($ch,CURLOPT_URL,
($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . ($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') .
@ -1533,9 +1533,11 @@ class ICrmOrderActions
*/ */
public static function isForkable() { public static function isForkable() {
$fork = COption::GetOptionString('main', 'agents_use_crontab', 'N'); $fork = COption::GetOptionString('main', 'agents_use_crontab', 'N');
if($fork === 'N') return true; if($fork === 'N') {
$dir = $_SERVER['DOCUMENT_ROOT'] . '/retailcrm/agent.php'; $dir = $_SERVER['DOCUMENT_ROOT'] . '/retailcrm/agent.php';
return file_exists($dir) && is_dir($dir); return file_exists($dir) && is_dir($dir);
} }
return false;
}
} }