mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Merge branch 'ent-12286-16465-acceso-a-pandora-a-traves-de-public-link-url-de-consolas-visuales-con-usuario-de-public-2' into 'develop'
Ent 12286 16465 acceso a pandora a traves de public link url de consolas visuales con usuario de public 2 See merge request artica/pandorafms!6578
This commit is contained in:
commit
dcd891eedb
@ -1627,7 +1627,6 @@ if (check_login()) {
|
|||||||
|
|
||||||
// Uncompress.
|
// Uncompress.
|
||||||
try {
|
try {
|
||||||
ob_start();
|
|
||||||
$dateNow = get_system_time();
|
$dateNow = get_system_time();
|
||||||
$final = ($dateNow - $period);
|
$final = ($dateNow - $period);
|
||||||
$date = ($dateNow - ($time_all_box * $start));
|
$date = ($dateNow - ($time_all_box * $start));
|
||||||
@ -1751,31 +1750,11 @@ if (check_login()) {
|
|||||||
'recordsFiltered' => $total_box,
|
'recordsFiltered' => $total_box,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$response = ob_get_clean();
|
|
||||||
|
|
||||||
// Clean output buffer.
|
|
||||||
while (ob_get_level() !== 0) {
|
|
||||||
ob_end_clean();
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo json_encode(
|
echo json_encode(
|
||||||
['error' => $e->getMessage()]
|
['error' => $e->getMessage()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not valid it will throw an exception.
|
|
||||||
json_decode($response);
|
|
||||||
if (json_last_error() === JSON_ERROR_NONE) {
|
|
||||||
// If valid dump.
|
|
||||||
echo $response;
|
|
||||||
} else {
|
|
||||||
echo json_encode(
|
|
||||||
['error' => $response]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($get_cluster_module_detail === true) {
|
if ($get_cluster_module_detail === true) {
|
||||||
|
@ -518,6 +518,10 @@ class DataMatrix extends Widget
|
|||||||
$column_names = $info_columns['column_names'];
|
$column_names = $info_columns['column_names'];
|
||||||
$columns_sort = $info_columns['columns_sort'];
|
$columns_sort = $info_columns['columns_sort'];
|
||||||
|
|
||||||
|
// Public dashboard.
|
||||||
|
$hash = get_parameter('auth_hash', '');
|
||||||
|
$id_user = get_parameter('id_user', '');
|
||||||
|
|
||||||
$tableId = 'dataMatrix_'.$this->dashboardId.'_'.$this->cellId;
|
$tableId = 'dataMatrix_'.$this->dashboardId.'_'.$this->cellId;
|
||||||
// Load datatables user interface.
|
// Load datatables user interface.
|
||||||
ui_print_datatable(
|
ui_print_datatable(
|
||||||
@ -535,6 +539,9 @@ class DataMatrix extends Widget
|
|||||||
'slice' => $this->values['slice'],
|
'slice' => $this->values['slice'],
|
||||||
'formatData' => $this->values['formatData'],
|
'formatData' => $this->values['formatData'],
|
||||||
'modules' => json_encode($modules),
|
'modules' => json_encode($modules),
|
||||||
|
'auth_hash' => $hash,
|
||||||
|
'auth_class' => 'PandoraFMS\Dashboard\Manager',
|
||||||
|
'id_user' => $id_user,
|
||||||
],
|
],
|
||||||
'default_pagination' => $this->values['limit'],
|
'default_pagination' => $this->values['limit'],
|
||||||
'no_sortable_columns' => $columns_sort,
|
'no_sortable_columns' => $columns_sort,
|
||||||
|
@ -383,6 +383,9 @@ class ITSMIncidences extends Widget
|
|||||||
$column_names[] = $fields[$field];
|
$column_names[] = $fields[$field];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hash = get_parameter('auth_hash', '');
|
||||||
|
$id_user = get_parameter('id_user', '');
|
||||||
|
|
||||||
$tableId = 'ITSMIncidence_'.$this->dashboardId.'_'.$this->cellId;
|
$tableId = 'ITSMIncidence_'.$this->dashboardId.'_'.$this->cellId;
|
||||||
try {
|
try {
|
||||||
ui_print_datatable(
|
ui_print_datatable(
|
||||||
@ -396,6 +399,9 @@ class ITSMIncidences extends Widget
|
|||||||
'ajax_data' => [
|
'ajax_data' => [
|
||||||
'method' => 'getListTickets',
|
'method' => 'getListTickets',
|
||||||
'customSearch' => $this->values['customSearch'],
|
'customSearch' => $this->values['customSearch'],
|
||||||
|
'auth_hash' => $hash,
|
||||||
|
'auth_class' => 'PandoraFMS\Dashboard\Manager',
|
||||||
|
'id_user' => $id_user,
|
||||||
],
|
],
|
||||||
'order' => [
|
'order' => [
|
||||||
'field' => 'updateDate',
|
'field' => 'updateDate',
|
||||||
|
@ -431,6 +431,8 @@ class ModulesByStatus extends Widget
|
|||||||
$info_columns = $this->columns();
|
$info_columns = $this->columns();
|
||||||
$column_names = $info_columns['column_names'];
|
$column_names = $info_columns['column_names'];
|
||||||
$columns = $info_columns['columns'];
|
$columns = $info_columns['columns'];
|
||||||
|
$hash = get_parameter('auth_hash', '');
|
||||||
|
$id_user = get_parameter('id_user', '');
|
||||||
|
|
||||||
$tableId = 'ModuleByStatus_'.$this->dashboardId.'_'.$this->cellId;
|
$tableId = 'ModuleByStatus_'.$this->dashboardId.'_'.$this->cellId;
|
||||||
// Load datatables user interface.
|
// Load datatables user interface.
|
||||||
@ -449,6 +451,9 @@ class ModulesByStatus extends Widget
|
|||||||
'status' => $this->values['status'],
|
'status' => $this->values['status'],
|
||||||
'nodes' => $this->values['nodes'],
|
'nodes' => $this->values['nodes'],
|
||||||
'disabled_modules' => $this->values['disabled_modules'],
|
'disabled_modules' => $this->values['disabled_modules'],
|
||||||
|
'auth_hash' => $hash,
|
||||||
|
'auth_class' => 'PandoraFMS\Dashboard\Manager',
|
||||||
|
'id_user' => $id_user,
|
||||||
],
|
],
|
||||||
'default_pagination' => $this->values['limit'],
|
'default_pagination' => $this->values['limit'],
|
||||||
'order' => [
|
'order' => [
|
||||||
|
@ -354,8 +354,6 @@ if (is_ajax() === true) {
|
|||||||
|
|
||||||
if ($get_events !== 0) {
|
if ($get_events !== 0) {
|
||||||
try {
|
try {
|
||||||
ob_start();
|
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'te.id_evento',
|
'te.id_evento',
|
||||||
'te.id_agente',
|
'te.id_agente',
|
||||||
@ -1223,32 +1221,15 @@ if (is_ajax() === true) {
|
|||||||
'recordsFiltered' => $count,
|
'recordsFiltered' => $count,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$response = ob_get_clean();
|
|
||||||
|
|
||||||
// Clean output buffer.
|
|
||||||
while (ob_get_level() !== 0) {
|
|
||||||
ob_end_clean();
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo json_encode(
|
echo json_encode(
|
||||||
['error' => $e->getMessage()]
|
['error' => $e->getMessage()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not valid it will throw an exception.
|
|
||||||
json_decode($response);
|
|
||||||
if (json_last_error() == JSON_ERROR_NONE) {
|
|
||||||
// If valid dump.
|
|
||||||
echo $response;
|
|
||||||
} else {
|
|
||||||
echo json_encode(
|
|
||||||
['error' => $response]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AJAX section ends.
|
// AJAX section ends.
|
||||||
exit;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -62,6 +62,12 @@ require_once 'include/functions_visual_map.php';
|
|||||||
|
|
||||||
$hash = (string) get_parameter('hash');
|
$hash = (string) get_parameter('hash');
|
||||||
|
|
||||||
|
// For public link issue.
|
||||||
|
$force_instant_logout = true;
|
||||||
|
if (isset($config['id_user']) === true) {
|
||||||
|
$force_instant_logout = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check input hash.
|
// Check input hash.
|
||||||
// DO NOT move it after of get parameter user id.
|
// DO NOT move it after of get parameter user id.
|
||||||
if (User::validatePublicHash($hash) !== true) {
|
if (User::validatePublicHash($hash) !== true) {
|
||||||
@ -316,3 +322,10 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<?php
|
||||||
|
if ($force_instant_logout === true) {
|
||||||
|
unset($userAccessMaintenance, $config['id_user'], $hash);
|
||||||
|
session_destroy();
|
||||||
|
header_remove('Set-Cookie');
|
||||||
|
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user