Просмотр исходного кода

UNA Market like on Boonex site: OAuth Server module fixes.

AntonLV 10 лет назад
Родитель
Сommit
bfd78a1780

+ 3 - 7
modules/boonex/oauth2/classes/BxOAuthModule.php

@@ -97,7 +97,7 @@ class BxOAuthModule extends BxDolModule
 
         if (!isLogged()) {
             require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
-            $sForceRelocate = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'auth/?client_id=' . bx_get('client_id') . '&response_type=' . bx_get('response_type') . '&state=' . bx_get('state') . '&redirect_uri=' . bx_get('redirect_uri');
+            $sForceRelocate = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'auth/?client_id=' . bx_get('client_id') . '&response_type=' . bx_get('response_type') . '&scope=' . bx_get('scope') . '&state=' . bx_get('state') . '&redirect_uri=' . bx_get('redirect_uri');
             bx_login_form(false, false, $sForceRelocate);
             return;
         }
@@ -127,17 +127,13 @@ class BxOAuthModule extends BxDolModule
             'client_id' => bx_get('client_id'),
             'response_type' => bx_get('response_type'),
             'redirect_uri' => bx_get('redirect_uri'),
+        	'scope' => bx_get('scope'),
             'state' => bx_get('state'),
             'profiles' => BxDolService::call('system', 'account_profile_switcher', array(getLoggedId(), false, "javascript: $('#bx-auth-profile-id').val('{profile_id}'); $('#bx-auth-form form').submit(); void(0);"), 'TemplServiceProfiles')['content'],
         ));
     }
 
-    function serviceGetClient ($sClientId)
-    {
-    	return $this->_oDb->getClient($sClientId);
-    }
-
-	function serviceGetClientsBy ($aParams = array())
+    function serviceGetClientsBy ($aParams = array())
     {
     	return $this->_oDb->getClientsBy($aParams);
     }

+ 1 - 0
modules/boonex/oauth2/template/page_auth.html

@@ -5,6 +5,7 @@
         <input type="hidden" name="client_id" value="__client_id__" />
         <input type="hidden" name="response_type" value="__response_type__" />
         <input type="hidden" name="redirect_uri" value="__redirect_uri__" />
+        <input type="hidden" name="scope" value="__scope__" />
         <input type="hidden" name="state" value="__state__" />
         <div class="bx-auth-form-profiles">
             __profiles__