From 53b84270df754ea7297f36cfc880a2bf8c26de68 Mon Sep 17 00:00:00 2001 From: adametz Date: Wed, 2 May 2018 15:27:35 +0000 Subject: [PATCH] =?UTF-8?q?htaccess=20f=C3=BCr=20httpGet/Post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3392 f459cee4-fb09-11de-96c3-f9c5f16c3c76 --- trunk/src/AppBundle/Export/SternToursCrmExporter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trunk/src/AppBundle/Export/SternToursCrmExporter.php b/trunk/src/AppBundle/Export/SternToursCrmExporter.php index e2498629..92e94aa5 100644 --- a/trunk/src/AppBundle/Export/SternToursCrmExporter.php +++ b/trunk/src/AppBundle/Export/SternToursCrmExporter.php @@ -25,8 +25,9 @@ abstract class SternToursCrmExporter } protected final function httpGet($url) - { - $resp = Util::httpGet($url, ['X-ApiKey: '. self::API_KEY]); + { + $auth = base64_encode("star:4w28baV8xEZa0SR4"); + $resp = Util::httpGet($url, ['X-ApiKey: '. self::API_KEY, 'Authorization: Basic '.$auth]); $ret = json_decode($resp['content'], true); if ($ret === null) { @@ -39,7 +40,8 @@ abstract class SternToursCrmExporter protected final function httpPost($context, $postData = [], $isContextFullUrl = false) { $url = $isContextFullUrl ? $context : self::API_URL.'/'. $context .'.json'; - $resp = Util::httpPost($url, $postData, ['X-ApiKey: '. self::API_KEY], true); + $auth = base64_encode("star:4w28baV8xEZa0SR4"); + $resp = Util::httpPost($url, $postData, ['X-ApiKey: '. self::API_KEY, 'Authorization: Basic '.$auth], true); return [ 'content' => json_decode($resp['content']), 'location' => isset($resp['response_headers']['location']) @@ -48,4 +50,6 @@ abstract class SternToursCrmExporter 'success' => $resp['success'] && ($resp['status_code'] == 201) ]; } + + } \ No newline at end of file