Aleksandr Trofimov 2 місяців тому
батько
коміт
bc0a1ab776

+ 21 - 0
modules/boonex/cidaas_connect/classes/BxCidaasConAlerts.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    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCidaasConAlerts extends BxBaseModConnectAlerts
+{
+    function __construct()
+    {
+        parent::__construct();
+        $this -> oModule = BxDolModule::getInstance('bx_cidaascon');
+    }
+}
+
+/** @} */

+ 46 - 0
modules/boonex/cidaas_connect/classes/BxCidaasConConfig.php

@@ -0,0 +1,46 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCidaasConConfig extends BxBaseModConnectConfig
+{
+    public $sTenantID = 'common';
+    public $sClientID;
+    public $sSecret;
+
+    public $sAuthMethod = 'secret'; // certificate isn't supported yet
+    public $sScope = 'User.Read';// 'openid%20offline_access%20profile%20user.read';
+    public $sLogoutUrl = 'https://login.microsoftonline.com/common/wsfederation?wa=wsignout1.0';
+
+    public $sPageStart;
+    public $sPageHandle;
+
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $this -> sTenantID = getParam('bx_cidaascon_tenant_id');
+        $this -> sClientID = getParam('bx_cidaascon_client_id');
+        $this -> sSecret = getParam('bx_cidaascon_secret');
+
+        $this -> sEmailTemplatePasswordGenerated = 'bx_cidaascon_password_generated';
+        $this -> sDefaultTitleLangKey = '_bx_cidaascon';
+
+        $this -> sRedirectPage = getParam('bx_cidaascon_redirect_page');
+        $this -> sProfilesModule = getParam('bx_cidaascon_module');
+        $this -> isAlwaysConfirmEmail = (bool)getParam('bx_cidaascon_confirm_email'); 
+        $this -> isAlwaysAutoApprove = (bool)getParam('bx_cidaascon_approve');
+
+        $this -> sPageStart = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'start';
+        $this -> sPageHandle = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'handle';
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/cidaas_connect/classes/BxCidaasConDb.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    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCidaasConDb extends BxBaseModConnectDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+}
+
+/** @} */

+ 171 - 0
modules/boonex/cidaas_connect/classes/BxCidaasConModule.php

@@ -0,0 +1,171 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/cidaas_connect/vendor/autoload.php');
+
+/**
+ * https://github.com/cidaas/cidaas-sdk-php
+ */
+class BxCidaasConModule extends BxBaseModConnectModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    /**
+     * Redirect to remote site login form
+     *
+     * @return n/a - redirect or HTML page in case of error
+     */
+    function actionStart()
+    {
+        if (isset($_GET["error"])) {
+            $this->_oTemplate->getPage(_t($this->_oConfig->sDefaultTitleLangKey), DesignBoxContent(_t($this->_oConfig->sDefaultTitleLangKey), MsgBox(bx_get('error'))));
+            exit;
+        }
+
+        if (isLogged()) {
+            $this->_redirect ($this -> _oConfig -> sDefaultRedirectUrl);
+        }
+
+        if (!$this->_oConfig->sClientID || !$this->_oConfig->sSecret) {
+            require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
+            bx_import('BxDolLanguages');
+            $sCode =  MsgBox( _t('_bx_cidaascon_profile_error_api_keys') );
+            $this->_oTemplate->getPage(_t('_bx_cidaascon'), $sCode);
+        } 
+        else {
+
+            // First stage of the authentication process; This is just a simple redirect (first load of this page)
+            $sUrl = bx_append_url_params("https://login.example.com/" . $this->_oConfig->sTenantID . "/oauth2/v2.0/authorize", [
+                'state' => $this->_genToken(), // BxDolSession::getInstance()->getId(), // This at least semi-random string is likely good enough as state identifier
+                'scope' => $this->_oConfig->sScope, // User.Read scope seems to be enough, but you can try "&scope=profile+openid+email+offline_access+User.Read" if you like
+                'response_type' => 'code',
+                'approval_prompt' => 'auto',
+                'client_id' => $this->_oConfig->sClientID,
+                'redirect_uri' => $this->_oConfig->sPageHandle,
+            ]);
+            $this->_redirect($sUrl); 
+        }
+    }
+
+    function actionHandle()
+    {
+        require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
+
+        // check CSRF token
+        if ($this->_getToken() != bx_get('state')) {
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_state_invalid')));
+            return;
+        }
+
+        // check code
+        $sCode = bx_get('code');
+        if (!$sCode || bx_get('error')) {
+            $sErrorDescription = bx_get('error_description') ? bx_get('error_description') : _t('_error occured');
+            $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
+            return;
+        }
+
+        // Verifying the received tokens
+        $s = bx_file_get_contents("https://login.example.com/" . $this->_oConfig->sTenantID . "/oauth2/v2.0/token", [
+            'grant_type'    => 'authorization_code',
+            'client_id'     => $this->_oConfig->sClientID,
+            'redirect_uri'  => $this->_oConfig->sPageHandle,
+            'code'          => $sCode,
+            'client_secret' => $this->_oConfig->sSecret,
+        ], 'post', array ('Content-Type: application/x-www-form-urlencoded'));
+        $aAuthData = $this->_decodeResponseAndHandleError($s);
+
+        // get the data, especially access_token
+        $sAccessToken = $aAuthData['access_token'];
+        $sExpiresIn = $aAuthData['expires_in'];
+        $sExpiresAt = new \DateTime('+' . $sExpiresIn . ' seconds');
+
+        // request info about profile
+        $s = bx_file_get_contents("https://graph.example.com/v1.0/me", array(), 'get', array(
+            'Accept: application/json',
+            'Authorization: Bearer ' . $sAccessToken,
+        ));
+        $aUserData = $this->_decodeResponseAndHandleError($s);
+
+        // request profile photo
+        $s = bx_file_get_contents("https://graph.example.com/v1.0/me/photo/", array(), 'get', array(
+            'Accept: application/json',
+            'Authorization: Bearer ' . $sAccessToken,
+        ));
+        $aUserPhoto = $this->_decodeResponseAndHandleError($s, false);
+
+        $aRemoteProfileInfo = $aUserData;
+        $aRemoteProfileInfo['picture'] = $aUserPhoto;
+
+        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(), '', true, true); // remember user
+            }             
+            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;
+
+        $a = explode('@', $aProfileInfo['userPrincipalName']);
+        $sName = isset($a[0]) ? $a[0] : $aProfileInfo['userPrincipalName'];
+    
+        $aProfileFields['name'] = !empty($aProfileInfo['displayName']) ? $aProfileInfo['displayName'] : $sName;
+        $aProfileFields['fullname'] = !empty($aProfileInfo['givenName']) ? $aProfileInfo['givenName'] : $aProfileFields['name'];
+        $aProfileFields['last_name'] = !empty($aProfileInfo['surname']) ? ' ' . $aProfileInfo['surname'] : '';
+        $aProfileFields['email'] = isset($aProfileInfo['mail']) ? $aProfileInfo['mail'] : $aProfileInfo['userPrincipalName'];
+        $aProfileFields['picture'] = ''; // isset($aProfileInfo['picture']) ? $aProfileInfo['picture'] : '';
+        $aProfileFields['allow_view_to'] = getParam('bx_cidaascon_privacy');
+
+        return $aProfileFields;
+    }
+
+    protected function _decodeResponseAndHandleError($s, $bDisplayErrorPage = true)
+    {
+        if (!$s || NULL === ($aData = json_decode($s, true)) || !$aData || isset($aData['error'])) {
+            if (is_array($aData['error']) && !empty($aData['error']['message']))
+                $sErrorDescription = $aData['error']['message'];
+            else
+                $sErrorDescription = isset($aData['error_description']) ? $aData['error_description'] : _t('_error occured');
+            if ($bDisplayErrorPage) {
+                $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
+                exit;
+            }
+            else {  
+                return false;
+            }
+        }
+        return $aData;
+    }
+}
+
+/** @} */

+ 31 - 0
modules/boonex/cidaas_connect/classes/BxCidaasConStudioPage.php

@@ -0,0 +1,31 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCidaasConStudioPage extends BxTemplStudioModule
+{
+    function __construct($sModule, $mixedPageName, $sPage = "")
+    {
+        parent::__construct($sModule, $mixedPageName, $sPage);
+
+        $this->aMenuItems = array(
+            'settings' => array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
+            'help' => array('name' => 'help', 'icon' => 'question', 'title' => '_sys_connect_information'),
+        );
+    }
+    
+    function getHelp ()
+    {
+        $oModule = BxDolModule::getInstance('bx_cidaascon'); 
+        return _t('_bx_cidaascon_information_block', BX_DOL_URL_ROOT . $oModule -> _oConfig -> getBaseUri() . 'handle');
+    }
+}
+
+/** @} */

+ 20 - 0
modules/boonex/cidaas_connect/classes/BxCidaasConTemplate.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    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCidaasConTemplate extends BxBaseModConnectTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+}
+
+/** @} */

+ 13 - 0
modules/boonex/cidaas_connect/composer.json

@@ -0,0 +1,13 @@
+{
+    "name": "unacms/cidaas-connect",
+    "repositories": [
+        {
+            "type": "vcs",
+            "url": "https://github.com/Cidaas/cidaas-sdk-php.git"
+        }
+    ],
+    "require": {
+        "php": ">=8.2",
+        "cidaas/oauth2-cidaas": "dev-master"
+    }
+}

+ 785 - 0
modules/boonex/cidaas_connect/composer.lock

@@ -0,0 +1,785 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "dd258f24d7ab52d620921241237b9cf8",
+    "packages": [
+        {
+            "name": "cidaas/oauth2-cidaas",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cidaas/cidaas-sdk-php.git",
+                "reference": "738105b141115cb51d7262a02868062215c71e3d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cidaas/cidaas-sdk-php/zipball/738105b141115cb51d7262a02868062215c71e3d",
+                "reference": "738105b141115cb51d7262a02868062215c71e3d",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "guzzlehttp/guzzle": "^7.2.0",
+                "php": "^8.2"
+            },
+            "require-dev": {
+                "phpstan/phpstan": "^1.10",
+                "phpunit/php-code-coverage": "^10.1",
+                "phpunit/phpunit": "^10.5",
+                "roave/security-advisories": "dev-master",
+                "vlucas/phpdotenv": "^5.3.0"
+            },
+            "default-branch": true,
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Cidaas\\OAuth2\\Client\\Provider\\": "src/"
+                }
+            },
+            "autoload-dev": {
+                "psr-4": {
+                    "Cidaas\\OAuth2\\Client\\Test\\Provider\\": "tests/"
+                }
+            },
+            "scripts": {
+                "test": [
+                    "phpunit"
+                ],
+                "phpstan": [
+                    "phpstan analyse -c phpstan.neon"
+                ]
+            },
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "cidaas by Widas ID GmbH",
+                    "email": "developer@widas.de",
+                    "homepage": "https://www.cidaas.com"
+                }
+            ],
+            "description": "Cidaas OAuth 2.0 and OpenID connect Client SDK",
+            "keywords": [
+                "authorisation",
+                "authorization",
+                "cidaas",
+                "client",
+                "oauth",
+                "oauth2",
+                "openid connect"
+            ],
+            "support": {
+                "source": "https://github.com/cidaas/cidaas-sdk-php/tree/v2.0.1",
+                "issues": "https://github.com/cidaas/cidaas-sdk-php/issues"
+            },
+            "time": "2026-06-19T11:04:36+00:00"
+        },
+        {
+            "name": "guzzlehttp/guzzle",
+            "version": "7.15.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/guzzle.git",
+                "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc",
+                "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "guzzlehttp/promises": "^2.5.2",
+                "guzzlehttp/psr7": "^2.13",
+                "php": "^7.2.5 || ^8.0",
+                "psr/http-client": "^1.0",
+                "symfony/deprecation-contracts": "^2.5 || ^3.0",
+                "symfony/polyfill-php80": "^1.25"
+            },
+            "provide": {
+                "psr/http-client-implementation": "1.0"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.8.2",
+                "ext-curl": "*",
+                "guzzle/client-integration-tests": "3.0.3",
+                "guzzlehttp/test-server": "^0.7",
+                "php-http/message-factory": "^1.1",
+                "phpunit/phpunit": "^8.5.52 || ^9.6.34",
+                "psr/log": "^1.1 || ^2.0 || ^3.0"
+            },
+            "suggest": {
+                "ext-curl": "Required for CURL handler support",
+                "ext-intl": "Required for Internationalized Domain Name (IDN) support",
+                "psr/log": "Required for using the Log middleware"
+            },
+            "type": "library",
+            "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": false
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/functions_include.php"
+                ],
+                "psr-4": {
+                    "GuzzleHttp\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Jeremy Lindblom",
+                    "email": "jeremeamia@gmail.com",
+                    "homepage": "https://github.com/jeremeamia"
+                },
+                {
+                    "name": "George Mponos",
+                    "email": "gmponos@gmail.com",
+                    "homepage": "https://github.com/gmponos"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://github.com/sagikazarmark"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "email": "webmaster@tubo-world.de",
+                    "homepage": "https://github.com/Tobion"
+                }
+            ],
+            "description": "Guzzle is a PHP HTTP client library",
+            "keywords": [
+                "client",
+                "curl",
+                "framework",
+                "http",
+                "http client",
+                "psr-18",
+                "psr-7",
+                "rest",
+                "web service"
+            ],
+            "support": {
+                "issues": "https://github.com/guzzle/guzzle/issues",
+                "source": "https://github.com/guzzle/guzzle/tree/7.15.3"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2026-08-05T19:48:21+00:00"
+        },
+        {
+            "name": "guzzlehttp/promises",
+            "version": "2.5.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/promises.git",
+                "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/promises/zipball/2823687acff28b2dbe67b2508a6b300e2c3fa4ce",
+                "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2.5 || ^8.0",
+                "symfony/deprecation-contracts": "^2.5 || ^3.0"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.8.2",
+                "phpunit/phpunit": "^8.5.52 || ^9.6.34"
+            },
+            "type": "library",
+            "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": false
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Promise\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "email": "webmaster@tubo-world.de",
+                    "homepage": "https://github.com/Tobion"
+                }
+            ],
+            "description": "Guzzle promises library",
+            "keywords": [
+                "promise"
+            ],
+            "support": {
+                "issues": "https://github.com/guzzle/promises/issues",
+                "source": "https://github.com/guzzle/promises/tree/2.5.2"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2026-08-05T19:30:54+00:00"
+        },
+        {
+            "name": "guzzlehttp/psr7",
+            "version": "2.13.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/psr7.git",
+                "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/dad89620b7a6edb60c15858442eb2e408b45d8f4",
+                "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2.5 || ^8.0",
+                "psr/http-factory": "^1.0",
+                "psr/http-message": "^1.1 || ^2.0",
+                "ralouphie/getallheaders": "^3.0",
+                "symfony/deprecation-contracts": "^2.5 || ^3.0",
+                "symfony/polyfill-php80": "^1.25"
+            },
+            "provide": {
+                "psr/http-factory-implementation": "1.0",
+                "psr/http-message-implementation": "1.0"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.8.2",
+                "http-interop/http-factory-tests": "1.1.0",
+                "jshttp/mime-db": "1.54.0.1",
+                "phpunit/phpunit": "^8.5.52 || ^9.6.34"
+            },
+            "suggest": {
+                "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
+            },
+            "type": "library",
+            "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": false
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Psr7\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "George Mponos",
+                    "email": "gmponos@gmail.com",
+                    "homepage": "https://github.com/gmponos"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://github.com/sagikazarmark"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "email": "webmaster@tubo-world.de",
+                    "homepage": "https://github.com/Tobion"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://sagikazarmark.hu"
+                }
+            ],
+            "description": "PSR-7 message implementation that also provides common utility methods",
+            "keywords": [
+                "http",
+                "message",
+                "psr-7",
+                "request",
+                "response",
+                "stream",
+                "uri",
+                "url"
+            ],
+            "support": {
+                "issues": "https://github.com/guzzle/psr7/issues",
+                "source": "https://github.com/guzzle/psr7/tree/2.13.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2026-07-16T22:23:49+00:00"
+        },
+        {
+            "name": "psr/http-client",
+            "version": "1.0.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-client.git",
+                "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
+                "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.0 || ^8.0",
+                "psr/http-message": "^1.0 || ^2.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Client\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for HTTP clients",
+            "homepage": "https://github.com/php-fig/http-client",
+            "keywords": [
+                "http",
+                "http-client",
+                "psr",
+                "psr-18"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/http-client"
+            },
+            "time": "2023-09-23T14:17:50+00:00"
+        },
+        {
+            "name": "psr/http-factory",
+            "version": "1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-factory.git",
+                "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+                "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1",
+                "psr/http-message": "^1.0 || ^2.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Message\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
+            "keywords": [
+                "factory",
+                "http",
+                "message",
+                "psr",
+                "psr-17",
+                "psr-7",
+                "request",
+                "response"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/http-factory"
+            },
+            "time": "2024-04-15T12:06:14+00:00"
+        },
+        {
+            "name": "psr/http-message",
+            "version": "2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-message.git",
+                "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+                "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2 || ^8.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Message\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for HTTP messages",
+            "homepage": "https://github.com/php-fig/http-message",
+            "keywords": [
+                "http",
+                "http-message",
+                "psr",
+                "psr-7",
+                "request",
+                "response"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/http-message/tree/2.0"
+            },
+            "time": "2023-04-04T09:54:51+00:00"
+        },
+        {
+            "name": "ralouphie/getallheaders",
+            "version": "3.0.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/ralouphie/getallheaders.git",
+                "reference": "120b605dfeb996808c31b6477290a714d356e822"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
+                "reference": "120b605dfeb996808c31b6477290a714d356e822",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6"
+            },
+            "require-dev": {
+                "php-coveralls/php-coveralls": "^2.1",
+                "phpunit/phpunit": "^5 || ^6.5"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "src/getallheaders.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Ralph Khattar",
+                    "email": "ralph.khattar@gmail.com"
+                }
+            ],
+            "description": "A polyfill for getallheaders.",
+            "support": {
+                "issues": "https://github.com/ralouphie/getallheaders/issues",
+                "source": "https://github.com/ralouphie/getallheaders/tree/develop"
+            },
+            "time": "2019-03-08T08:55:37+00:00"
+        },
+        {
+            "name": "symfony/deprecation-contracts",
+            "version": "v3.7.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/deprecation-contracts.git",
+                "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d",
+                "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=8.1"
+            },
+            "type": "library",
+            "extra": {
+                "thanks": {
+                    "url": "https://github.com/symfony/contracts",
+                    "name": "symfony/contracts"
+                },
+                "branch-alias": {
+                    "dev-main": "3.7-dev"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "function.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "A generic function and convention to trigger deprecation notices",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/nicolas-grekas",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2026-06-05T06:23:12+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php80",
+            "version": "v1.37.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php80.git",
+                "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
+                "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2"
+            },
+            "type": "library",
+            "extra": {
+                "thanks": {
+                    "url": "https://github.com/symfony/polyfill",
+                    "name": "symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php80\\": ""
+                },
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Ion Bazan",
+                    "email": "ion.bazan@gmail.com"
+                },
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/nicolas-grekas",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2026-04-10T16:19:22+00:00"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": {
+        "cidaas/oauth2-cidaas": 20
+    },
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": {
+        "php": ">=8.2"
+    },
+    "platform-dev": {},
+    "plugin-api-version": "2.6.0"
+}

+ 68 - 0
modules/boonex/cidaas_connect/install/config.php

@@ -0,0 +1,68 @@
+<?php 
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_cidaascon',
+    'title' => 'Cidaas Connect',
+    'note' => 'Join the site using Cidaas account.',
+    'version' => '15.0.0.DEV',
+    'vendor' => 'UNA INC',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '15.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/cidaas_connect/',
+    'home_uri' => 'cidaascon',
+
+    'db_prefix' => 'bx_cidaascon_',
+    'class_prefix' => 'BxCidaasCon',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Cidaas 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(),
+);
+
+/** @} */

+ 20 - 0
modules/boonex/cidaas_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    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxCidaasConInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 29 - 0
modules/boonex/cidaas_connect/install/langs/en.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_sys_module_cidaascon"><![CDATA[Cidaas Connect]]></string>
+	<string name="_bx_cidaascon"><![CDATA[Cidaas Connect]]></string>
+	<string name="_bx_cidaascon_settings"><![CDATA[Cidaas Connect]]></string>
+	<string name="_bx_cidaascon_information_block"><![CDATA[
+        <p>This module can be used to login to this site using Cidaas.</p>
+        <p>
+            <ul>
+                <li>Redirect URL: <strong>{0}</strong></li>
+            </ul>
+            For more info please refer to <a target="_blank" href="https://docs.cidaas.com/">official documentation</a>.
+        </p>]]></string>
+	<string name="_bx_cidaascon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define Client ID & Secret)]]></string>
+	<string name="_bx_cidaascon_auth_title"><![CDATA[Login with Cidaas]]></string>
+
+    <string name="_bx_cidaascon_adm_stg_cpt_type"><![CDATA[Cidaas Connect]]></string>
+    <string name="_bx_cidaascon_option_base_url"><![CDATA[Base URL]]></string>
+    <string name="_bx_cidaascon_option_client_id"><![CDATA[Client ID]]></string>
+    <string name="_bx_cidaascon_option_secret"><![CDATA[Client Secret]]></string>
+    <string name="_bx_cidaascon_option_debug"><![CDATA[Debug mode]]></string>
+
+	<string name="_bx_cidaascon_et_password_generated"><![CDATA[Cidaas connect temporary password]]></string>
+	<string name="_bx_cidaascon_et_password_generated_subject"><![CDATA[Temporary password]]></string>
+	<string name="_bx_cidaascon_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>

+ 20 - 0
modules/boonex/cidaas_connect/install/sql/disable.sql

@@ -0,0 +1,20 @@
+
+-- Email template
+
+DELETE FROM `sys_email_templates` WHERE `Name` = 'bx_cidaascon_password_generated';
+
+-- Auth objects
+
+DELETE FROM `sys_objects_auths` WHERE `Name` = 'bx_cidaascon';
+
+-- Alerts
+
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name`  =  'bx_cidaascon');
+
+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_cidaascon';
+

+ 44 - 0
modules/boonex/cidaas_connect/install/sql/enable.sql

@@ -0,0 +1,44 @@
+
+-- Email template
+
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('bx_cidaascon', '_bx_cidaascon_et_password_generated', 'bx_cidaascon_password_generated', '_bx_cidaascon_et_password_generated_subject', '_bx_cidaascon_et_password_generated_body');
+
+-- Auth objects
+
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_cidaascon', '_bx_cidaascon_auth_title', 'modules/?r=cidaascon/start', 'fab microsoft', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#0078d4 !important";}}');
+
+-- Alerts
+
+INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_cidaascon', `class` = 'BxCidaasConAlerts', `file` = 'modules/boonex/cidaas_connect/classes/BxCidaasConAlerts.php';
+
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name` = 'bx_cidaascon');
+
+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_cidaascon', '_bx_cidaascon_adm_stg_cpt_type', 'bx_cidaascon@modules/boonex/cidaas_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_cidaascon_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_cidaascon_base_url', '', @iCategId, '_bx_cidaascon_option_base_url', 'digit', '', '', 20, ''),
+('bx_cidaascon_client_id', '', @iCategId, '_bx_cidaascon_option_client_id', 'digit', '', '', 22, ''),
+('bx_cidaascon_secret', '', @iCategId, '_bx_cidaascon_option_secret', 'secret', '', '', 24, ''),
+('bx_cidaascon_redirect_page', 'index', @iCategId, '_sys_connect_option_redirect', 'select', '', '', 40, 'join,settings,dashboard,index'),
+('bx_cidaascon_module', 'bx_persons', @iCategId, '_sys_connect_option_module', 'select', '', '', 50, 'a:2:{s:6:"module";s:12:"bx_cidaascon";s:6:"method";s:20:"get_profiles_modules";}'),
+('bx_cidaascon_privacy', '3', @iCategId, '_sys_connect_option_privacy', 'select', '', '', 54, 'a:2:{s:6:"module";s:12:"bx_cidaascon";s:6:"method";s:18:"get_privacy_groups";}'),
+('bx_cidaascon_confirm_email', 'on', @iCategId, '_sys_connect_option_confirm_email', 'checkbox', '', '', 70, ''),
+('bx_cidaascon_approve', '', @iCategId, '_sys_connect_option_approve', 'checkbox', '', '', 80, ''),
+('bx_cidaascon_debug', '', @iCategId, '_bx_cidaascon_option_debug', 'checkbox', '', '', 90, '');
+

+ 21 - 0
modules/boonex/cidaas_connect/install/sql/install.sql

@@ -0,0 +1,21 @@
+
+CREATE TABLE `bx_cidaascon_accounts` (
+  `local_profile` int(10) unsigned NOT NULL,
+  `remote_profile` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+  PRIMARY KEY (`local_profile`),
+  KEY `remote_profile` (`remote_profile`)
+);
+
+-- Studio page and widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_cidaascon', '_bx_cidaascon', '_bx_cidaascon', 'bx_cidaascon@modules/boonex/cidaas_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`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_cidaascon', 'integrations', '{url_studio}module.php?name=bx_cidaascon', '', 'bx_cidaascon@modules/boonex/cidaas_connect/|std-icon.svg', '_bx_cidaascon', '', '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));
+

+ 8 - 0
modules/boonex/cidaas_connect/install/sql/uninstall.sql

@@ -0,0 +1,8 @@
+
+DROP TABLE IF EXISTS `bx_cidaascon_accounts`;
+
+
+-- Studio page and widget
+DELETE FROM `tp`, `tw`, `twb`, `tpw` 
+USING `sys_std_pages` AS `tp` LEFT JOIN `sys_std_widgets` AS `tw` ON `tp`.`id` = `tw`.`page_id` LEFT JOIN `sys_std_widgets_bookmarks` AS `twb` ON `tw`.`id` = `twb`.`widget_id` LEFT JOIN `sys_std_pages_widgets` AS `tpw` ON `tw`.`id` = `tpw`.`widget_id`
+WHERE  `tp`.`name` = 'bx_cidaascon';

+ 18 - 0
modules/boonex/cidaas_connect/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    CidaasConnect Cidaas Connect
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php');
+
+check_logged();
+
+BxDolRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 75 - 0
modules/boonex/cidaas_connect/template/images/icons/std-icon.svg

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 24.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 288 286.9" style="enable-background:new 0 0 288 286.9;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#F04923;}
+	.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#F9AE1C;}
+	.st2{fill-rule:evenodd;clip-rule:evenodd;fill:#F89521;}
+	.st3{fill-rule:evenodd;clip-rule:evenodd;fill:#F47422;}
+	.st4{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
+	.st5{fill:#565656;}
+</style>
+<g>
+	<g>
+		<g id="Rounded_Rectangle_1">
+			<g>
+				<path class="st0" d="M179.3,38.3c-20-20-52.4-20-72.4,0L7.7,137.5l99.1,99.2c20,20,52.4,20,72.4,0l99.2-99.1L179.3,38.3z"/>
+			</g>
+		</g>
+		<g id="Rounded_Rectangle_1_copy">
+			<g>
+				<path class="st1" d="M223.1,82.2L88.5,218.4l18.3,18.3c20,20,52.4,20,72.4,0l99.2-99.1L223.1,82.2z"/>
+			</g>
+		</g>
+		<g id="Rounded_Rectangle_1_copy_2">
+			<g>
+				<path class="st2" d="M224.5,83.6l-45.2-45.2c-20-20-52.4-20-72.4,0L7.7,137.5l96.7,96.8C211,193,223.2,107.6,224.5,83.6z"/>
+			</g>
+		</g>
+		<g id="Rounded_Rectangle_1_copy_4">
+			<g>
+				<path class="st3" d="M190.3,49.4l-11-11c-20-20-52.4-20-72.4,0L7.7,137.5l65.9,65.9C88.5,198.3,180.1,162.8,190.3,49.4z"/>
+			</g>
+		</g>
+		<g id="Rounded_Rectangle_1_copy_3">
+			<g>
+				<path class="st0" d="M151.1,24c-15.6-2.5-32.2,2.3-44.2,14.4L7.7,137.5l29.9,30C50.1,163.4,138.8,131.3,151.1,24z"/>
+			</g>
+		</g>
+		<g id="Ellipse_1">
+			<g>
+				<path class="st4" d="M148.5,189.4c-25.1-4-44.3-25.5-44.3-51.5c0-25.6,18.7-46.9,43.3-51.3c2.6-4,5.5-7.8,8.7-11.2
+					c-34.7,1.9-62.3,29-62.3,62.1c0,33.3,27.8,60.5,62.8,62.2C153.7,196.5,151,193,148.5,189.4z"/>
+			</g>
+		</g>
+		<g id="Rectangle_1">
+			<g>
+				<path class="st4" d="M133.3,137.9v-0.8c0-12.4,10-22.4,22.4-22.4h16.5V105h-17.3c-17.2,0-31.1,13.9-31.1,31.1v3.5
+					c0,17.2,13.9,31.1,31.1,31.1h20v-10.3h-19.2C143.4,160.3,133.3,150.3,133.3,137.9z"/>
+			</g>
+		</g>
+		<g id="Ellipse_2">
+			<g>
+				<path class="st4" d="M172.5,75.2c-10.9,0-19.7,8.8-19.7,19.7c0,1.4,0.1,2.7,0.4,4.1h10.6c-0.5-1.1-0.7-2.4-0.7-3.6
+					c0-5.3,4.3-9.6,9.6-9.6s9.6,4.3,9.6,9.6c0,4.9-3.7,8.9-8.4,9.5v0.1h-18.3c3.4,5.8,9.7,9.7,17,9.7c10.9,0,19.7-8.8,19.7-19.7
+					C192.2,84.1,183.4,75.2,172.5,75.2z"/>
+			</g>
+		</g>
+		<g id="Ellipse_2_copy">
+			<g>
+				<path class="st4" d="M175.6,160.3h-6.3c-6.2,1-11.4,4.9-14.2,10.3h16.6v0c0.3,0,0.6,0,0.9,0c5.3,0,9.6,4.3,9.6,9.6
+					s-4.3,9.6-9.6,9.6s-9.6-4.3-9.6-9.6c0-1.2,0.2-2.3,0.6-3.4H153c-0.1,1-0.2,2-0.2,3c0,10.9,8.8,19.7,19.7,19.7
+					c10.9,0,19.7-8.8,19.7-19.7C192.2,169.9,185,161.8,175.6,160.3z"/>
+			</g>
+		</g>
+	</g>
+	<g>
+		<path class="st5" d="M278.7,242.3c0,5.6-4.4,10-10.1,10c-5.7,0-10.2-4.4-10.2-10c0-5.5,4.5-9.9,10.2-9.9
+			C274.3,232.4,278.7,236.8,278.7,242.3z M260.9,242.3c0,4.4,3.3,7.9,7.7,7.9c4.3,0,7.5-3.5,7.5-7.8c0-4.4-3.2-7.9-7.6-7.9
+			C264.2,234.4,260.9,238,260.9,242.3z M267,247.5h-2.3v-9.9c0.9-0.2,2.2-0.3,3.8-0.3c1.9,0,2.7,0.3,3.4,0.7c0.5,0.4,1,1.2,1,2.2
+			c0,1.1-0.8,1.9-2,2.3v0.1c1,0.4,1.5,1.1,1.8,2.4c0.3,1.5,0.5,2.1,0.7,2.5h-2.5c-0.3-0.4-0.5-1.3-0.8-2.4c-0.2-1.1-0.8-1.6-2-1.6
+			H267V247.5z M267.1,241.9h1.1c1.3,0,2.3-0.4,2.3-1.4c0-0.9-0.7-1.5-2.1-1.5c-0.6,0-1,0.1-1.3,0.1V241.9z"/>
+	</g>
+</g>
+</svg>