forked from unacms/una
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconn.php
34 lines (24 loc) · 776 Bytes
/
conn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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");
check_logged();
$sObj = bx_get('obj') ? bx_get('obj') : '';
$sAct = bx_get('act') && preg_match ('/^[A-Za-z_]+$/', bx_get('act')) ? bx_get('act') : '';
$sFmt = bx_get('fmt') ? bx_get('fmt') : 'json';
$oConn = BxDolConnection::getObjectInstance($sObj);
$sMethod = 'action' . $sAct;
if ($oConn && $sAct && method_exists($oConn, $sMethod)) {
echo $oConn->outputActionResult($oConn->$sMethod(), $sFmt);
exit;
} else {
$oTemplate = BxDolTemplate::getInstance();
$oTemplate->displayPageNotFound();
}
/** @} */