From f294b50851fdc949c24c33ff8a5cd0805ea3caea Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 16 May 2008 08:44:29 +0000
Subject: [PATCH] Add error message for errors due to logout information being
 lost during a logout operation.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@580 44740490-163a-0410-bde0-09ae8108e29a
---
 dictionaries/errors.php               | 9 +++++++++
 www/saml2/idp/SingleLogoutService.php | 2 +-
 www/saml2/sp/SingleLogoutService.php  | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dictionaries/errors.php b/dictionaries/errors.php
index 12de1177d..f4a5b6f6f 100644
--- a/dictionaries/errors.php
+++ b/dictionaries/errors.php
@@ -632,4 +632,13 @@ $lang = array(
 		'es' => 'La clave de acceso del fichero de configuraciĂłn (auth.adminpassword) no ha sido cambiada de su valor por defecto. Por favor, edite dicho fichero'
 	),
 
+	'title_LOGOUTINFOLOST' => array(
+		'en' => 'Logout information lost',
+		'no' => 'Informasjon om utlogging er tapt',
+	),
+	'descr_LOGOUTINFOLOST' => array(
+		'en' => 'The information about the current logout operation has been lost. You should return to the service you were trying to log out from and try to log out again. This error can be caused by the logout information expiring. The logout information is stored for a limited amout of time - usually a number of hours. This is longer than any normal logout operation should take, so this error may indicate some other error with the configuration. If the problem persists, contact your service provider.',
+		'no' => 'Informasjonen om den nåværende utloggingen har gått tapt. Du bør gå tilbake til den opprinnelige tjesesten og prøve å logge ut på nytt. Informasjon om utloggingsoperasjoner er kun lagret i en begrenset tid - vanligvis noen timer. Dette er lengere tid enn en vanlig utlogging skal ta, så denne feilen kan tyde på at noe er galt med oppsettet. Ta kontakt med tjenesteyteren hvis problemet gjentar seg.',
+	),
+
 );
\ No newline at end of file
diff --git a/www/saml2/idp/SingleLogoutService.php b/www/saml2/idp/SingleLogoutService.php
index 77d0d46f0..72c270726 100644
--- a/www/saml2/idp/SingleLogoutService.php
+++ b/www/saml2/idp/SingleLogoutService.php
@@ -319,7 +319,7 @@ if ($session->getAuthority() == 'shib13') {
 try {
 
 	if(!$logoutInfo) {
-		throw new Exception('The logout information has been lost during logout processing.');
+		SimpleSAML_Utilities::fatalError($session->getTrackID(), 'LOGOUTINFOLOST');
 	}
 	
 	SimpleSAML_Logger::debug('SAML2.0 - IdP.SingleLogoutService: Found logout info with these keys: ' . join(',', array_keys($logoutInfo)));
diff --git a/www/saml2/sp/SingleLogoutService.php b/www/saml2/sp/SingleLogoutService.php
index a56371c44..d5ac61084 100644
--- a/www/saml2/sp/SingleLogoutService.php
+++ b/www/saml2/sp/SingleLogoutService.php
@@ -110,7 +110,7 @@ if (isset($_GET['SAMLRequest'])) {
 	$returnTo = $session->getData('spLogoutReturnTo', $id);
 
 	if(empty($returnTo)) {
-		SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NORELAYSTATE');
+		SimpleSAML_Utilities::fatalError($session->getTrackID(), 'LOGOUTINFOLOST');
 	}
 
 	SimpleSAML_Utilities::redirect($returnTo);
-- 
GitLab