Merge branch 'ent-11312-15642-problemas-url-publica-de-visual-consoles' into 'develop'
Ent 11312 15642 problemas url publica de visual consoles See merge request artica/pandorafms!5963
This commit is contained in:
commit
374cad5d8d
|
@ -784,8 +784,8 @@ function loadVisualConsoleData(
|
||||||
page: "include/rest-api/index",
|
page: "include/rest-api/index",
|
||||||
getVisualConsole: 1,
|
getVisualConsole: 1,
|
||||||
visualConsoleId: vcId,
|
visualConsoleId: vcId,
|
||||||
id_user: typeof id_user == undefined ? id_user : null,
|
id_user: typeof id_user !== undefined ? id_user : null,
|
||||||
auth_hash: typeof hash == undefined ? hash : null
|
auth_hash: typeof hash !== undefined ? hash : null
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,6 +61,18 @@ echo '<link rel="stylesheet" href="'.$url_css.'?v='.$config['current_package'].'
|
||||||
require_once 'include/functions_visual_map.php';
|
require_once 'include/functions_visual_map.php';
|
||||||
|
|
||||||
$hash = (string) get_parameter('hash');
|
$hash = (string) get_parameter('hash');
|
||||||
|
|
||||||
|
// Check input hash.
|
||||||
|
// DO NOT move it after of get parameter user id.
|
||||||
|
if (User::validatePublicHash($hash) !== true) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
|
||||||
|
'Trying to access public visual console'
|
||||||
|
);
|
||||||
|
include 'general/noaccess.php';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$visualConsoleId = (int) get_parameter('id_layout');
|
$visualConsoleId = (int) get_parameter('id_layout');
|
||||||
$userAccessMaintenance = null;
|
$userAccessMaintenance = null;
|
||||||
if (empty($config['id_user']) === true) {
|
if (empty($config['id_user']) === true) {
|
||||||
|
@ -75,16 +87,6 @@ if (!isset($config['pure'])) {
|
||||||
$config['pure'] = 0;
|
$config['pure'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check input hash.
|
|
||||||
if (User::validatePublicHash($hash) !== true) {
|
|
||||||
db_pandora_audit(
|
|
||||||
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
|
|
||||||
'Trying to access public visual console'
|
|
||||||
);
|
|
||||||
include 'general/noaccess.php';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load Visual Console.
|
// Load Visual Console.
|
||||||
use Models\VisualConsole\Container as VisualConsole;
|
use Models\VisualConsole\Container as VisualConsole;
|
||||||
$visualConsole = null;
|
$visualConsole = null;
|
||||||
|
|
|
@ -85,6 +85,8 @@ $width = (int) get_parameter('width', 0);
|
||||||
$height = (int) get_parameter('height', 0);
|
$height = (int) get_parameter('height', 0);
|
||||||
// Load Visual Console.
|
// Load Visual Console.
|
||||||
use Models\VisualConsole\Container as VisualConsole;
|
use Models\VisualConsole\Container as VisualConsole;
|
||||||
|
use PandoraFMS\User;
|
||||||
|
|
||||||
$visualConsole = null;
|
$visualConsole = null;
|
||||||
try {
|
try {
|
||||||
$visualConsole = VisualConsole::fromDB(['id' => $visualConsoleId]);
|
$visualConsole = VisualConsole::fromDB(['id' => $visualConsoleId]);
|
||||||
|
@ -152,7 +154,7 @@ if ($aclWrite === true || $aclManage === true) {
|
||||||
$baseUrl = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&action2='.$action;
|
$baseUrl = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&action2='.$action;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']);
|
$hash = User::generatePublicHash();
|
||||||
|
|
||||||
$options['public_link']['text'] = '<a href="'.ui_get_full_url(
|
$options['public_link']['text'] = '<a href="'.ui_get_full_url(
|
||||||
'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user'],
|
'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user'],
|
||||||
|
|
Loading…
Reference in New Issue