예제 #1
0
 /**
  * Publishchannels eines Objektes ermitteln
  * (Hierfür müssen besondere Berechtigungen
  * bei ImmobilienScout24 beantragt werden.)
  *
  * @param array $aArgs
  * @return mixed
  */
 private function _getPublish($aArgs)
 {
     $aRequired = array('username', 'realestate');
     $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('offer/v1.0/publish', $aArgs, $aRequired, __FUNCTION__, $oToken);
     $req->unset_parameter('username');
     return parent::getContent($req, $sSecret);
 }
예제 #2
0
파일: Rest.php 프로젝트: ab-4c/ImmoPress
 /**
  * Applikation Requesttoken ermitteln
  * und Benutzer auf SSO weiterleiten.
  *
  * @param array $aArgs
  * @return void
  */
 private function registerRequest($aArgs)
 {
     try {
         if (parent::requiredArgs($aArgs, array('callback_url'), ' ' . __FUNCTION__)) {
             $req = parent::restRequest('oauth/request_token', $aArgs, true);
             $req->set_parameter('oauth_callback', $aArgs['callback_url']);
             $aResult = Immocaster_Tools_Helper::makeArrayFromString(parent::getContent($req));
             Immocaster_Data_Session::getInstance()->setVar('request_token', $aResult['oauth_token']);
             Immocaster_Data_Mysql::getInstance()->saveRequestToken($aResult['oauth_token'], $aResult['oauth_token_secret']);
             @header('Location: ' . $this->_sUri . '/restapi/security/oauth/confirm_access?oauth_token=' . $aResult['oauth_token']);
             echo '<meta http-equiv="refresh" content="0;url=' . $this->_sUri . '/restapi/security/oauth/confirm_access?oauth_token=' . $aResult['oauth_token'] . '">';
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     return false;
 }