Преглед изворни кода

#90 - Use standalone oauth library.

AntonLV пре 12 година
родитељ
комит
81869e90d6

+ 1 - 0
studio/classes/BxDolStudioOAuth.php

@@ -25,6 +25,7 @@ class BxDolStudioOAuth extends BxDol
 
 	protected $sKey;
     protected $sSecret;
+    protected $sDataRetrieveMethod;
 
     public function __construct()
     {

+ 2 - 1
studio/classes/BxDolStudioOAuthLib.php

@@ -20,6 +20,7 @@ class BxDolStudioOAuthLib extends BxDolStudioOAuth implements iBxDolSingleton
 
         $this->sKey = getParam('sys_oauth_key');
         $this->sSecret = getParam('sys_oauth_secret');
+        $this->sDataRetrieveMethod = OAUTH_HTTP_METHOD_POST;
     }
 
     public function __clone()
@@ -101,7 +102,7 @@ class BxDolStudioOAuthLib extends BxDolStudioOAuth implements iBxDolSingleton
             $oConsumer->enableDebug();
 
             $oConsumer->setToken($this->oSession->getValue('sys_oauth_token'), $this->oSession->getValue('sys_oauth_secret'));
-            $oConsumer->fetch(BX_DOL_OAUTH_URL_FETCH_DATA, $aParams, OAUTH_HTTP_METHOD_POST);
+            $oConsumer->fetch(BX_DOL_OAUTH_URL_FETCH_DATA, $aParams, $this->sDataRetrieveMethod);
 
             
             //echo $oConsumer->getLastResponse(); exit;	//--- Uncomment to debug

+ 2 - 1
studio/classes/BxDolStudioOAuthPlugin.php

@@ -33,6 +33,7 @@ class BxDolStudioOAuthPlugin extends BxDolStudioOAuth implements iBxDolSingleton
 
         $this->sKey = getParam('sys_oauth_key');
         $this->sSecret = getParam('sys_oauth_secret');
+        $this->sDataRetrieveMethod = 'POST';
 
         $this->sService = 'Dolphin';
         $this->oStorage = new Session();
@@ -111,7 +112,7 @@ class BxDolStudioOAuthPlugin extends BxDolStudioOAuth implements iBxDolSingleton
 
         try {
         	$oService = $this->getServiceObject();
-			$sResponse = $oService->request(BX_DOL_OAUTH_URL_FETCH_DATA, OAUTH_HTTP_METHOD_POST, $aParams);
+			$sResponse = $oService->request(BX_DOL_OAUTH_URL_FETCH_DATA, $this->sDataRetrieveMethod, $aParams);
 
             //echo $sResponse; exit;	//--- Uncomment to debug
             return json_decode($sResponse, true);