From fbbc070b398428827412356c1bab80e89ae179aa Mon Sep 17 00:00:00 2001 From: Ian Blenke Date: Thu, 15 Feb 2018 09:34:24 -0500 Subject: [PATCH 1/2] Adding a check for HTTP_X_FORWARDED_PROTO in https_is_running() --- pandora_console/include/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 2557ae3db2..2932b62c70 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -69,6 +69,10 @@ require_once('functions_io.php'); //} function https_is_running() { + if(isset ($_SERVER['HTTP_X_FORWARDED_PROTO']) + && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { + return true; + } if (isset ($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === true || $_SERVER['HTTPS'] == 'on')) { From ecf21f1f458b8223f1f51729bacb3647a466f51c Mon Sep 17 00:00:00 2001 From: Ian Blenke Date: Thu, 29 Mar 2018 10:56:26 -0400 Subject: [PATCH 2/2] Adding a check for HTTP_X_FORWARDED_PROTO in ui_get_full_url() --- pandora_console/include/functions_ui.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index edcbad7ee4..eb86da2df3 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2325,6 +2325,10 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal $port = null; // null means 'use the starndard port' $proxy = false; //By default Pandora FMS doesn't run across proxy. + if(isset ($_SERVER['HTTP_X_FORWARDED_PROTO']) + && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { + $_SERVER['HTTPS'] = 'on'; + } if (isset ($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === true || $_SERVER['HTTPS'] == 'on')) {