Skip to content
Snippets Groups Projects
Commit 41c6b83e authored by Olav Morken's avatar Olav Morken
Browse files

saml: Fix SAML 2.0 SP logout with PostgreSQL.

The PostgreSQL database server returns all column names in lowercase,
but we are using mixed case column names. This patch changes the query
to always request lowercase column names.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3207 44740490-163a-0410-bde0-09ae8108e29a
parent b36fbaf5
No related branches found
No related tags found
No related merge requests found
...@@ -108,14 +108,15 @@ class sspmod_saml_SP_LogoutStore { ...@@ -108,14 +108,15 @@ class sspmod_saml_SP_LogoutStore {
'now' => gmdate('Y-m-d H:i:s'), 'now' => gmdate('Y-m-d H:i:s'),
); );
$query = 'SELECT _sessionIndex, _sessionId FROM ' . $store->prefix . '_saml_LogoutStore' . /* We request the columns in lowercase in order to be compatible with PostgreSQL. */
$query = 'SELECT _sessionIndex AS _sessionindex, _sessionId AS _sessionid FROM ' . $store->prefix . '_saml_LogoutStore' .
' WHERE _authSource = :_authSource AND _nameId = :_nameId AND _expire >= :now'; ' WHERE _authSource = :_authSource AND _nameId = :_nameId AND _expire >= :now';
$query = $store->pdo->prepare($query); $query = $store->pdo->prepare($query);
$query->execute($params); $query->execute($params);
$res = array(); $res = array();
while ( ($row = $query->fetch(PDO::FETCH_ASSOC)) !== FALSE) { while ( ($row = $query->fetch(PDO::FETCH_ASSOC)) !== FALSE) {
$res[$row['_sessionIndex']] = $row['_sessionId']; $res[$row['_sessionindex']] = $row['_sessionid'];
} }
return $res; return $res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment