Explorar el Código

#485 Renaming Trident Connect to UNA Connect

Alex Trofimov hace 10 años
padre
commit
821e3aae4e
Se han modificado 31 ficheros con 240 adiciones y 662 borrados
  1. 17 17
      modules/boonex/russian/data/langs/bx_unacon/ru.xml
  2. 0 21
      modules/boonex/trident_connect/classes/BxTriConAlerts.php
  3. 0 49
      modules/boonex/trident_connect/classes/BxTriConConfig.php
  4. 0 20
      modules/boonex/trident_connect/classes/BxTriConDb.php
  5. 0 20
      modules/boonex/trident_connect/classes/BxTriConTemplate.php
  6. 0 20
      modules/boonex/trident_connect/install/installer.php
  7. 0 28
      modules/boonex/trident_connect/install/langs/en.xml
  8. 0 51
      modules/boonex/trident_connect/install/sql/enable.sql
  9. 0 51
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/config.php
  10. 0 13
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/installer.php
  11. 0 12
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/langs/en.xml
  12. 0 7
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/sql/enable.sql
  13. 0 165
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/classes/BxTriConModule.php
  14. 0 27
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/classes/BxTriConStudioPage.php
  15. 0 68
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/install/config.php
  16. 0 29
      modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/install/langs/en.xml
  17. 21 0
      modules/boonex/una_connect/classes/BxUnaConAlerts.php
  18. 49 0
      modules/boonex/una_connect/classes/BxUnaConConfig.php
  19. 20 0
      modules/boonex/una_connect/classes/BxUnaConDb.php
  20. 16 15
      modules/boonex/una_connect/classes/BxUnaConModule.php
  21. 7 7
      modules/boonex/una_connect/classes/BxUnaConStudioPage.php
  22. 20 0
      modules/boonex/una_connect/classes/BxUnaConTemplate.php
  23. 10 10
      modules/boonex/una_connect/install/config.php
  24. 20 0
      modules/boonex/una_connect/install/installer.php
  25. 28 0
      modules/boonex/una_connect/install/langs/en.xml
  26. 6 6
      modules/boonex/una_connect/install/sql/disable.sql
  27. 17 17
      modules/boonex/una_connect/install/sql/enable.sql
  28. 3 3
      modules/boonex/una_connect/install/sql/install.sql
  29. 2 2
      modules/boonex/una_connect/install/sql/uninstall.sql
  30. 4 4
      modules/boonex/una_connect/request.php
  31. 0 0
      modules/boonex/una_connect/template/images/icons/std-icon.svg

+ 17 - 17
modules/boonex/russian/data/langs/bx_tricon/ru.xml → modules/boonex/russian/data/langs/bx_unacon/ru.xml

@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources name="ru" flag="ru" title="Russian">
-	<string name="_sys_module_tricon"><![CDATA[UNA-соединение]]></string>
-	<string name="_bx_tricon"><![CDATA[UNA-соединение]]></string>
-	<string name="_bx_tricon_settings"><![CDATA[UNA-соединение]]></string>
-	<string name="_bx_tricon_information_block"><![CDATA[
+	<string name="_sys_module_unacon"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_settings"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_information_block"><![CDATA[
 Этот модуль может использоваться для захода на сайт используя другой UNA сайт (главный сайт). <br />
 Для этого нужно зайти на главный сайт, установить модуль "OAuth2 Server", добавить новый клиентский сайт, указав любой заголовок и следующий URL: <br />
 <strong>{0}</strong><br />
 Затем нужно ввести полученные ключ и секретный код в настройках этого модуля]]></string>
-	<string name="_bx_tricon_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи)]]></string>
-	<string name="_bx_tricon_chart"><![CDATA[UNA профили]]></string>
-	<string name="_bx_tricon_auth_title"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи)]]></string>
+	<string name="_bx_unacon_chart"><![CDATA[UNA профили]]></string>
+	<string name="_bx_unacon_auth_title"><![CDATA[UNA-соединение]]></string>
 
-    <string name="_bx_tricon_adm_stg_cpt_type"><![CDATA[UNA-соединение]]></string>
-    <string name="_bx_tricon_option_app_id"><![CDATA[UNA App ID]]></string>
-    <string name="_bx_tricon_option_app_secret"><![CDATA[UNA App Secret]]></string>
-    <string name="_bx_tricon_option_app_url"><![CDATA[URL главного UNA сайта]]></string>
-    <string name="_bx_tricon_option_auto_friends"><![CDATA[Автоматически делать друзьями тех, что уже друг на другом UNA сайте]]></string>
-    <string name="_bx_tricon_option_rewrite"><![CDATA[Использовать преобразованные ссылки на главном UNA сайта]]></string>
+    <string name="_bx_unacon_adm_stg_cpt_type"><![CDATA[UNA-соединение]]></string>
+    <string name="_bx_unacon_option_app_id"><![CDATA[UNA App ID]]></string>
+    <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_tricon_et_password_generated"><![CDATA[UNA-соединение: временный пароль]]></string>
-	<string name="_bx_tricon_et_password_generated_subject"><![CDATA[Временный пароль]]></string>
-	<string name="_bx_tricon_et_password_generated_body"><![CDATA[{email_header}
+	<string name="_bx_unacon_et_password_generated"><![CDATA[UNA-соединение: временный пароль]]></string>
+	<string name="_bx_unacon_et_password_generated_subject"><![CDATA[Временный пароль]]></string>
+	<string name="_bx_unacon_et_password_generated_body"><![CDATA[{email_header}
 <p>Временный пароль - <b>{password}</b></p>
 <p>Его нужно изменить, после первого захода на сайт.</p>
 {email_footer}]]></string>
-</resources>
+</resources>

+ 0 - 21
modules/boonex/trident_connect/classes/BxTriConAlerts.php

@@ -1,21 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConAlerts extends BxBaseModConnectAlerts
-{
-    function __construct()
-    {
-        parent::__construct();
-        $this -> oModule = BxDolModule::getInstance('bx_tricon');
-    }
-}
-
-/** @} */

+ 0 - 49
modules/boonex/trident_connect/classes/BxTriConConfig.php

@@ -1,49 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConConfig extends BxBaseModConnectConfig
-{
-    public $sApiID;
-    public $sApiSecret;
-    public $sApiUrl;
-
-    public $sPageStart;
-    public $sPageHandle;
-
-    public $sScope = 'basic';
-
-    function __construct($aModule)
-    {
-        parent::__construct($aModule);
-
-        $this -> sApiID = getParam('bx_tricon_api_key');
-        $this -> sApiSecret = getParam('bx_tricon_secret');
-        $this -> sApiUrl = trim(getParam('bx_tricon_url'), '/') . (getParam('bx_tricon_url_rewrite') ? '/m/oauth2/' : '/modules/?r=oauth2/');
-
-        $this -> sSessionUid = 'tricon_session';
-        $this -> sSessionProfile = 'tricon_session_profile';
-
-        $this -> sEmailTemplatePasswordGenerated = 'bx_tricon_password_generated';
-        $this -> sDefaultTitleLangKey = '_bx_tricon';
-
-        $this -> sRedirectPage = getParam('bx_tricon_redirect_page');
-        $this -> sProfilesModule = getParam('bx_tricon_module');
-        $this -> isAlwaysConfirmEmail = (bool)getParam('bx_tricon_confirm_email'); 
-        $this -> isAlwaysAutoApprove = (bool)getParam('bx_tricon_approve');
-
-        $this -> bAutoFriends = 'on' == getParam('bx_tricon_auto_friends');
-
-        $this -> sPageStart = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'start';
-        $this -> sPageHandle = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'handle';
-    }
-}
-
-/** @} */

+ 0 - 20
modules/boonex/trident_connect/classes/BxTriConDb.php

@@ -1,20 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConDb extends BxBaseModConnectDb
-{
-    function __construct(&$oConfig)
-    {
-        parent::__construct($oConfig);
-    }
-}
-
-/** @} */

+ 0 - 20
modules/boonex/trident_connect/classes/BxTriConTemplate.php

@@ -1,20 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConTemplate extends BxBaseModConnectTemplate
-{
-    function __construct(&$oConfig, &$oDb)
-    {
-        parent::__construct($oConfig, $oDb);
-    }
-}
-
-/** @} */

+ 0 - 20
modules/boonex/trident_connect/install/installer.php

@@ -1,20 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConInstaller extends BxDolStudioInstaller
-{
-    function __construct($aConfig)
-    {
-        parent::__construct($aConfig);
-    }
-}
-
-/** @} */

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

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources name="en" flag="gb" title="English">
-	<string name="_sys_module_tricon"><![CDATA[UNA Connect]]></string>
-	<string name="_bx_tricon"><![CDATA[UNA Connect]]></string>
-	<string name="_bx_tricon_settings"><![CDATA[UNA Connect]]></string>
-	<string name="_bx_tricon_information_block"><![CDATA[
-This module can be used to login to this site using another UNA 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_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[UNA Profiles]]></string>
-	<string name="_bx_tricon_auth_title"><![CDATA[UNA Connect]]></string>
-
-    <string name="_bx_tricon_adm_stg_cpt_type"><![CDATA[UNA Connect]]></string>
-    <string name="_bx_tricon_option_app_id"><![CDATA[UNA App ID]]></string>
-    <string name="_bx_tricon_option_app_secret"><![CDATA[UNA App Secret]]></string>
-    <string name="_bx_tricon_option_app_url"><![CDATA[Main UNA Site URL]]></string>
-    <string name="_bx_tricon_option_auto_friends"><![CDATA[Auto-friend members if they are already friends on other UNA site]]></string>
-    <string name="_bx_tricon_option_rewrite"><![CDATA[Use rewrite URLs on main UNA site]]></string>
-
-	<string name="_bx_tricon_et_password_generated"><![CDATA[UNA connect temporary password]]></string>
-	<string name="_bx_tricon_et_password_generated_subject"><![CDATA[Temporary password]]></string>
-	<string name="_bx_tricon_et_password_generated_body"><![CDATA[{email_header}
-<p>Temporary password - <b>{password}</b></p>
-<p>Change it after logging-in.</p>
-{email_footer}]]></string>
-</resources>

+ 0 - 51
modules/boonex/trident_connect/install/sql/enable.sql

@@ -1,51 +0,0 @@
-
--- Email template
-
-INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
-('bx_tricon', '_bx_tricon_et_password_generated', 'bx_tricon_password_generated', '_bx_tricon_et_password_generated_subject', '_bx_tricon_et_password_generated_body');
-
--- Auth objects
-
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_tricon', '_bx_tricon_auth_title', 'modules/?r=tricon/start', 'sign-in');
-
--- Alerts
-
-INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_tricon', `class` = 'BxTriConAlerts', `file` = 'modules/boonex/trident_connect/classes/BxTriConAlerts.php';
-
-SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name` = 'bx_tricon');
-
-INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
-('account', 'logout', @iHandlerId),
-('profile', 'delete', @iHandlerId),
-('profile', 'add', @iHandlerId);
-
--- Options
-
-SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
-INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
-('modules', 'bx_tricon', '_bx_tricon_adm_stg_cpt_type', 'bx_tricon@modules/boonex/trident_connect/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
-SET @iTypeId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-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, '_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, '_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
-
-INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_tricon_error', 'tricon-error', '_bx_tricon_error', '_bx_tricon_error', 'bx_tricon', 5, 2147483647, 0, '', '', '', '', 0, 1, 0, 'BxTriConPage', 'modules/boonex/trident_connect/classes/BxTriConPage.php');
-
-INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_tricon_error', 1, 'bx_tricon', '_bx_tricon_error', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_tricon\";s:6:\"method\";s:10:\"last_error\";}', 0, 0, 1, 1);

+ 0 - 51
modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/config.php

@@ -1,51 +0,0 @@
-<?php
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- */
-
-$aConfig = array(
-    /**
-     * Main Section.
-     */
-    'title' => 'Trident connect',
-    'version_from' => '9.0.0',
-	'version_to' => '9.0.1',
-    'vendor' => 'BoonEx',
-
-    'compatible_with' => array(
-        '9.0.0-B2'
-    ),
-
-    /**
-     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
-     */
-    'home_dir' => 'boonex/trident_connect/updates/update_9.0.0_9.0.1/',
-	'home_uri' => 'tricon_update_900_901',
-
-	'module_dir' => 'boonex/trident_connect/',
-	'module_uri' => 'tricon',
-
-    'db_prefix' => 'bx_tricon_',
-    'class_prefix' => 'BxTriCon',
-
-    /**
-     * Installation/Uninstallation Section.
-     */
-    'install' => array(
-		'execute_sql' => 1,
-        'update_files' => 1,
-        'update_languages' => 1,
-		'clear_db_cache' => 1,
-    ),
-
-	/**
-     * Category for language keys.
-     */
-    'language_category' => 'Trident Connect',
-
-	/**
-     * Files Section
-     */
-    'delete_files' => array(),
-);

+ 0 - 13
modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/installer.php

@@ -1,13 +0,0 @@
-<?php
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- */
-
-class BxTriConUpdater extends BxDolStudioUpdater
-{
-    function __construct($aConfig)
-	{
-        parent::__construct($aConfig);
-    }
-}

+ 0 - 12
modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/langs/en.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources name="en" flag="gb" title="English">
-	<string_del name="_bx_tricon_information"><![CDATA[Trident connect information]]></string_del>
-	<string_del name="_bx_tricon_error_join_unavailable"><![CDATA[Sorry but join is unavailable now. Please try again later.]]></string_del>
-	<string_del name="_bx_tricon_profile_error_info"><![CDATA[Can't define your profile information]]></string_del>
-	<string_del name="_bx_tricon_state_invalid"><![CDATA[State parameter isn't matching]]></string_del>
-	<string_del name="_bx_tricon_adm_stg_cpt_category_general"><![CDATA[General]]></string_del>
-	<string_del name="_bx_tricon_option_redirect"><![CDATA[Redirect page after first sign in]]></string_del>
-	<string_del name="_bx_tricon_option_module"><![CDATA[Module to create profile in]]></string_del>
-	<string_del name="_bx_tricon_option_confirm_email"><![CDATA[Always confirm emails when joined using Trident Connect]]></string_del>
-	<string_del name="_bx_tricon_option_approve"><![CDATA[Always approve profiles when joined using Trident Connect]]></string_del>
-</resources>

+ 0 - 7
modules/boonex/trident_connect/updates/9.0.0_9.0.1/install/sql/enable.sql

@@ -1,7 +0,0 @@
--- SETTINGS
-UPDATE `sys_options_categories` SET `caption`='_sys_connect_adm_stg_cpt_category_general' WHERE `name`='bx_tricon_general';
-
-UPDATE `sys_options` SET `caption`='_sys_connect_option_redirect' WHERE `name`='bx_tricon_redirect_page';
-UPDATE `sys_options` SET `caption`='_sys_connect_option_module' WHERE `name`='bx_tricon_module';
-UPDATE `sys_options` SET `caption`='_sys_connect_option_confirm_email' WHERE `name`='bx_tricon_confirm_email';
-UPDATE `sys_options` SET `caption`='_sys_connect_option_approve' WHERE `name`='bx_tricon_approve';

+ 0 - 165
modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/classes/BxTriConModule.php

@@ -1,165 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConModule extends BxBaseModConnectModule
-{
-    function __construct(&$aModule)
-    {
-        parent::__construct($aModule);
-    }
-
-    /**
-     * Redirect to remote Trident site login form
-     *
-     * @return n/a/ - redirect or HTML page in case of error
-     */
-    function actionStart()
-    {
-        if (isLogged())
-            $this->_redirect ($this -> _oConfig -> sDefaultRedirectUrl);
-
-        if (!$this->_oConfig->sApiID || !$this->_oConfig->sApiSecret || !$this->_oConfig->sApiUrl) {
-            require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
-            bx_import('BxDolLanguages');
-            $sCode =  MsgBox( _t('_bx_tricon_profile_error_api_keys') );
-            $this->_oTemplate->getPage(_t('_bx_tricon'), $sCode);            
-        } 
-        else {
-
-            // define redirect URL to the remote Trident site                
-            $sUrl = bx_append_url_params($this->_oConfig->sApiUrl . 'auth', array(
-                'response_type' => 'code',
-                'client_id' => $this->_oConfig->sApiID,
-                'redirect_uri' => $this->_oConfig->sPageHandle,
-                'scope' => $this->_oConfig->sScope,
-                'state' => $this->_genCsrfToken(),
-            ));
-            $this->_redirect($sUrl);
-        }
-    }
-
-    function actionHandle()
-    {
-        require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
-
-        // check CSRF token
-        if ($this->_getCsrfToken() != bx_get('state')) {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_state_invalid')));
-            return;
-        }
-
-        // check code
-        $sCode = bx_get('code');
-        if (!$sCode) {
-            $sErrorDescription = bx_get('error_description') ? bx_get('error_description') : _t('_error occured');
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
-            return;
-        }
-
-        // make request for token
-        $s = bx_file_get_contents($this->_oConfig->sApiUrl . 'token', array(
-            'client_id'     => $this->_oConfig->sApiID,
-            'client_secret' => $this->_oConfig->sApiSecret,
-            'grant_type'    => 'authorization_code',
-            'code'          => $sCode,
-            'redirect_uri'  => $this->_oConfig->sPageHandle,
-        ), 'post');
-
-        // handle error
-        if (!$s || NULL === ($aResponse = json_decode($s, true)) || !isset($aResponse['access_token']) || isset($aResponse['error'])) {
-            $sErrorDescription = isset($aResponse['error_description']) ? $aResponse['error_description'] : _t('_error occured');
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
-            return;
-        }
-
-        // get the data, especially access_token
-        $sAccessToken = $aResponse['access_token'];
-        $sExpiresIn = $aResponse['expires_in'];
-        $sExpiresAt = new \DateTime('+' . $sExpiresIn . ' seconds');
-        $sRefreshToken = $aResponse['refresh_token'];
-
-        // request info about profile
-        $s = bx_file_get_contents($this->_oConfig->sApiUrl . 'api/me', array(), 'get', array(
-            'Authorization: Bearer ' . $sAccessToken,
-        ));
-
-        // handle error
-        if (!$s || NULL === ($aResponse = json_decode($s, true)) || !$aResponse || isset($aResponse['error'])) {
-            $sErrorDescription = isset($aResponse['error_description']) ? $aResponse['error_description'] : _t('_error occured'); 
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
-            return;
-        }
-
-        $aRemoteProfileInfo = $aResponse;
-
-        if ($aRemoteProfileInfo) {
-
-            // check if user logged in before
-            $iLocalProfileId = $this->_oDb->getProfileId($aRemoteProfileInfo['id']);
-            
-            if ($iLocalProfileId && $oProfile = BxDolProfile::getInstance($iLocalProfileId)) {
-                // user already exists
-                $this->setLogged($oProfile ->id());
-            }             
-            else {  
-                // register new user
-                $this->_createProfile($aRemoteProfileInfo);
-            }
-        } 
-        else {
-            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_profile_error_info')));
-        }
-    }
-
-    /**
-     * @param $aProfileInfo - remote profile info
-     * @param $sAlternativeName - suffix to add to NickName to make it unique
-     * @return profile array info, ready for the local database
-     */
-    protected function _convertRemoteFields($aProfileInfo, $sAlternativeName = '')
-    {
-        $aProfileFields = $aProfileInfo;
-
-        $aProfileFields['name'] = $aProfileInfo['profile_display_name'];
-        $aProfileFields['fullname'] = $aProfileInfo['profile_display_name'];
-
-        return $aProfileFields;
-    }
-
-    protected function _genCsrfToken($bReturn = false)
-    {
-        if (getParam('sys_security_form_token_enable') != 'on' || defined('BX_DOL_CRON_EXECUTE'))
-            return false;
-
-        $oSession = BxDolSession::getInstance();
-
-        $iCsrfTokenLifetime = (int)$this->_oDb->getParam('sys_security_form_token_lifetime');
-        if ($oSession->getValue('bx_tricon_csrf_token') === false || ($iCsrfTokenLifetime != 0 && time() - (int)$oSession->getValue('csrf_token_time') > $iCsrfTokenLifetime)) {
-            $sToken = genRndPwd(20, false);
-            $oSession->setValue('bx_tricon_csrf_token', $sToken);
-            $oSession->setValue('bx_tricon_csrf_token_time', time());
-        }
-        else {
-            $sToken = $oSession->getValue('bx_tricon_csrf_token');
-        }
-
-        return $sToken;
-    }
-
-    protected function _getCsrfToken()
-    {
-        $oSession = BxDolSession::getInstance();
-        return $oSession->getValue('bx_tricon_csrf_token');
-    }
-
-}
-
-/** @} */

+ 0 - 27
modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/classes/BxTriConStudioPage.php

@@ -1,27 +0,0 @@
-<?php defined('BX_DOL') or die('hack attempt');
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-class BxTriConStudioPage extends BxTemplStudioModule
-{
-    function getHelp ()
-    {
-        return _t('_bx_tricon_information_block', BX_DOL_URL_ROOT);
-    }
-
-    protected function getPageCaptionHelp()
-    {
-        $oTemplate = BxDolStudioTemplate::getInstance();
-        $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 - 68
modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/install/config.php

@@ -1,68 +0,0 @@
-<?php 
-/**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
- *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
- *
- * @{
- */
-
-$aConfig = array(
-    /**
-     * Main Section.
-     */
-    'type' => BX_DOL_MODULE_TYPE_MODULE,
-    'name' => 'bx_tricon',
-    'title' => 'Trident connect',
-    'note' => 'Join the site using another Trident site account credentials.',
-    'version' => '9.0.1',
-    'vendor' => 'Boonex',
-    'help_url' => 'http://feed.boonex.com/?section={module_name}',
-
-    'compatible_with' => array(
-        '9.0.0-B2'
-    ),
-
-    /**
-     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
-     */
-    'home_dir' => 'boonex/trident_connect/',
-    'home_uri' => 'tricon',
-
-    'db_prefix' => 'bx_tricon_',
-    'class_prefix' => 'BxTriCon',
-
-    /**
-     * Category for language keys.
-     */
-    'language_category' => 'Trident Connect',
-
-    /**
-     * Installation/Uninstallation Section.
-     */
-    'install' => array(
-        'execute_sql' => 1,
-        'update_languages' => 1,
-    ),
-    'uninstall' => array (
-        'execute_sql' => 1,
-        'update_languages' => 1,
-    ),
-    'enable' => array(
-        'execute_sql' => 1,
-        'clear_db_cache' => 1,
-    ),
-    'disable' => array (
-        'execute_sql' => 1,
-        'clear_db_cache' => 1,
-    ),
-
-    /**
-     * Dependencies Section
-     */
-    'dependencies' => array(),
-);
-
-/** @} */

+ 0 - 29
modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/install/langs/en.xml

@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources name="en" flag="gb" title="English">
-	<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_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_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_adm_stg_cpt_type"><![CDATA[Trident Connect]]></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_auto_friends"><![CDATA[Auto-friend members if they are already friends on other Trident site]]></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>
-	<string name="_bx_tricon_et_password_generated_subject"><![CDATA[Temporary password]]></string>
-	<string name="_bx_tricon_et_password_generated_body"><![CDATA[<bx_include_auto:_email_header.html />
-<p>Temporary password - <b>{password}</b></p>
-<p>Change it after logging-in.</p>
-<bx_include_auto:_email_footer.html />]]></string>
-    
-</resources>

+ 21 - 0
modules/boonex/una_connect/classes/BxUnaConAlerts.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxUnaConAlerts extends BxBaseModConnectAlerts
+{
+    function __construct()
+    {
+        parent::__construct();
+        $this -> oModule = BxDolModule::getInstance('bx_unacon');
+    }
+}
+
+/** @} */

+ 49 - 0
modules/boonex/una_connect/classes/BxUnaConConfig.php

@@ -0,0 +1,49 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxUnaConConfig extends BxBaseModConnectConfig
+{
+    public $sApiID;
+    public $sApiSecret;
+    public $sApiUrl;
+
+    public $sPageStart;
+    public $sPageHandle;
+
+    public $sScope = 'basic';
+
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this -> sApiID = getParam('bx_unacon_api_key');
+        $this -> sApiSecret = getParam('bx_unacon_secret');
+        $this -> sApiUrl = trim(getParam('bx_unacon_url'), '/') . (getParam('bx_unacon_url_rewrite') ? '/m/oauth2/' : '/modules/?r=oauth2/');
+
+        $this -> sSessionUid = 'unacon_session';
+        $this -> sSessionProfile = 'unacon_session_profile';
+
+        $this -> sEmailTemplatePasswordGenerated = 'bx_unacon_password_generated';
+        $this -> sDefaultTitleLangKey = '_bx_unacon';
+
+        $this -> sRedirectPage = getParam('bx_unacon_redirect_page');
+        $this -> sProfilesModule = getParam('bx_unacon_module');
+        $this -> isAlwaysConfirmEmail = (bool)getParam('bx_unacon_confirm_email'); 
+        $this -> isAlwaysAutoApprove = (bool)getParam('bx_unacon_approve');
+
+        $this -> bAutoFriends = 'on' == getParam('bx_unacon_auto_friends');
+
+        $this -> sPageStart = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'start';
+        $this -> sPageHandle = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'handle';
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/una_connect/classes/BxUnaConDb.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxUnaConDb extends BxBaseModConnectDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 16 - 15
modules/boonex/trident_connect/classes/BxTriConModule.php → modules/boonex/una_connect/classes/BxUnaConModule.php

@@ -1,15 +1,15 @@
 <?php defined('BX_DOL') or die('hack attempt');
 /**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxTriConModule extends BxBaseModConnectModule
+class BxUnaConModule extends BxBaseModConnectModule
 {
     function __construct(&$aModule)
     {
@@ -17,7 +17,7 @@ class BxTriConModule extends BxBaseModConnectModule
     }
 
     /**
-     * Redirect to remote Trident site login form
+     * Redirect to remote site login form
      *
      * @return n/a/ - redirect or HTML page in case of error
      */
@@ -29,12 +29,12 @@ class BxTriConModule extends BxBaseModConnectModule
         if (!$this->_oConfig->sApiID || !$this->_oConfig->sApiSecret || !$this->_oConfig->sApiUrl) {
             require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
             bx_import('BxDolLanguages');
-            $sCode =  MsgBox( _t('_bx_tricon_profile_error_api_keys') );
-            $this->_oTemplate->getPage(_t('_bx_tricon'), $sCode);            
+            $sCode =  MsgBox( _t('_bx_unacon_profile_error_api_keys') );
+            $this->_oTemplate->getPage(_t('_bx_unacon'), $sCode);            
         } 
         else {
 
-            // define redirect URL to the remote Trident site                
+            // define redirect URL to the remote site                
             $sUrl = bx_append_url_params($this->_oConfig->sApiUrl . 'auth', array(
                 'response_type' => 'code',
                 'client_id' => $this->_oConfig->sApiID,
@@ -130,7 +130,8 @@ class BxTriConModule extends BxBaseModConnectModule
 
         $aProfileFields['name'] = $aProfileInfo['profile_display_name'];
         $aProfileFields['fullname'] = $aProfileInfo['profile_display_name'];
-
+        $aProfileFields['picture'] = $aProfileInfo['picture'];
+        
         return $aProfileFields;
     }
 
@@ -142,13 +143,13 @@ class BxTriConModule extends BxBaseModConnectModule
         $oSession = BxDolSession::getInstance();
 
         $iCsrfTokenLifetime = (int)$this->_oDb->getParam('sys_security_form_token_lifetime');
-        if ($oSession->getValue('bx_tricon_csrf_token') === false || ($iCsrfTokenLifetime != 0 && time() - (int)$oSession->getValue('csrf_token_time') > $iCsrfTokenLifetime)) {
+        if ($oSession->getValue('bx_unacon_csrf_token') === false || ($iCsrfTokenLifetime != 0 && time() - (int)$oSession->getValue('csrf_token_time') > $iCsrfTokenLifetime)) {
             $sToken = genRndPwd(20, false);
-            $oSession->setValue('bx_tricon_csrf_token', $sToken);
-            $oSession->setValue('bx_tricon_csrf_token_time', time());
+            $oSession->setValue('bx_unacon_csrf_token', $sToken);
+            $oSession->setValue('bx_unacon_csrf_token_time', time());
         }
         else {
-            $sToken = $oSession->getValue('bx_tricon_csrf_token');
+            $sToken = $oSession->getValue('bx_unacon_csrf_token');
         }
 
         return $sToken;
@@ -157,7 +158,7 @@ class BxTriConModule extends BxBaseModConnectModule
     protected function _getCsrfToken()
     {
         $oSession = BxDolSession::getInstance();
-        return $oSession->getValue('bx_tricon_csrf_token');
+        return $oSession->getValue('bx_unacon_csrf_token');
     }
 
 }

+ 7 - 7
modules/boonex/trident_connect/classes/BxTriConStudioPage.php → modules/boonex/una_connect/classes/BxUnaConStudioPage.php

@@ -1,25 +1,25 @@
 <?php defined('BX_DOL') or die('hack attempt');
 /**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxTriConStudioPage extends BxTemplStudioModule
+class BxUnaConStudioPage extends BxTemplStudioModule
 {
     function getHelp ()
     {
-        return _t('_bx_tricon_information_block', BX_DOL_URL_ROOT);
+        return _t('_bx_unacon_information_block', BX_DOL_URL_ROOT);
     }
 
     protected function getPageCaptionHelp()
     {
         $oTemplate = BxDolStudioTemplate::getInstance();
-        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_tricon&page=help">' . _t('_sys_connect_information') . "</a>";
+        $sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_unacon&page=help">' . _t('_sys_connect_information') . "</a>";
         return $oTemplate->parseHtmlByName('page_caption_help.html', array('content' => $sContent));
     }
 }

+ 20 - 0
modules/boonex/una_connect/classes/BxUnaConTemplate.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxUnaConTemplate extends BxBaseModConnectTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+}
+
+/** @} */

+ 10 - 10
modules/boonex/trident_connect/install/config.php → modules/boonex/una_connect/install/config.php

@@ -1,10 +1,10 @@
 <?php 
 /**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
  *
  * @{
  */
@@ -14,10 +14,10 @@ $aConfig = array(
      * Main Section.
      */
     'type' => BX_DOL_MODULE_TYPE_MODULE,
-    'name' => 'bx_tricon',
+    'name' => 'bx_unacon',
     'title' => 'UNA connect',
     'note' => 'Join the site using another UNA site account credentials.',
-    'version' => '9.0.2.DEV',
+    'version' => '9.0.0.DEV',
     'vendor' => 'Boonex',
     'help_url' => 'http://feed.boonex.com/?section={module_name}',
 
@@ -28,11 +28,11 @@ $aConfig = array(
     /**
      * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
      */
-    'home_dir' => 'boonex/trident_connect/',
-    'home_uri' => 'tricon',
+    'home_dir' => 'boonex/una_connect/',
+    'home_uri' => 'unacon',
 
-    'db_prefix' => 'bx_tricon_',
-    'class_prefix' => 'BxTriCon',
+    'db_prefix' => 'bx_unacon_',
+    'class_prefix' => 'BxUnaCon',
 
     /**
      * Category for language keys.

+ 20 - 0
modules/boonex/una_connect/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxUnaConInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 28 - 0
modules/boonex/una_connect/install/langs/en.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_sys_module_unacon"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon_settings"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon_information_block"><![CDATA[
+This module can be used to login to this site using another UNA 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_unacon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define API key, secret & URL)]]></string>
+	<string name="_bx_unacon_chart"><![CDATA[UNA Profiles]]></string>
+	<string name="_bx_unacon_auth_title"><![CDATA[UNA Connect]]></string>
+
+    <string name="_bx_unacon_adm_stg_cpt_type"><![CDATA[UNA Connect]]></string>
+    <string name="_bx_unacon_option_app_id"><![CDATA[UNA App ID]]></string>
+    <string name="_bx_unacon_option_app_secret"><![CDATA[UNA App Secret]]></string>
+    <string name="_bx_unacon_option_app_url"><![CDATA[Main UNA Site URL]]></string>
+    <string name="_bx_unacon_option_auto_friends"><![CDATA[Auto-friend members if they are already friends on other UNA site]]></string>
+    <string name="_bx_unacon_option_rewrite"><![CDATA[Use rewrite URLs on main UNA site]]></string>
+
+	<string name="_bx_unacon_et_password_generated"><![CDATA[UNA connect temporary password]]></string>
+	<string name="_bx_unacon_et_password_generated_subject"><![CDATA[Temporary password]]></string>
+	<string name="_bx_unacon_et_password_generated_body"><![CDATA[{email_header}
+<p>Temporary password - <b>{password}</b></p>
+<p>Change it after logging-in.</p>
+{email_footer}]]></string>
+</resources>

+ 6 - 6
modules/boonex/trident_connect/install/sql/disable.sql → modules/boonex/una_connect/install/sql/disable.sql

@@ -1,25 +1,25 @@
 
 -- Email template
 
-DELETE FROM `sys_email_templates` WHERE `Name` = 'bx_tricon_password_generated';
+DELETE FROM `sys_email_templates` WHERE `Name` = 'bx_unacon_password_generated';
 
 -- Auth objects
 
-DELETE FROM `sys_objects_auths` WHERE `Name` = 'bx_tricon';
+DELETE FROM `sys_objects_auths` WHERE `Name` = 'bx_unacon';
 
 -- Alerts
 
-SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name`  =  'bx_tricon');
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name`  =  'bx_unacon');
 
 DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandlerId;
 DELETE FROM `sys_alerts` WHERE `handler_id` =  @iHandlerId;
 
 -- Options
 
-DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name` = 'bx_tricon';
+DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name` = 'bx_unacon';
 
 -- Pages
 
-DELETE FROM `sys_objects_page` WHERE `module` = 'bx_tricon';
-DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_tricon';
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_unacon';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_unacon';
 

+ 17 - 17
modules/boonex/trident_connect/updates/9.0.0_9.0.1/source/install/sql/enable.sql → modules/boonex/una_connect/install/sql/enable.sql

@@ -2,18 +2,18 @@
 -- Email template
 
 INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
-('bx_tricon', '_bx_tricon_et_password_generated', 'bx_tricon_password_generated', '_bx_tricon_et_password_generated_subject', '_bx_tricon_et_password_generated_body');
+('bx_unacon', '_bx_unacon_et_password_generated', 'bx_unacon_password_generated', '_bx_unacon_et_password_generated_subject', '_bx_unacon_et_password_generated_body');
 
 -- Auth objects
 
 INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_tricon', '_bx_tricon_auth_title', 'modules/?r=tricon/start', 'sign-in');
+('bx_unacon', '_bx_unacon_auth_title', 'modules/?r=unacon/start', 'sign-in');
 
 -- Alerts
 
-INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_tricon', `class` = 'BxTriConAlerts', `file` = 'modules/boonex/dolphin_connect/classes/BxTriConAlerts.php';
+INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_unacon', `class` = 'BxUnaConAlerts', `file` = 'modules/boonex/una_connect/classes/BxUnaConAlerts.php';
 
-SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name` = 'bx_tricon');
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name` = 'bx_unacon');
 
 INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 ('account', 'logout', @iHandlerId),
@@ -24,28 +24,28 @@ INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 
 SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
 INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
-('modules', 'bx_tricon', '_bx_tricon_adm_stg_cpt_type', 'bx_tricon@modules/boonex/tricon/|std-mi.png', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
+('modules', 'bx_unacon', '_bx_unacon_adm_stg_cpt_type', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
 SET @iTypeId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_tricon_general', '_sys_connect_adm_stg_cpt_category_general', 1);
+VALUES (@iTypeId, 'bx_unacon_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, '_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, '_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, '');
+('bx_unacon_api_key', '', @iCategId, '_bx_unacon_option_app_id', 'digit', '', '', 10, ''),
+('bx_unacon_secret', '', @iCategId, '_bx_unacon_option_app_secret', 'digit', '', '', 20, ''),
+('bx_unacon_url', '', @iCategId, '_bx_unacon_option_app_url', 'digit', '', '', 30, ''),
+('bx_unacon_redirect_page', 'dashboard', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
+('bx_unacon_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:9:"bx_unacon";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_unacon_auto_friends', 'on', @iCategId, '_bx_unacon_option_auto_friends', 'checkbox', '', '', 60, ''),
+('bx_unacon_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_unacon_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, ''),
+('bx_unacon_url_rewrite', 'on', @iCategId, '_bx_unacon_option_rewrite', 'checkbox', '', '', 90, '');
 
 -- Pages
 
 INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_tricon_error', 'tricon-error', '_bx_tricon_error', '_bx_tricon_error', 'bx_tricon', 5, 2147483647, 0, '', '', '', '', 0, 1, 0, 'BxTriConPage', 'modules/boonex/tricon/classes/BxTriConPage.php');
+('bx_unacon_error', 'unacon-error', '_bx_unacon_error', '_bx_unacon_error', 'bx_unacon', 5, 2147483647, 0, '', '', '', '', 0, 1, 0, 'BxUnaConPage', 'modules/boonex/una_connect/classes/BxUnaConPage.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_tricon_error', 1, 'bx_tricon', '_bx_tricon_error', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_tricon\";s:6:\"method\";s:10:\"last_error\";}', 0, 0, 1, 1);
+('bx_unacon_error', 1, 'bx_unacon', '_bx_unacon_error', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_unacon\";s:6:\"method\";s:10:\"last_error\";}', 0, 0, 1, 1);

+ 3 - 3
modules/boonex/trident_connect/install/sql/install.sql → modules/boonex/una_connect/install/sql/install.sql

@@ -1,5 +1,5 @@
 
-CREATE TABLE `bx_tricon_accounts` (
+CREATE TABLE `bx_unacon_accounts` (
   `local_profile` int(10) unsigned NOT NULL,
   `remote_profile` int(10) unsigned NOT NULL,
   PRIMARY KEY (`local_profile`),
@@ -9,13 +9,13 @@ CREATE TABLE `bx_tricon_accounts` (
 -- Studio page and widget
 
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
-(3, 'bx_tricon', '_bx_tricon', '_bx_tricon', 'bx_tricon@modules/boonex/trident_connect/|std-icon.svg');
+(3, 'bx_unacon', '_bx_unacon', '_bx_unacon', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg');
 SET @iPageId = LAST_INSERT_ID();
 
 SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
 SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
 INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, 'bx_tricon', '{url_studio}module.php?name=bx_tricon', '', 'bx_tricon@modules/boonex/trident_connect/|std-icon.svg', '_bx_tricon', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+(@iPageId, 'bx_unacon', '{url_studio}module.php?name=bx_unacon', '', 'bx_unacon@modules/boonex/una_connect/|std-icon.svg', '_bx_unacon', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
 INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
 (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
 

+ 2 - 2
modules/boonex/trident_connect/install/sql/uninstall.sql → modules/boonex/una_connect/install/sql/uninstall.sql

@@ -1,9 +1,9 @@
 
-DROP TABLE IF EXISTS `bx_tricon_accounts`;
+DROP TABLE IF EXISTS `bx_unacon_accounts`;
 
 -- Studio page and widget
 
 DELETE FROM `tp`, `tw`, `tpw`
 USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
-WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_tricon';
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_unacon';
 

+ 4 - 4
modules/boonex/trident_connect/request.php → modules/boonex/una_connect/request.php

@@ -1,10 +1,10 @@
 <?php defined('BX_DOL') or die('hack attempt');
 /**
- * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    TridentConnect Trident Connect
- * @ingroup     TridentModules
+ * @defgroup    UnaConnect UNA Connect
+ * @ingroup     UnaModules
  *
  * @{
  */

+ 0 - 0
modules/boonex/trident_connect/template/images/icons/std-icon.svg → modules/boonex/una_connect/template/images/icons/std-icon.svg