From f718867df0fb0de0e4d23c0c8ff4bc3c6d8ed51a Mon Sep 17 00:00:00 2001 From: Jean-Claude Siegrist Date: Tue, 13 Dec 2016 11:15:23 +0100 Subject: [PATCH 1/3] do not start session to avoid E_NOTICE as of php 4.3 when session is already started --- Immocaster/Immobilienscout/Rest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Immocaster/Immobilienscout/Rest.php b/Immocaster/Immobilienscout/Rest.php index 6e7a15f..7dcc806 100755 --- a/Immocaster/Immobilienscout/Rest.php +++ b/Immocaster/Immobilienscout/Rest.php @@ -1,5 +1,5 @@ Date: Tue, 13 Dec 2016 11:25:06 +0100 Subject: [PATCH 2/3] use oAuth for getExpose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so Objects published only for „Hompage“ on IS24 can be retrieved. Should work with IS24 published Objects as well. App has to be zertified --- Immocaster/Immobilienscout/Rest.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Immocaster/Immobilienscout/Rest.php b/Immocaster/Immobilienscout/Rest.php index 7dcc806..1e3d381 100755 --- a/Immocaster/Immobilienscout/Rest.php +++ b/Immocaster/Immobilienscout/Rest.php @@ -342,13 +342,25 @@ private function _geoService($aArgs) * @param array $aArgs * @return mixed */ - private function _getExpose($aArgs) - { - $aRequired = array('exposeid'); - $req = $this->doRequest('search/v1.0/expose/'.$aArgs['exposeid'],$aArgs,$aRequired,__FUNCTION__); - $req->unset_parameter('exposeid'); - return parent::getContent($req); - } + private function _getExpose($aArgs) + { + $aRequired = array('username','exposeid'); + $oToken = null; + $sSecret = null; + if(!isset($aArgs['username'])) + { + $aArgs['username'] = $this->_sDefaultUsername; + } + list($oToken, $sSecret) = $this->getApplicationTokenAndSecret($aArgs['username']); + if($oToken === NULL || $sSecret === NULL) + { + return IMMOCASTER_SDK_LANG_APPLICATION_NOT_CERTIFIED; + } + $req = $this->doRequest('search/v1.0/expose/'.$aArgs['exposeid'],$aArgs,$aRequired,__FUNCTION__, $oToken); + $req->unset_parameter('exposeid'); + $req->unset_parameter('username'); + return parent::getContent($req,$sSecret); + } /** * Abfrage eines eigenen Exposes (Offer-API) From 711f976642fdf5ee746b67c7b9e1e127e19e46b9 Mon Sep 17 00:00:00 2001 From: Jean-Claude Siegrist Date: Tue, 13 Dec 2016 11:37:58 +0100 Subject: [PATCH 3/3] check if OAuthException class exists before trying to redeclare it. Otherwise fatal php error is thrown if php oAuth extension is installed. --- Immocaster/Oauth/OAuth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Immocaster/Oauth/OAuth.php b/Immocaster/Oauth/OAuth.php index 9dc9a99..4f1fa36 100755 --- a/Immocaster/Oauth/OAuth.php +++ b/Immocaster/Oauth/OAuth.php @@ -3,8 +3,10 @@ /* Generic exception class */ -class OAuthException extends Exception { - // pass +if (!class_exists('OAuthException')) { + class OAuthException extends Exception { + // pass + } } class OAuthConsumer {