Wip command center, api call node

This commit is contained in:
Daniel Barbero Martin 2021-06-10 14:15:36 +02:00
parent 9e27843b19
commit b4e1c9d61f
2 changed files with 22 additions and 2 deletions

View File

@ -275,7 +275,7 @@ if ($correctLogin) {
break;
case 'event':
// Preventive check for users if not available write events
// Preventive check for users if not available write events.
if (! check_acl($config['id_user'], $event['id_grupo'], 'EW')) {
return false;
}
@ -322,7 +322,10 @@ if ($correctLogin) {
sleep(15);
// Protection on DoS attacks.
echo 'auth error';
returnError(
'auth_error',
$returnType
);
}
// Logout.

View File

@ -108,6 +108,7 @@ function returnError($typeError, $returnType='string')
{
switch ($typeError) {
case 'no_set_no_get_no_help':
http_response_code(403);
returnData(
$returnType,
[
@ -118,6 +119,7 @@ function returnError($typeError, $returnType='string')
break;
case 'no_exist_operation':
http_response_code(404);
returnData(
$returnType,
[
@ -128,6 +130,7 @@ function returnError($typeError, $returnType='string')
break;
case 'id_not_found':
http_response_code(403);
returnData(
$returnType,
[
@ -138,6 +141,7 @@ function returnError($typeError, $returnType='string')
break;
case 'not_allowed_operation_cluster':
http_response_code(403);
returnData(
$returnType,
[
@ -148,6 +152,7 @@ function returnError($typeError, $returnType='string')
break;
case 'forbidden':
http_response_code(403);
returnData(
$returnType,
[
@ -168,6 +173,7 @@ function returnError($typeError, $returnType='string')
break;
case 'centralized':
http_response_code(403);
returnData(
$returnType,
[
@ -177,6 +183,17 @@ function returnError($typeError, $returnType='string')
);
break;
case 'auth_error':
http_response_code(403);
returnData(
$returnType,
[
'type' => 'string',
'data' => __('Auth error'),
]
);
break;
default:
returnData(
$returnType,