Sfoglia il codice sorgente

#633 OAuth server: don't suggest to select profiles when only one profile available

Alex Trofimov 9 anni fa
parent
commit
a9daced949

+ 6 - 0
modules/boonex/oauth2/classes/BxOAuthModule.php

@@ -103,6 +103,12 @@ class BxOAuthModule extends BxDolModule
         }
 
         $aProfiles = BxDolAccount::getInstance()->getProfiles();
+
+        if (1 == count($aProfiles)) { // in case of one profile, don't display dialog with profiles choice
+            $aProfile = array_pop($aProfiles);
+            $_POST['profile_id'] = $aProfile['id'];
+        }
+
         if (!($iProfileId = $this->_oDb->getSavedProfile($aProfiles)) && empty($_POST)) {
             $oPage = BxDolPage::getObjectInstanceByURI('oauth-authorization');
             $this->_oTemplate->getPage(false, $oPage->getCode());

+ 1 - 1
modules/boonex/russian/data/langs/bx_unacon/ru.xml

@@ -17,7 +17,7 @@
     <string name="_bx_unacon_option_app_secret"><![CDATA[UNA App Secret]]></string>
     <string name="_bx_unacon_option_app_url"><![CDATA[URL главного UNA сайта]]></string>
     <string name="_bx_unacon_option_auto_friends"><![CDATA[Автоматически делать друзьями тех, что уже друг на другом UNA сайте]]></string>
-    <string name="_bx_unacon_option_rewrite"><![CDATA[Использовать преобразованные ссылки на главном UNA сайта]]></string>
+    <string name="_bx_unacon_option_rewrite"><![CDATA[Использовать преобразованные ссылки на главном UNA сайте]]></string>
 
 	<string name="_bx_unacon_et_password_generated"><![CDATA[UNA-соединение: временный пароль]]></string>
 	<string name="_bx_unacon_et_password_generated_subject"><![CDATA[Временный пароль]]></string>