Procházet zdrojové kódy

#410 Connect modules re-factoring

Alex Trofimov před 10 roky
rodič
revize
db3525a5f0

+ 3 - 2
modules/boonex/facebook_connect/classes/BxFaceBookConnectModule.php

@@ -37,7 +37,8 @@ class BxFaceBookConnectModule extends BxBaseModConnectModule
         $this -> oFacebook = null;
 
         if ($this -> _oConfig -> mApiID) {
-            session_start();
+            if (!isset($_SESSION))
+                session_start();
             $this -> oFacebook = new Facebook\Facebook(array(
                 'app_id'  => $this -> _oConfig -> mApiID,
                 'app_secret' => $this -> _oConfig -> mApiSecret,
@@ -111,7 +112,7 @@ class BxFaceBookConnectModule extends BxBaseModConnectModule
                 }
             } else {
                 // FB profile info is not defined;
-                $this->_setLastError(_t('_bx_facebook_profile_error_info'));
+                $this->_setLastError(_t('_sys_connect_profile_error_info'));
             }
         }
 

+ 1 - 8
modules/boonex/facebook_connect/install/langs/en.xml

@@ -3,25 +3,18 @@
 	<string name="_sys_module_facebook_connect"><![CDATA[Facebook Connect]]></string>
 	<string name="_bx_facebook"><![CDATA[Facebook Connect]]></string>
 	<string name="_bx_facebook_settings"><![CDATA[Facebook Connect]]></string>
-	<string name="_bx_facebook_information"><![CDATA[Facebook connect information]]></string>
 	<string name="_bx_facebook_information_block"><![CDATA[To get your "App ID" and "App Secret", you need to <a href="https://developers.facebook.com/apps/" target="_blank">make Facebook app</a>. <br /><br />Please follow <a href="http://www.boonex.com/forums/topic/How-to-setup-Facebook-Connect-module.htm" target="_blank">these instructions</a> on how to create and setup the app. <br /><br />Your "Site URL" for the app: <b>{0}</b> <br /><br />After completing these steps, insert your "App ID" and "App Secret" below:]]></string>
-	<string name="_bx_facebook_profile_error_info"><![CDATA[Can\'t define your profile information]]></string>
-	<string name="_bx_facebook_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can\'t define facebook api keys)]]></string>
+	<string name="_bx_facebook_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define facebook api keys)]]></string>
 	<string name="_bx_facebook_chart"><![CDATA[Facebook Profiles]]></string>
 	<string name="_bx_facebook_auth_title"><![CDATA[Facebook Connect]]></string>
 	<string name="_bx_facebook_error"><![CDATA[Error]]></string>
 
     <string name="_bx_facebook_adm_stg_cpt_type"><![CDATA[Facebook Connect]]></string>
-    <string name="_bx_facebook_adm_stg_cpt_category_general"><![CDATA[General]]></string>
     <string name="_bx_facebook_option_app_id"><![CDATA[Facebook App ID]]></string>
     <string name="_bx_facebook_option_app_secret"><![CDATA[Facebook App Secret]]></string>
-    <string name="_bx_facebook_option_redirect"><![CDATA[Redirect page after first sign in]]></string>
     <string name="_bx_facebook_option_auto_friends"><![CDATA[Auto-friend members if they are already friends on Facebook]]></string>
     <string name="_bx_facebook_option_fetch_extended_info"><![CDATA[Fetch extended profile info (facebook app review is required)]]></string>
-    <string name="_bx_facebook_option_module"><![CDATA[Module to create profile in]]></string>
     <string name="_bx_facebook_option_privacy"><![CDATA[Default privacy for created profiles]]></string>
-    <string name="_bx_facebook_option_confirm_email"><![CDATA[Always confirm emails when joined using Facebook]]></string>
-    <string name="_bx_facebook_option_approve"><![CDATA[Always approve profiles when joined using Facebook]]></string>
 
 	<string name="_bx_facebook_conect_et_password_generated"><![CDATA[Facebook connect temporary password]]></string>
 	<string name="_bx_facebook_conect_et_password_generated_subject"><![CDATA[Temporary password]]></string>

+ 5 - 5
modules/boonex/facebook_connect/install/sql/enable.sql

@@ -28,19 +28,19 @@ INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VA
 SET @iTypeId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_facebook_general', '_bx_facebook_adm_stg_cpt_category_general', 1);
+VALUES (@iTypeId, 'bx_facebook_general', '_sys_connect_adm_stg_cpt_category_general', 1);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
 ('bx_facebook_connect_api_key', '', @iCategId, '_bx_facebook_option_app_id', 'digit', '', '', 10, ''),
 ('bx_facebook_connect_secret', '', @iCategId, '_bx_facebook_option_app_secret', 'digit', '', '', 20, ''),
-('bx_facebook_connect_redirect_page', 'dashboard', @iCategId, '_bx_facebook_option_redirect', 'select', '', '', 30, 'join,settings,dashboard,index'),
-('bx_facebook_connect_module', 'bx_persons', @iCategId, '_bx_facebook_option_module', 'select', '', '', 40, 'a:2:{s:6:"module";s:11:"bx_facebook";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_facebook_connect_redirect_page', 'dashboard', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 30, 'join,settings,dashboard,index'),
+('bx_facebook_connect_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 40, 'a:2:{s:6:"module";s:11:"bx_facebook";s:6:"method";s:20:"get_profiles_modules";}'),
 ('bx_facebook_connect_privacy', '3', @iCategId, '_bx_facebook_option_privacy', 'select', '', '', 44, 'a:2:{s:6:"module";s:11:"bx_facebook";s:6:"method";s:18:"get_privacy_groups";}'),
 ('bx_facebook_connect_auto_friends', 'on', @iCategId, '_bx_facebook_option_auto_friends', 'checkbox', '', '', 50, ''),
 ('bx_facebook_connect_extended_info', '', @iCategId, '_bx_facebook_option_fetch_extended_info', 'checkbox', '', '', 60, ''),
-('bx_facebook_connect_confirm_email', 'on', @iCategId, '_bx_facebook_option_confirm_email', 'checkbox', '', '', 70, ''),
-('bx_facebook_connect_approve', '', @iCategId, '_bx_facebook_option_approve', 'checkbox', '', '', 80, '');
+('bx_facebook_connect_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_facebook_connect_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, '');
 
 -- PAGE: error
 

+ 2 - 18
modules/boonex/google_connect/classes/BxGoogleConModule.php

@@ -16,16 +16,6 @@ class BxGoogleConModule extends BxBaseModConnectModule
         parent::__construct($aModule);
     }
 
-    /**
-     * Generate admin page;
-     *
-     * @return : (text) - html presentation data;
-     */
-    function actionAdministration()
-    {
-        parent::_actionAdministration('bx_googlecon_api_key', '_bx_googlecon_settings', '_bx_googlecon_information', '_bx_googlecon_information_block');
-    }
-
     /**
      * Redirect to remote site login form
      *
@@ -62,7 +52,7 @@ class BxGoogleConModule extends BxBaseModConnectModule
 
         // check CSRF token
         if ($this->_getCsrfToken() != bx_get('state')) {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_bx_googlecon_state_invalid')));
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_state_invalid')));
             return;
         }
 
@@ -124,16 +114,10 @@ class BxGoogleConModule extends BxBaseModConnectModule
             }
         } 
         else {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_bx_googlecon_profile_error_info')));
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_profile_error_info')));
         }
     }
 
-    protected function _redirect($sUrl, $iStatus = 302)
-    {
-        header("Location:{$sUrl}", true, $iStatus);
-        exit;
-    }
-
     /**
      * @param $aProfileInfo - remote profile info
      * @param $sAlternativeName - suffix to add to NickName to make it unique

+ 1 - 1
modules/boonex/google_connect/classes/BxGoogleConStudioPage.php

@@ -20,7 +20,7 @@ class BxGoogleConStudioPage extends BxTemplStudioModule
     protected function getPageCaptionHelp()
     {
         $oTemplate = BxDolStudioTemplate::getInstance();
-        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_googlecon&page=help">' . _t('_bx_googlecon_information') . "</a>";
+        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_googlecon&page=help">' . _t('_sys_connect_information') . "</a>";
         return $oTemplate->parseHtmlByName('page_caption_help.html', array('content' => $sContent));
     }
 }

+ 0 - 9
modules/boonex/google_connect/install/langs/en.xml

@@ -3,7 +3,6 @@
 	<string name="_sys_module_googlecon"><![CDATA[Google Connect]]></string>
 	<string name="_bx_googlecon"><![CDATA[Google Connect]]></string>
 	<string name="_bx_googlecon_settings"><![CDATA[Google Connect]]></string>
-	<string name="_bx_googlecon_information"><![CDATA[Google connect information]]></string>
 	<string name="_bx_googlecon_information_block"><![CDATA[
         <p>This module can be used to login to this site using your Google account credentials.</p>
         <p>To make it work, follow these instructions on <a target="_blank" href="https://developers.google.com/identity/sign-in/web/devconsole-project">how to create Google Project</a>, when creating a project specify the following info:<br />
@@ -12,20 +11,12 @@
             </ul>
             Then enter generated Client ID & Secret pair in this module settings.
         </p>]]></string>
-	<string name="_bx_googlecon_error_join_unavailable"><![CDATA[Sorry but join is unavailable now. Please try again later.]]></string>
-	<string name="_bx_googlecon_profile_error_info"><![CDATA[Can't define your profile information]]></string>
 	<string name="_bx_googlecon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define Client ID & Secret)]]></string>
 	<string name="_bx_googlecon_auth_title"><![CDATA[Google Connect]]></string>
-	<string name="_bx_googlecon_state_invalid"><![CDATA[State parameter isn't matching]]></string>
 
     <string name="_bx_googlecon_adm_stg_cpt_type"><![CDATA[Google Connect]]></string>
-    <string name="_bx_googlecon_adm_stg_cpt_category_general"><![CDATA[General]]></string>
     <string name="_bx_googlecon_option_app_id"><![CDATA[Client ID]]></string>
     <string name="_bx_googlecon_option_app_secret"><![CDATA[Client Secret]]></string>
-    <string name="_bx_googlecon_option_redirect"><![CDATA[Redirect page after first sign in]]></string>
-    <string name="_bx_googlecon_option_module"><![CDATA[Module to create profile in]]></string>
-    <string name="_bx_googlecon_option_confirm_email"><![CDATA[Always confirm emails when joined using Google Connect]]></string>
-    <string name="_bx_googlecon_option_approve"><![CDATA[Always approve profiles when joined using Google Connect]]></string>
 
 	<string name="_bx_googlecon_et_password_generated"><![CDATA[Google connect temporary password]]></string>
 	<string name="_bx_googlecon_et_password_generated_subject"><![CDATA[Temporary password]]></string>

+ 5 - 5
modules/boonex/google_connect/install/sql/enable.sql

@@ -28,16 +28,16 @@ INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VA
 SET @iTypeId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_googlecon_general', '_bx_googlecon_adm_stg_cpt_category_general', 1);
+VALUES (@iTypeId, 'bx_googlecon_general', '_sys_connect_adm_stg_cpt_category_general', 1);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
 ('bx_googlecon_api_key', '', @iCategId, '_bx_googlecon_option_app_id', 'digit', '', '', 10, ''),
 ('bx_googlecon_secret', '', @iCategId, '_bx_googlecon_option_app_secret', 'digit', '', '', 20, ''),
-('bx_googlecon_redirect_page', 'dashboard', @iCategId, '_bx_googlecon_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
-('bx_googlecon_module', 'bx_persons', @iCategId, '_bx_googlecon_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:12:"bx_googlecon";s:6:"method";s:20:"get_profiles_modules";}'),
-('bx_googlecon_confirm_email', 'on', @iCategId, '_bx_googlecon_option_confirm_email', 'checkbox', '', '', 70, ''),
-('bx_googlecon_approve', '', @iCategId, '_bx_googlecon_option_approve', 'checkbox', '', '', 80, '');
+('bx_googlecon_redirect_page', 'dashboard', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
+('bx_googlecon_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:12:"bx_googlecon";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_googlecon_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_googlecon_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, '');
 
 -- Pages
 

+ 3 - 19
modules/boonex/linkedin_connect/classes/BxLinkedinModule.php

@@ -15,17 +15,7 @@ class BxLinkedinModule extends BxBaseModConnectModule
     {
         parent::__construct($aModule);
     }
-
-    /**
-     * Generate admin page;
-     *
-     * @return : (text) - html presentation data;
-     */
-    function actionAdministration()
-    {
-        parent::_actionAdministration('bx_linkedin_api_key', '_bx_linkedin_settings', '_bx_linkedin_information', '_bx_linkedin_information_block');
-    }
-
+    
     /**
      * Redirect to remote site login form
      *
@@ -62,7 +52,7 @@ class BxLinkedinModule extends BxBaseModConnectModule
 
         // check CSRF token
         if ($this->_getCsrfToken() != bx_get('state')) {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_bx_linkedin_state_invalid')));
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_state_invalid')));
             return;
         }
 
@@ -124,16 +114,10 @@ class BxLinkedinModule extends BxBaseModConnectModule
             }
         } 
         else {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_bx_linkedin_profile_error_info')));
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_profile_error_info')));
         }
     }
 
-    protected function _redirect($sUrl, $iStatus = 302)
-    {
-        header("Location:{$sUrl}", true, $iStatus);
-        exit;
-    }
-
     /**
      * @param $aProfileInfo - remote profile info
      * @param $sAlternativeName - suffix to add to NickName to make it unique

+ 1 - 1
modules/boonex/linkedin_connect/classes/BxLinkedinStudioPage.php

@@ -20,7 +20,7 @@ class BxLinkedinStudioPage extends BxTemplStudioModule
     protected function getPageCaptionHelp()
     {
         $oTemplate = BxDolStudioTemplate::getInstance();
-        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_linkedin&page=help">' . _t('_bx_linkedin_information') . "</a>";
+        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_linkedin&page=help">' . _t('_sys_connect_information') . "</a>";
         return $oTemplate->parseHtmlByName('page_caption_help.html', array('content' => $sContent));
     }
 }

+ 1 - 10
modules/boonex/linkedin_connect/install/langs/en.xml

@@ -3,7 +3,6 @@
 	<string name="_sys_module_linkedin"><![CDATA[LinkedIn Connect]]></string>
 	<string name="_bx_linkedin"><![CDATA[LinkedIn Connect]]></string>
 	<string name="_bx_linkedin_settings"><![CDATA[LinkedIn Connect]]></string>
-	<string name="_bx_linkedin_information"><![CDATA[LinkedIn connect information]]></string>
 	<string name="_bx_linkedin_information_block"><![CDATA[
         <p>This module can be used to login to this site using LinkedIn credentials.</p>
         <p>To make it work, <a target="_blank" href="https://www.linkedin.com/developer/apps">create LinkedIn app</a> and specify all the details, particularly:
@@ -13,20 +12,12 @@
             </ul>
             Then enter generated Client ID & Secret pair in this module settings.
         </p>]]></string>
-	<string name="_bx_linkedin_error_join_unavailable"><![CDATA[Sorry but join is unavailable now. Please try again later.]]></string>
-	<string name="_bx_linkedin_profile_error_info"><![CDATA[Can't define your profile information]]></string>
 	<string name="_bx_linkedin_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define Client ID and Secret)]]></string>
-	<string name="_bx_linkedin_auth_title"><![CDATA[LinkedIn Connect]]></string>
-	<string name="_bx_linkedin_state_invalid"><![CDATA[State parameter isn't matching]]></string>
+	<string name="_bx_linkedin_auth_title"><![CDATA[LinkedIn Connect]]></string>	
 
     <string name="_bx_linkedin_adm_stg_cpt_type"><![CDATA[LinkedIn Connect]]></string>
-    <string name="_bx_linkedin_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
     <string name="_bx_linkedin_option_app_id"><![CDATA[Client ID]]></string>
     <string name="_bx_linkedin_option_app_secret"><![CDATA[Client Secret]]></string>
-    <string name="_bx_linkedin_option_redirect"><![CDATA[Redirect page after first sign in]]></string>
-    <string name="_bx_linkedin_option_module"><![CDATA[Module to create profile in]]></string>
-    <string name="_bx_linkedin_option_confirm_email"><![CDATA[Always confirm emails when joined using LinkedIn Connect]]></string>
-    <string name="_bx_linkedin_option_approve"><![CDATA[Always approve profiles when joined using LinkedIn Connect]]></string>
 
 	<string name="_bx_linkedin_et_password_generated"><![CDATA[LinkedIn connect temporary password]]></string>
 	<string name="_bx_linkedin_et_password_generated_subject"><![CDATA[Temporary password]]></string>

+ 5 - 5
modules/boonex/linkedin_connect/install/sql/enable.sql

@@ -28,16 +28,16 @@ INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VA
 SET @iTypeId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_linkedin_general', '_bx_linkedin_adm_stg_cpt_category_general', 1);
+VALUES (@iTypeId, 'bx_linkedin_general', '_sys_connect_adm_stg_cpt_category_general', 1);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
 ('bx_linkedin_api_key', '', @iCategId, '_bx_linkedin_option_app_id', 'digit', '', '', 10, ''),
 ('bx_linkedin_secret', '', @iCategId, '_bx_linkedin_option_app_secret', 'digit', '', '', 20, ''),
-('bx_linkedin_redirect_page', 'dashboard', @iCategId, '_bx_linkedin_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
-('bx_linkedin_module', 'bx_persons', @iCategId, '_bx_linkedin_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:11:"bx_linkedin";s:6:"method";s:20:"get_profiles_modules";}'),
-('bx_linkedin_confirm_email', 'on', @iCategId, '_bx_linkedin_option_confirm_email', 'checkbox', '', '', 70, ''),
-('bx_linkedin_approve', '', @iCategId, '_bx_linkedin_option_approve', 'checkbox', '', '', 80, '');
+('bx_linkedin_redirect_page', 'dashboard', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
+('bx_linkedin_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:11:"bx_linkedin";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_linkedin_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_linkedin_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, '');
 
 -- Pages
 

+ 0 - 7
modules/boonex/russian/data/langs/bx_facebook/ru.xml

@@ -3,25 +3,18 @@
 	<string name="_sys_module_facebook_connect"><![CDATA[Facebook-соединение]]></string>
 	<string name="_bx_facebook"><![CDATA[Facebook-соединение]]></string>
 	<string name="_bx_facebook_settings"><![CDATA[Facebook-соединение]]></string>
-	<string name="_bx_facebook_information"><![CDATA[Facebook-соединение, информация]]></string>
 	<string name="_bx_facebook_information_block"><![CDATA[Чтобы получить "App ID" и "App Secret", нужно <a href="https://developers.facebook.com/apps/" target="_blank">создать новое приложение</a>. <br /><br /><a href="http://www.boonex.com/forums/topic/How-to-setup-Facebook-Connect-module.htm" target="_blank">Инструкции по созданию Facebook приложения</a> <br /><br />Значение поля "Site URL" для приложения: <b>{0}</b> <br /><br />После выполнения этих шагов укажите "API Key" и "App Secret" в форме ниже:]]></string>
-	<string name="_bx_facebook_profile_error_info"><![CDATA[Невозможно получить информацию о Вашем профиле]]></string>
 	<string name="_bx_facebook_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи facebook api)]]></string>
 	<string name="_bx_facebook_chart"><![CDATA[Facebook профили]]></string>
 	<string name="_bx_facebook_auth_title"><![CDATA[Facebook-соединение]]></string>
 	<string name="_bx_facebook_error"><![CDATA[Ошибка]]></string>
 
     <string name="_bx_facebook_adm_stg_cpt_type"><![CDATA[Facebook-соединение]]></string>
-    <string name="_bx_facebook_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
     <string name="_bx_facebook_option_app_id"><![CDATA[Facebook App ID]]></string>
     <string name="_bx_facebook_option_app_secret"><![CDATA[Facebook App Secret]]></string>
-    <string name="_bx_facebook_option_redirect"><![CDATA[Перенаправления после захода на сайт]]></string>
     <string name="_bx_facebook_option_auto_friends"><![CDATA[Автоматически делать друзьями тех, что уже друг на Facebook'е]]></string>
     <string name="_bx_facebook_option_fetch_extended_info"><![CDATA[Получить расширенную информацию о профиле (приложение должно быть одобрено Facebook'ом)]]></string>
-    <string name="_bx_facebook_option_module"><![CDATA[Модуль в котором создавать профили]]></string>
     <string name="_bx_facebook_option_privacy"><![CDATA[Настройки конфиденциальности для созданных профилей]]></string>
-    <string name="_bx_facebook_option_confirm_email"><![CDATA[Всегда подтверждать емейл, когда заходят через Facebook]]></string>
-    <string name="_bx_facebook_option_approve"><![CDATA[Всегда одобрять профиль, когда заходят через Facebook]]></string>
 
 	<string name="_bx_facebook_conect_et_password_generated"><![CDATA[Facebook-соединение: временный пароль]]></string>
 	<string name="_bx_facebook_conect_et_password_generated_subject"><![CDATA[Временный пароль]]></string>

+ 0 - 9
modules/boonex/russian/data/langs/bx_googlecon/ru.xml

@@ -3,7 +3,6 @@
 	<string name="_sys_module_googlecon"><![CDATA[Google соединение]]></string>
 	<string name="_bx_googlecon"><![CDATA[Google соединение]]></string>
 	<string name="_bx_googlecon_settings"><![CDATA[Google соединение]]></string>
-	<string name="_bx_googlecon_information"><![CDATA[Информация о Google соединении]]></string>
 	<string name="_bx_googlecon_information_block"><![CDATA[
         <p>Этот модуль может использоваться для входа на сайт используя Google профиль.</p>
         <p>Чтобы он заработал, следуйте следующим инструкциям - <a target="_blank" href="https://developers.google.com/identity/sign-in/web/devconsole-project">как создать Google проект</a>, следуя инструкциям укажите слудующие детали:<br />
@@ -12,20 +11,12 @@
             </ul>
             Затем нужно ввести полученную пару Client ID & Secret в настройках этого модуля.
         </p>]]></string>
-	<string name="_bx_googlecon_error_join_unavailable"><![CDATA[Извините, но регистрация на данный момент недоступна. Пожалуйста попробуйте снова попозже.]]></string>
-	<string name="_bx_googlecon_profile_error_info"><![CDATA[Невозможно получить информацию о профиле]]></string>
 	<string name="_bx_googlecon_profile_error_api_keys"><![CDATA[Нужно настроить модуль - указать Google Client ID & Secret]]></string>
 	<string name="_bx_googlecon_auth_title"><![CDATA[Google соединение]]></string>
-	<string name="_bx_googlecon_state_invalid"><![CDATA["State" параметр не совпадает]]></string>
 
     <string name="_bx_googlecon_adm_stg_cpt_type"><![CDATA[Google соединение]]></string>
-    <string name="_bx_googlecon_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
     <string name="_bx_googlecon_option_app_id"><![CDATA[Client ID]]></string>
     <string name="_bx_googlecon_option_app_secret"><![CDATA[Client Secret]]></string>
-    <string name="_bx_googlecon_option_redirect"><![CDATA[Перенаправление после захода на сайт]]></string>
-    <string name="_bx_googlecon_option_module"><![CDATA[Модуль в котором создавать профили]]></string>
-    <string name="_bx_googlecon_option_confirm_email"><![CDATA[Всегда подтверждать емейл, когда заходят через Google соединение]]></string>
-    <string name="_bx_googlecon_option_approve"><![CDATA[Всегда одобрять профиль, когда заходят через Google соединение]]></string>
 
 	<string name="_bx_googlecon_et_password_generated"><![CDATA[Google соединение: временный пароль]]></string>
 	<string name="_bx_googlecon_et_password_generated_subject"><![CDATA[Временный пароль]]></string>

+ 2 - 10
modules/boonex/russian/data/langs/bx_linkedin/ru.xml

@@ -3,7 +3,6 @@
 	<string name="_sys_module_linkedin"><![CDATA[LinkedIn соединение]]></string>
 	<string name="_bx_linkedin"><![CDATA[LinkedIn соединение]]></string>
 	<string name="_bx_linkedin_settings"><![CDATA[LinkedIn соединение]]></string>
-	<string name="_bx_linkedin_information"><![CDATA[Информация о LinkedIn соединении]]></string>
 	<string name="_bx_linkedin_information_block"><![CDATA[
         <p>Этот модуль может использоваться для входа на сайт используя LinkedIn профиль.</p>
         <p>Чтобы он заработал, нужно <a target="_blank" href="https://www.linkedin.com/developer/apps">создать LinkedIn приложение</a> и указать всю необходимую информацию, в частности:
@@ -13,20 +12,13 @@
             </ul>
             Затем нужно ввести полученную пару Client ID & Secret в настройках этого модуля.
         </p>]]></string>
-	<string name="_bx_linkedin_error_join_unavailable"><![CDATA[Извините, но регистрация на данный момент недоступна. Пожалуйста попробуйте снова попозже.]]></string>
-	<string name="_bx_linkedin_profile_error_info"><![CDATA[Невозможно получить информацию о профиле]]></string>
-	<string name="_bx_linkedin_profile_error_api_keys"><![CDATA[Нужно настроить модуль - указать LinkedIn Client ID & Secret]]></string>
+    
+    <string name="_bx_linkedin_profile_error_api_keys"><![CDATA[Нужно настроить модуль - указать LinkedIn Client ID & Secret]]></string>
 	<string name="_bx_linkedin_auth_title"><![CDATA[LinkedIn соединение]]></string>
-	<string name="_bx_linkedin_state_invalid"><![CDATA["State" параметр не совпадает]]></string>
 
     <string name="_bx_linkedin_adm_stg_cpt_type"><![CDATA[LinkedIn соединение]]></string>
-    <string name="_bx_linkedin_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
     <string name="_bx_linkedin_option_app_id"><![CDATA[Client ID]]></string>
     <string name="_bx_linkedin_option_app_secret"><![CDATA[Client Secret]]></string>
-    <string name="_bx_linkedin_option_redirect"><![CDATA[Перенаправление после захода на сайт]]></string>
-    <string name="_bx_linkedin_option_module"><![CDATA[Модуль в котором создавать профили]]></string>
-    <string name="_bx_linkedin_option_confirm_email"><![CDATA[Всегда подтверждать емейл, когда заходят через LinkedIn соединение]]></string>
-    <string name="_bx_linkedin_option_approve"><![CDATA[Всегда одобрять профиль, когда заходят через LinkedIn соединение]]></string>
 
 	<string name="_bx_linkedin_et_password_generated"><![CDATA[LinkedIn соединение: временный пароль]]></string>
 	<string name="_bx_linkedin_et_password_generated_subject"><![CDATA[Временный пароль]]></string>

+ 0 - 9
modules/boonex/russian/data/langs/bx_tricon/ru.xml

@@ -3,29 +3,20 @@
 	<string name="_sys_module_tricon"><![CDATA[Trident-соединение]]></string>
 	<string name="_bx_tricon"><![CDATA[Trident-соединение]]></string>
 	<string name="_bx_tricon_settings"><![CDATA[Trident-соединение]]></string>
-	<string name="_bx_tricon_information"><![CDATA[Trident-соединение, информация]]></string>
 	<string name="_bx_tricon_information_block"><![CDATA[
 Этот модуль может использоваться для захода на сайт используя другой Trident сайт (главный сайт). <br />
 Для этого нужно зайти на главный сайт, установить модуль "OAuth2 Server", добавить новый клиентский сайт, указав любой заголовок и следующий URL: <br />
 <strong>{0}</strong><br />
 Затем нужно ввести полученные ключ и секретный код в настройках этого модуля]]></string>
-	<string name="_bx_tricon_error_join_unavailable"><![CDATA[Извините, но в данный момент регистрация не доступна. Пожалуйста, попробуйте позже.]]></string>
-	<string name="_bx_tricon_profile_error_info"><![CDATA[Невозможно получить информацию о Вашем профиле]]></string>
 	<string name="_bx_tricon_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи)]]></string>
 	<string name="_bx_tricon_chart"><![CDATA[Trident профили]]></string>
 	<string name="_bx_tricon_auth_title"><![CDATA[Trident-соединение]]></string>
-	<string name="_bx_tricon_state_invalid"><![CDATA['State' параметр не совпадает]]></string>
 
     <string name="_bx_tricon_adm_stg_cpt_type"><![CDATA[Trident-соединение]]></string>
-    <string name="_bx_tricon_adm_stg_cpt_category_general"><![CDATA[Общие]]></string>
     <string name="_bx_tricon_option_app_id"><![CDATA[Trident App ID]]></string>
     <string name="_bx_tricon_option_app_secret"><![CDATA[Trident App Secret]]></string>
     <string name="_bx_tricon_option_app_url"><![CDATA[URL главного Trident сайта]]></string>
-    <string name="_bx_tricon_option_redirect"><![CDATA[Перенаправление после захода на сайт]]></string>
     <string name="_bx_tricon_option_auto_friends"><![CDATA[Автоматически делать друзьями тех, что уже друг на другом Trident сайте]]></string>
-    <string name="_bx_tricon_option_module"><![CDATA[Модуль в котором создавать профили]]></string>
-    <string name="_bx_tricon_option_confirm_email"><![CDATA[Всегда подтверждать емейл, когда заходят через Trident-соединение]]></string>
-    <string name="_bx_tricon_option_approve"><![CDATA[Всегда одобрять профиль, когда заходят через Trident-соединение]]></string>
     <string name="_bx_tricon_option_rewrite"><![CDATA[Использовать преобразованные ссылки на главном Trident сайта]]></string>
 
 	<string name="_bx_tricon_et_password_generated"><![CDATA[Trident-соединение: временный пароль]]></string>

+ 2 - 18
modules/boonex/trident_connect/classes/BxTriConModule.php

@@ -16,16 +16,6 @@ class BxTriConModule extends BxBaseModConnectModule
         parent::__construct($aModule);
     }
 
-    /**
-     * Generate admin page;
-     *
-     * @return : (text) - html presentation data;
-     */
-    function actionAdministration()
-    {
-        parent::_actionAdministration('bx_tricon_api_key', '_bx_tricon_settings', '_bx_tricon_information', '_bx_tricon_information_block');
-    }
-
     /**
      * Redirect to remote Trident site login form
      *
@@ -62,7 +52,7 @@ class BxTriConModule extends BxBaseModConnectModule
 
         // check CSRF token
         if ($this->_getCsrfToken() != bx_get('state')) {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_bx_tricon_state_invalid')));
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_state_invalid')));
             return;
         }
 
@@ -125,16 +115,10 @@ class BxTriConModule extends BxBaseModConnectModule
             }
         } 
         else {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_bx_tricon_profile_error_info')));
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_profile_error_info')));
         }
     }
 
-    protected function _redirect($sUrl, $iStatus = 302)
-    {
-        header("Location:{$sUrl}", true, $iStatus);
-        exit;
-    }
-
     /**
      * @param $aProfileInfo - remote profile info
      * @param $sAlternativeName - suffix to add to NickName to make it unique

+ 1 - 1
modules/boonex/trident_connect/classes/BxTriConStudioPage.php

@@ -19,7 +19,7 @@ class BxTriConStudioPage extends BxTemplStudioModule
     protected function getPageCaptionHelp()
     {
         $oTemplate = BxDolStudioTemplate::getInstance();
-        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_tricon&page=help">' . _t('_bx_tricon_information') . "</a>";
+        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_tricon&page=help">' . _t('_sys_connect_information') . "</a>";
         return $oTemplate->parseHtmlByName('page_caption_help.html', array('content' => $sContent));
     }
 }

+ 0 - 9
modules/boonex/trident_connect/install/langs/en.xml

@@ -3,29 +3,20 @@
 	<string name="_sys_module_tricon"><![CDATA[Trident Connect]]></string>
 	<string name="_bx_tricon"><![CDATA[Trident Connect]]></string>
 	<string name="_bx_tricon_settings"><![CDATA[Trident Connect]]></string>
-	<string name="_bx_tricon_information"><![CDATA[Trident connect information]]></string>
 	<string name="_bx_tricon_information_block"><![CDATA[
 This module can be used to login to this site using another Trident site (master site) credentials. <br />
 To make it work, go to the master site, install "OAuth2 Server" module and add new client site, specify the desired title and the following URL:<br />
 <strong>{0}</strong><br />
 Then enter generated on the master site the Key & Server pair in this module settings.]]></string>
-	<string name="_bx_tricon_error_join_unavailable"><![CDATA[Sorry but join is unavailable now. Please try again later.]]></string>
-	<string name="_bx_tricon_profile_error_info"><![CDATA[Can't define your profile information]]></string>
 	<string name="_bx_tricon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define API key, secret & URL)]]></string>
 	<string name="_bx_tricon_chart"><![CDATA[Trident Profiles]]></string>
 	<string name="_bx_tricon_auth_title"><![CDATA[Trident Connect]]></string>
-	<string name="_bx_tricon_state_invalid"><![CDATA[State parameter isn't matching]]></string>
 
     <string name="_bx_tricon_adm_stg_cpt_type"><![CDATA[Trident Connect]]></string>
-    <string name="_bx_tricon_adm_stg_cpt_category_general"><![CDATA[General]]></string>
     <string name="_bx_tricon_option_app_id"><![CDATA[Trident App ID]]></string>
     <string name="_bx_tricon_option_app_secret"><![CDATA[Trident App Secret]]></string>
     <string name="_bx_tricon_option_app_url"><![CDATA[Main Trident Site URL]]></string>
-    <string name="_bx_tricon_option_redirect"><![CDATA[Redirect page after first sign in]]></string>
     <string name="_bx_tricon_option_auto_friends"><![CDATA[Auto-friend members if they are already friends on other Trident site]]></string>
-    <string name="_bx_tricon_option_module"><![CDATA[Module to create profile in]]></string>
-    <string name="_bx_tricon_option_confirm_email"><![CDATA[Always confirm emails when joined using Trident Connect]]></string>
-    <string name="_bx_tricon_option_approve"><![CDATA[Always approve profiles when joined using Trident Connect]]></string>
     <string name="_bx_tricon_option_rewrite"><![CDATA[Use rewrite URLs on main Trident site]]></string>
 
 	<string name="_bx_tricon_et_password_generated"><![CDATA[Trident connect temporary password]]></string>

+ 5 - 5
modules/boonex/trident_connect/install/sql/enable.sql

@@ -28,18 +28,18 @@ INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VA
 SET @iTypeId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_tricon_general', '_bx_tricon_adm_stg_cpt_category_general', 1);
+VALUES (@iTypeId, 'bx_tricon_general', '_sys_connect_adm_stg_cpt_category_general', 1);
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `order`, `extra`) VALUES
 ('bx_tricon_api_key', '', @iCategId, '_bx_tricon_option_app_id', 'digit', '', '', 10, ''),
 ('bx_tricon_secret', '', @iCategId, '_bx_tricon_option_app_secret', 'digit', '', '', 20, ''),
 ('bx_tricon_url', '', @iCategId, '_bx_tricon_option_app_url', 'digit', '', '', 30, ''),
-('bx_tricon_redirect_page', 'dashboard', @iCategId, '_bx_tricon_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
-('bx_tricon_module', 'bx_persons', @iCategId, '_bx_tricon_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:9:"bx_tricon";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_tricon_redirect_page', 'dashboard', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
+('bx_tricon_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:9:"bx_tricon";s:6:"method";s:20:"get_profiles_modules";}'),
 ('bx_tricon_auto_friends', 'on', @iCategId, '_bx_tricon_option_auto_friends', 'checkbox', '', '', 60, ''),
-('bx_tricon_confirm_email', 'on', @iCategId, '_bx_tricon_option_confirm_email', 'checkbox', '', '', 70, ''),
-('bx_tricon_approve', '', @iCategId, '_bx_tricon_option_approve', 'checkbox', '', '', 80, ''),
+('bx_tricon_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_tricon_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, ''),
 ('bx_tricon_url_rewrite', 'on', @iCategId, '_bx_tricon_option_rewrite', 'checkbox', '', '', 90, '');
 
 -- Pages