diff --git a/pandora_console/index.php b/pandora_console/index.php index 22a5f46179..5b724c52dc 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -359,15 +359,21 @@ if (! isset($config['id_user'])) { $nick_in_db = $_SESSION['prepared_login_da']['id_user']; $expired_pass = false; } else if (($config['auth'] == 'saml') && ($login_button_saml)) { - if (!include_once 'include/auth/saml.php') { + $saml_configured = include_once $config['homedir'].'/'.ENTERPRISE_DIR.'/include/auth/saml.php'; + + if (!$saml_configured) { include_once 'general/noaccesssaml.php'; - } else { - $saml_user_id = saml_process_user_login(); } + $saml_user_id = saml_process_user_login(); + + if (!$saml_user_id) { + include_once 'general/noaccesssaml.php'; + } + + $nick_in_db = $saml_user_id; if (!$nick_in_db) { - include_once 'general/noaccesssaml.php'; include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; $as = new SimpleSAML_Auth_Simple($config['saml_source']); $as->logout();