diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 2cb02315b9..259a43e971 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -358,6 +358,8 @@ function config_update_config () { $error_update[] = __('User'); if (!config_update_value ('rintegria_pass', io_input_password(get_parameter ('rintegria_pass')))) $error_update[] = __('Password'); + if (!config_update_value ('saml_path', get_parameter ('saml_path'))) + $error_update[] = __('Saml path'); if (!config_update_value ('double_auth_enabled', get_parameter ('double_auth_enabled'))) $error_update[] = __('Double authentication'); if (!config_update_value ('session_timeout', get_parameter ('session_timeout'))) @@ -1261,6 +1263,10 @@ function config_process_config () { config_update_value ( 'rintegria_pass', ''); } + if (!isset ($config['saml_path'])) { + config_update_value ('saml_path', '/opt/'); + } + if (!isset ($config['integria_enabled'])) { config_update_value ( 'integria_enabled', '0'); } diff --git a/pandora_console/index.php b/pandora_console/index.php index cac4333668..c546c4ac3a 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -297,10 +297,12 @@ if (! isset ($config['id_user'])) { } else if (($config['auth'] == 'saml') && ($login_button_saml)) { include_once(ENTERPRISE_DIR . "/include/auth/saml.php"); + $saml_user_id = saml_process_user_login(); + $nick_in_db = $saml_user_id; if (!$nick_in_db) { - require_once('/opt/simplesamlphp/lib/_autoload.php'); + require_once($config['saml_path'] . 'simplesamlphp/lib/_autoload.php'); $as = new SimpleSAML_Auth_Simple('PandoraFMS'); $as->logout(); } @@ -517,7 +519,7 @@ if (isset ($_GET["bye"])) { unset($_SESSION['id_usuario']); unset($iduser); if ($config['auth'] == 'saml') { - require_once('/opt/simplesamlphp/lib/_autoload.php'); + require_once($config['saml_path'] . 'simplesamlphp/lib/_autoload.php'); $as = new SimpleSAML_Auth_Simple('PandoraFMS'); $as->logout(); }