Bugzilla – Attachment 72360 Details for
Bug 19160
CAS Single Logout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19160: Move the code from controller to C4::Auth_with_cas
Bug-19160-Move-the-code-from-controller-to-C4Authw.patch (text/plain), 2.89 KB, created by
Kyle M Hall (khall)
on 2018-03-02 13:44:27 UTC
(
hide
)
Description:
Bug 19160: Move the code from controller to C4::Auth_with_cas
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-03-02 13:44:27 UTC
Size:
2.89 KB
patch
obsolete
>From 705077cfaf25c388867fade07eaf861a31d9ad9a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Jan 2018 15:37:18 -0300 >Subject: [PATCH] Bug 19160: Move the code from controller to C4::Auth_with_cas > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Auth.pm | 2 +- > C4/Auth_with_cas.pm | 17 +++++++++++++++++ > opac/opac-user.pl | 21 ++++----------------- > 3 files changed, 22 insertions(+), 18 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index b0b750e..a8b1ea3 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -86,7 +86,7 @@ BEGIN { > } > } > if ($cas) { >- import C4::Auth_with_cas qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url); >+ import C4::Auth_with_cas qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_required); > } > > } >diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm >index ba683cd..1459bca 100644 >--- a/C4/Auth_with_cas.pm >+++ b/C4/Auth_with_cas.pm >@@ -228,6 +228,23 @@ sub _url_with_get_params { > return $uri_base_part . $uri_params_part; > } > >+sub logout_required { >+ my ( $query ) = @_; >+ # Check we havent been hit by a logout call >+ my $xml = $query->param('logoutRequest'); >+ if ($xml) { >+ my $dom = XML::LibXML->load_xml(string => $xml); >+ my $ticket; >+ foreach my $node ($dom->findnodes('/samlp:LogoutRequest')){ >+ $ticket = $node->findvalue('./samlp:SessionIndex'); >+ } >+ $query->param(-name =>'logout.x', -value => 1); >+ $query->param(-name =>'cas_ticket', -value => $ticket); >+ return 1; >+ } >+ return 0; >+} >+ > 1; > __END__ > >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index c5d6ab7..a247ed7 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -61,22 +61,9 @@ BEGIN { > import C4::External::BakerTaylor qw(&image_url &link_url); > } > } >-my $logout=''; >-# CAS Single Sign Out >-if (C4::Context->preference('casAuthentication')){ >- # Check we havent been hit by a logout call >- my $xml = $query->param('logoutRequest'); >- if ($xml) { >- my $dom = XML::LibXML->load_xml(string => $xml); >- my $ticket; >- foreach my $node ($dom->findnodes('/samlp:LogoutRequest')){ >- $ticket = $node->findvalue('./samlp:SessionIndex'); >- } >- $query->param(-name =>'logout.x', -value => 1); >- $query->param(-name =>'cas_ticket', -value => $ticket); >- $logout=1; >- } >-} >+ >+my $cas_logout_required = C4::Context->preference('casAuthentication') >+ and C4::Auth_with_ldap::logout_required($query); > > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > { >@@ -88,7 +75,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >-if ($logout){ >+if ($cas_logout_required){ > print $query->header; > exit; > } >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19160
:
66285
|
66306
|
70408
|
70440
|
70441
|
70442
|
71829
|
71830
|
71831
|
71832
|
71833
|
71834
|
71835
|
72358
|
72359
| 72360 |
72361
|
72362
|
72363
|
72364