From 916aea37af3f59bef5e8900861080f9dcdc2cd31 Mon Sep 17 00:00:00 2001
From: Matthias Meusburger <matthias.meusburger@biblibre.com>
Date: Mon, 14 Oct 2013 11:24:29 +0200
Subject: [PATCH] Bug 11048: Fix logout redirection for CAS authentication

 The logout redirection function after a CAS authentication was misused.
 This patch fixes it, and allows the CAS server to redirect the user back
 to the opac after logout.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

From the Authen::Cas::Client documentation

logout_url [%args]
         "logout_url()" returns the CAS server's logout URL which can
	 be used to redirect users to end
         authenticated sessions.  %args may contain the following
	 optional parameter:

         *   url => $url

	 If present, the CAS server will present the user
	 with a link to the given URL once the user has logged out.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
---
 C4/Auth_with_cas.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm
index 46cb1ec..0a48182 100644
--- a/C4/Auth_with_cas.pm
+++ b/C4/Auth_with_cas.pm
@@ -71,7 +71,7 @@ sub logout_cas {
     $uri .= "?cas=" . $casparam if (defined $casparam);
     $casparam = $defaultcasserver if (not defined $casparam);
     my $cas = Authen::CAS::Client->new($casservers->{$casparam});
-    print $query->redirect( $cas->logout_url($uri));
+    print $query->redirect( $cas->logout_url(url => $uri));
 }
 
 # Login to CAS
-- 
1.8.3.2