#12286 fix issue logout public link visual console

This commit is contained in:
Jonathan 2023-10-19 10:53:20 +02:00
parent d5193615f9
commit 42aa751d29
1 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,12 @@ require_once 'include/functions_visual_map.php';
$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.
// DO NOT move it after of get parameter user id.
if (User::validatePublicHash($hash) !== true) {
@ -316,3 +322,10 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
}
});
</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), '/');
}