From 66a69aa548e954e7532d5c0ef7c8cb5a3c9547b9 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 13 May 2022 09:51:43 +0200 Subject: [PATCH 1/2] #8889 Added external link for mobile --- pandora_console/mobile/index.php | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index 1e65c30bdf..fc792e0a17 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -294,6 +294,42 @@ switch ($action) { $_GET['id'] = $id_map; break; + case 'External link': + $full_url = ui_get_full_url(); + $section_data = io_safe_output($section_data); + + $host_full = parse_url($full_url, PHP_URL_HOST); + $host_section = parse_url($section_data, PHP_URL_HOST); + + if ($host_full !== $host_section) { + $has_mobile = strpos($section_data, 'mobile'); + if ($has_mobile === false) { + $pos = strpos($section_data, '/index'); + if ($pos !== false) { + $section_data = substr_replace($section_data, '/mobile', $pos, 0); + } + } + + echo ''; + } else { + if (strpos($full_url, 'event') !== false) { + $page = 'events'; + } + + if (strpos($full_url, 'alert') !== false) { + $page = 'alerts'; + } + + if (strpos($full_url, 'tactical') !== false) { + $page = 'tactical'; + } + + if (strpos($full_url, 'visual_console') !== false) { + $page = 'visualmap'; + } + } + break; + case 'Group view': default: // No content. From 0ff688f6fad24a5fa5e7cab6ee36f7a792d82209 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 14 Jul 2022 16:50:26 +0200 Subject: [PATCH 2/2] #8889 Fixed url location --- pandora_console/mobile/index.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index fc792e0a17..dc79e07c04 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -193,15 +193,23 @@ switch ($action) { if ($user->isWaitingDoubleAuth()) { if ($user->validateDoubleAuthCode()) { - // Logged. Refresh the page - header('Location: .'); + $url = ui_get_full_url(''); + $url = str_replace("\n", '', $url); + $url = str_replace('?action=logout', '', $url); + + // Logged. Refresh the page. + header('Location: '.$url); return; } else { $user->showDoubleAuthPage(); } } else { - // Logged. Refresh the page - header('Location: .'); + $url = ui_get_full_url(''); + $url = str_replace("\n", '', $url); + $url = str_replace('?action=logout', '', $url); + + // Logged. Refresh the page. + header('Location: '.$url); return; } } else {