Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions core/api/jeeApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
throw new Exception(__('Vous n\'êtes pas autorisé à effectuer cette action, IP :', __FILE__) . ' ' . getClientIp());
}

if(config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), init('type'))){
if (config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), init('type'))) {
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp());
}
if(config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), init('type'))){
if (config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), init('type'))) {
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp());
}
$type = init('type');
Expand Down Expand Up @@ -168,14 +168,14 @@
$_tags = array();
$args = arg2array(init('tags'));
foreach ($args as $key => $value) {
$_tags['#' . trim(trim($key), '#') . '#'] = scenarioExpression::setTags(trim($value), $scenario);
$_tags['#' . trim(trim($key), '#') . '#'] = scenarioExpression::setTags($value, $scenario);
}
$scenario->setTags($_tags);
} else if (is_array(init('tags'))) {
$scenario->setTags(init('tags'));
}
$scenario->addTag('trigger','api');
$scenario->addTag('trigger_message',__('Scénario exécuté sur appel API', __FILE__));
$scenario->addTag('trigger', 'api');
$scenario->addTag('trigger_message', __('Scénario exécuté sur appel API', __FILE__));
$scenario_return = $scenario->launch();
if (is_string($scenario_return)) {
$return = $scenario_return;
Expand Down Expand Up @@ -237,7 +237,7 @@
if ($type == 'fullData') {
log::add('api', 'debug', __('Demande API pour les commandes', __FILE__));
header('Content-Type: application/json');
echo json_encode(jeeObject::fullData(null,$_USER_GLOBAL), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE, 1024);
echo json_encode(jeeObject::fullData(null, $_USER_GLOBAL), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE, 1024);
die();
}
if ($type == 'variable') {
Expand Down Expand Up @@ -281,10 +281,10 @@
throw new Exception(__('Requête invalide. Version JSON-RPC invalide :', __FILE__) . ' ' . $jsonrpc->getJsonrpc(), -32001);
}

if(config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), $jsonrpc->getMethod())){
if (config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), $jsonrpc->getMethod())) {
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__));
}
if(config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), $jsonrpc->getMethod())){
if (config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), $jsonrpc->getMethod())) {
throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp());
}

Expand Down Expand Up @@ -909,8 +909,8 @@
$jsonrpc->makeSuccess($scenario->stop());
}
if ($params['state'] == 'run') {
$scenario->addTag('trigger','api');
$scenario->addTag('trigger_message',__('Scénario exécuté sur appel API', __FILE__));
$scenario->addTag('trigger', 'api');
$scenario->addTag('trigger_message', __('Scénario exécuté sur appel API', __FILE__));
$jsonrpc->makeSuccess($scenario->launch());
}
if ($params['state'] == 'enable') {
Expand Down Expand Up @@ -1412,8 +1412,8 @@
/* * *********Catch exeption*************** */
} catch (Exception $e) {
$message = $e->getMessage();
if(!isset($jsonrpc) || !is_object($jsonrpc)){
if(!isset($request)){
if (!isset($jsonrpc) || !is_object($jsonrpc)) {
if (!isset($request)) {
$request = init('request');
if ($request == '') {
$request = file_get_contents("php://input");
Expand Down
3 changes: 2 additions & 1 deletion core/class/plan3d.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ public function additionalData() {
}
if ($this->getLink_type() == 'eqLogic') {
if ($this->getConfiguration('3d::widget') == 'text') {
$return['text'] = scenarioExpression::setTags($this->getConfiguration('3d::widget::text::text'));
$text = $this->getConfiguration('3d::widget::text::text');
$return['text'] = scenarioExpression::setTags($text);
preg_match_all("/#([0-9]*)#/", $this->getConfiguration('3d::widget::text::text'), $matches);
$return['cmds'] = $matches[1];
}
Expand Down
Loading