fixes SAML

This commit is contained in:
fbsanchez 2020-10-16 15:24:21 +02:00
parent ca9b167741
commit 30c7da054f
2 changed files with 9 additions and 5 deletions

View File

@ -236,9 +236,11 @@ function enable_session_handlers()
/** /**
* Disables custom session handlers. * Disables custom session handlers.
* *
* @param string|null $id_session Force swap to target session.
*
* @return void * @return void
*/ */
function disable_session_handlers() function disable_session_handlers($id_session=null)
{ {
global $config; global $config;
@ -250,6 +252,10 @@ function disable_session_handlers()
$ss = new SessionHandler(); $ss = new SessionHandler();
session_set_save_handler($ss, true); session_set_save_handler($ss, true);
if ($id_session !== null) {
session_id($id_session);
}
session_start(); session_start();
$config['_using_pandora_sessionhandlers'] = false; $config['_using_pandora_sessionhandlers'] = false;

View File

@ -411,8 +411,7 @@ if (! isset($config['id_user'])) {
$nick_in_db = $saml_user_id; $nick_in_db = $saml_user_id;
if (!$nick_in_db) { if (!$nick_in_db) {
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
$as = new SimpleSAML_Auth_Simple($config['saml_source']); saml_logout();
$as->logout();
} }
} }
} else { } else {
@ -972,8 +971,7 @@ if (isset($_GET['bye'])) {
if ($config['auth'] == 'saml') { if ($config['auth'] == 'saml') {
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
$as = new SimpleSAML_Auth_Simple($config['saml_source']); saml_logout();
$as->logout();
} }
while (@ob_end_flush()) { while (@ob_end_flush()) {