Bugzilla – Attachment 119791 Details for
Bug 20854
Redirect after logout with CAS 3.0 broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20854: (QA follow-up) Improve readability
Bug-20854-QA-follow-up-Improve-readability.patch (text/plain), 2.35 KB, created by
Katrin Fischer
on 2021-04-17 13:41:31 UTC
(
hide
)
Description:
Bug 20854: (QA follow-up) Improve readability
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-04-17 13:41:31 UTC
Size:
2.35 KB
patch
obsolete
>From 2194036f92143e6496a0a154d4b7ab4a97c72db0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 16 Mar 2021 16:50:34 -0300 >Subject: [PATCH] Bug 20854: (QA follow-up) Improve readability > >The logout_cas method does too little tasks. In this case, I consider we >should not split it into a separate method. As the CAS implementation >lacked tests, it made sense to do it like this, so it is testable. But >now we have higher-level tests for logout_cas, we can bake the behavior >inside of it, and it is testable. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Auth_with_cas.pm | 28 +++++++++++++--------------- > 1 file changed, 13 insertions(+), 15 deletions(-) > >diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm >index 5fe0640a71..4a6d0557d0 100644 >--- a/C4/Auth_with_cas.pm >+++ b/C4/Auth_with_cas.pm >@@ -68,14 +68,21 @@ sub getMultipleAuth { > > # Logout from CAS > sub logout_cas { >- my ($query, $type) = @_; >- my ( $cas, $uri ) = _get_cas_and_service($query, undef, $type); >- $uri =~ s/\?logout\.x=1//; # We don't want to keep triggering a logout, if we got here, the borrower is already logged out of Koha >- my $logout_url = $cas->logout_url(url => $uri); >- $logout_url = _fix_logout_url($logout_url); >- print $query->redirect( $logout_url ); >+ my ( $query, $type ) = @_; >+ my ( $cas, $uri ) = _get_cas_and_service( $query, undef, $type ); >+ >+ # We don't want to keep triggering a logout, if we got here, >+ # the borrower is already logged out of Koha >+ $uri =~ s/\?logout\.x=1//; >+ >+ my $logout_url = $cas->logout_url( url => $uri ); >+ $logout_url =~ s/url=/service=/ >+ if C4::Context->preference('casServerVersion') eq '3'; >+ >+ print $query->redirect($logout_url); > } > >+ > # Login to CAS > sub login_cas { > my ($query, $type) = @_; >@@ -206,15 +213,6 @@ sub _get_cas_and_service { > return ( $cas, $uri ); > } > >-# Fix the logout URL when the cas server is 3.0 or superior >-sub _fix_logout_url { >- my $url = shift; >- if (C4::Context->preference('casServerVersion') eq '3') { >- $url =~ s/url=/service=/; >- } >- return $url; >-} >- > # Get the current URL with parameters contained directly into URL (GET params) > # This method replaces $query->url() which will give both GET and POST params > sub _url_with_get_params { >-- >2.11.0
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 20854
:
112561
|
118347
|
118348
|
118349
|
119789
|
119790
| 119791 |
119792