Skip to content

Commit

Permalink
Upgrade script from 14.0.0-B2 to 14.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTr committed Sep 9, 2024
1 parent 5358898 commit 3de832a
Show file tree
Hide file tree
Showing 490 changed files with 127,925 additions and 21 deletions.
73 changes: 73 additions & 0 deletions upgrade/files/14.0.0.B2-14.0.0.RC1/files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<a href="https://unacms.com"><img width="300" alt="UNA Platform" src="https://github.com/user-attachments/assets/ef5c2250-e172-4b12-8948-f1084643bc55"></a>


## Unified Networking Applications

[![Official Website](https://img.shields.io/badge/website-una.io-blue.svg?style=for-the-badge)](https://unacms.com)
[![GitHub license](https://img.shields.io/github/license/unaio/una?style=for-the-badge)](https://github.com/unacms/una/blob/master/license.txt)
[![Releases](https://img.shields.io/github/downloads/unaio/una/total.svg?style=for-the-badge)](https://github.com/unacms/una)
[![GitHub forks](https://img.shields.io/github/forks/unaio/una?style=for-the-badge)](https://github.com/unacms/una/network)

UNA is a **Community** Management System. The core platform is a full-stack framework for independent community websites and apps. With UNA content management, collaboration, e-commerce, learning and communication modules - aka **UNA Apps** - you can create communities of all types—from small interest groups to global social media networks.

![screenshot](https://user-images.githubusercontent.com/22210428/186073113-8f82f8f2-fd5a-4dbb-8328-e0ca847809b9.png)






## Key Features

* **Unlimited Scalability**: Hundreds, thousands or millions - get as many users as your hosting can handle. UNA won't limit you.
* **Absolute Control**: You own the data, you set the rules, you lead the community. We give you the tools and support.
* **Permissive License**: MIT - the license allowing unrestricted commercial and private use, distribution and modification..
* **Continious Improvement**: Regular security, performance and feature updates for the core platform, apps and integrations.
* **Collective Innovation**: Improvements and revisions initiated and co-funded by the platform users community.
* **Integrations-Friendly**: Intergate 3rd-party services as UNA apps or use UNA REST API to talk to your external apps.
* **Secure-By-Design**: Full-site SSL encryption, SPD development, regular service updates and vulnurability audits.
* **Compliance Readiness**: We offer HIPAA, GDPR, CCPA (and any other regulations) compliance preparation service.





## Documentaion

To install and run UNA platform, you'll need to a web-hosting server or you can use [UNA Cloud hosting](https://una.io/start) for instant launch.


- [UNACMS.COM - Official Website](https://unacms.com)
- [Documentation](https://unacms.com/wiki/Introduction)
- [Discussions](https://unacms.com/page/discussions-home)
- [Contact Team](https://unacms.com/page/contact)
- [Installation](https://unacms.com/wiki/Installation)




## Download

You can [download](https://github.com/unaio/una/archive/refs/heads/master.zip) the latest installable version of UNA Core and install to your server. You will need to [create an UNACMS.COM account](https://UNACMS.com) and link it with UNA Studio to install and update UNA Apps.




## Support & Development

UNA is managed by [Yasko.Studio](https://yasko.studio) team and developed with the help of [UNA Community](https://una.io).

* Free community support - [Discussions](https://uunacms.com/page/discussions-home)
* Direct support and professional services - [UNA Pro](https://unacms.com/start)


## License

MIT

---

> Twitter [@unaplatform](https://twitter.com/unaplatform)
---
This project is tested with BrowserStack.
53 changes: 53 additions & 0 deletions upgrade/files/14.0.0.B2-14.0.0.RC1/files/agents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup UnaCore UNA Core
* @{
*/

require_once('./inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . "utils.inc.php");

bx_import('BxDolLanguages');

$sTool = bx_process_input(bx_get('t'));

/**
* Work with Providers
*/
if(($iProviderId = bx_get('p')) !== false) {
$iProviderId = bx_process_input($iProviderId, BX_DATA_INT);
if(!$iProviderId)
exit;

$oProvider = BxDolAIProvider::getObjectInstance($iProviderId);
if(!$oProvider)
exit;

if(($sAction = bx_get('a')) !== false) {
$sAction = 'processAction' . bx_gen_method_name(bx_process_input($sAction));
if(method_exists($oProvider, $sAction))
$oProvider->$sAction();
}
else {
$mixedResponce = $oProvider->call('products/7433953116300.json', ['fields' => 'id,title,handle,body_html,tags,variants'], 'get');
print_r($mixedResponce);
}
}

/**
* Work with Assistants
*/
if($sTool == 'asst' && ($iId = bx_get('id')) !== false) {
$oAssistant = BxDolAIAssistant::getObjectInstance((int)$iId);

if(($sAction = bx_get('a')) !== false) {
$sAction = 'processAction' . bx_gen_method_name(bx_process_input($sAction));
if(method_exists($oAssistant, $sAction))
$oAssistant->$sAction();
}
}

/** @} */
107 changes: 107 additions & 0 deletions upgrade/files/14.0.0.B2-14.0.0.RC1/files/api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

define('BX_API', true);

require_once('./inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . "profiles.inc.php");
require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");

header('Content-Type: application/json');

bx_api_check_access();

if (bx_get('cnf') ){
$sCnf = getParam('sys_api_config');
echo json_encode(['data' => $sCnf, 'hash' => md5($sCnf)]);
exit();
}

// prepare params

$aRequest = isset($_GET['r']) ? explode('/', $_GET['r']) : [];

$a = ['sModule', 'sMethod', 'sClass'];
foreach ($aRequest as $i => $v)
if (isset($a[$i]) && preg_match('/^[A-Za-z0-9_-]+$/', $v))
${$a[$i]} = $v;

if (!isset($sClass))
$sClass = 'Module';

foreach ($a as $v) {
if (!isset($$v)) {
header('HTTP/1.0 404 Not Found');
header('Status: 404 Not Found');
BxDolLanguages::getInstance();
echo json_encode(['status' => 404, 'error' => _t("_sys_request_page_not_found_cpt")]);
exit;
}
}

// check if service exists

if (!BxDolRequest::serviceExists($sModule, $sMethod, $sClass)) {
header('HTTP/1.0 404 Not Found');
header('Status: 404 Not Found');
BxDolLanguages::getInstance();
echo json_encode(['status' => 404, 'error' => _t("_sys_request_page_not_found_cpt")]);
exit;
}

// check if service is safe

if (!getParam('sys_api_access_unsafe_services')) {
$b = BxDolRequest::serviceExists($sModule, 'is_safe_service', 'system' == $sModule ? 'TemplServices' : 'Module');
$bSafe = $b ? BxDolService::call($sModule, 'is_safe_service', array($sMethod), 'system' == $sModule ? 'TemplServices' : 'Module') : false;

$bPublic = false;
if (!$bSafe) {
$b = BxDolRequest::serviceExists($sModule, 'is_public_service', 'system' == $sModule ? 'TemplServices' : 'Module');
$bPublic = $b ? BxDolService::call($sModule, 'is_public_service', array($sMethod), 'system' == $sModule ? 'TemplServices' : 'Module') : false;
}
if (!$bPublic && !$bSafe) {
header('HTTP/1.0 403 Forbidden');
header('Status: 403 Forbidden');
echo json_encode(['status' => 403, 'error' => _t("_Access denied")]);
exit;
}
}

// call service

if (!($aParams = bx_get('params')))
$aParams = array();
elseif (is_string($aParams) && preg_match('/^\[.*\]$/', $aParams))
$aParams = @json_decode($aParams, true);

if (!is_array($aParams))
$aParams = array($aParams);

$mixedRet = BxDolService::call($sModule, $sMethod, $aParams, $sClass);

// check output and return JSON

if (is_array($mixedRet) && isset($mixedRet['error'])) {
header('HTTP/1.0 500 Internal Server Error');
header('Status: 500 Internal Server Error');
$a = [
'status' => isset($mixedRet['code']) ? $mixedRet['code'] : 500,
'error' => isset($mixedRet['desc']) ? $mixedRet['desc'] : $mixedRet['error'],
'data' => isset($mixedRet['data']) ? $mixedRet['data'] : '',
];
if (isset($mixedRet['code']))
$a['code'] = $mixedRet['code'];
echo json_encode($a);
exit;
}

$aRv = [
'status' => 200,
'module' => $sModule,
'method' => $sMethod,
'params' => $aParams,
'data' => $mixedRet,
'hash' => md5(getParam('sys_api_config')),
];

echo json_encode($aRv);
43 changes: 43 additions & 0 deletions upgrade/files/14.0.0.B2-14.0.0.RC1/files/grid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup UnaCore UNA Core
* @{
*/

require_once('./inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
require_once(BX_DIRECTORY_PATH_INC . "utils.inc.php");

bx_import('BxDolLanguages');

$sObject = bx_process_input(bx_get('o'));
if (!$sObject)
exit;

$oTemplate = null;
if(bx_get(BX_DOL_STUDIO_TEMPLATE_CODE_KEY) !== false)
$oTemplate = BxDolStudioTemplate::getInstance();

$oGrid = BxDolGrid::getObjectInstance($sObject, $oTemplate);
if (!$oGrid) {
// no such grid object available
exit;
}

if(method_exists($oGrid, 'init'))
$oGrid->init();

$sAction = 'performAction' . bx_gen_method_name(bx_process_input(bx_get('a')));
if (method_exists($oGrid, $sAction)) {
if ($oGrid->isActionCsrfCheckingDisabled() || BxDolForm::isCsrfTokenValid(bx_get('csrf_token'), false)) {
$oGrid->$sAction();
}
else {
echoJson(['msg' => _t('_sys_txt_form_submission_error_csrf_expired'), 'grid' => $oGrid->getCode(false)]);
}
}

/** @} */
Loading

0 comments on commit 3de832a

Please sign in to comment.