From 166345c3541e35a4a6b8492d8736c60530ea6a13 Mon Sep 17 00:00:00 2001
From: Jaime Perez <jaime.perez@uninett.no>
Date: Wed, 5 Mar 2014 19:09:33 +0100
Subject: [PATCH] Fix SimpleSAML_Session::registerLogoutHandler() to stop using
 the deprecated $authority property.

---
 lib/SimpleSAML/Session.php | 5 +++--
 www/authmemcookie.php      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index cc68ea420..8bdde73f6 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -506,11 +506,12 @@ class SimpleSAML_Session {
 	/**
 	 * This function registers a logout handler.
 	 *
+	 * @param string $authority The authority for which register the handler.
 	 * @param string $classname The class which contains the logout handler.
 	 * @param string $functionname The logout handler function.
 	 * @throws Exception If the handler is not a valid function or method.
 	 */
-	public function registerLogoutHandler($classname, $functionname) {
+	public function registerLogoutHandler($authority, $classname, $functionname) {
 		assert('isset($this->authData[$this->authority])');
 
 		$logout_handler = array($classname, $functionname);
@@ -521,7 +522,7 @@ class SimpleSAML_Session {
 		}
 
 
-		$this->authData[$this->authority]['LogoutHandlers'][] = $logout_handler;
+		$this->authData[$authority]['LogoutHandlers'][] = $logout_handler;
 		$this->dirty = TRUE;
 	}
 
diff --git a/www/authmemcookie.php b/www/authmemcookie.php
index dc52fc2c3..8acd30794 100644
--- a/www/authmemcookie.php
+++ b/www/authmemcookie.php
@@ -90,7 +90,7 @@ try {
 
 	/* Register logout handler. */
 	$session = SimpleSAML_Session::getSessionFromRequest();
-	$session->registerLogoutHandler('SimpleSAML_AuthMemCookie', 'logoutHandler');
+	$session->registerLogoutHandler($sourceId, 'SimpleSAML_AuthMemCookie', 'logoutHandler');
 
 	/* Redirect the user back to this page to signal that the login is completed. */
 	SimpleSAML_Utilities::redirectTrustedURL(SimpleSAML_Utilities::selfURL());
-- 
GitLab