From 56b70beb36bc9dc1851e16cef354f019f1740a1e Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Thu, 27 Nov 2014 18:58:34 +0300 Subject: [PATCH] multiple site fix --- intaro.intarocrm/classes/general/ICrmOrderActions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 801774e1..ea9fed40 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -1096,10 +1096,19 @@ class ICrmOrderActions break; } + if(!empty($defaultSite)) { + $serverName = $defaultSite['SERVER_NAME']; + } else { + if(isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME']) + $serverName = $_SERVER['SERVER_NAME']; + else + $serverName = ''; + } + if(self::isForkable($defaultSite)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, ($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . - $_SERVER['SERVER_NAME'] . '/retailcrm/agent.php'); + $serverName . '/retailcrm/agent.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt($ch,CURLOPT_HEADER, true); // headers curl_exec($ch);