Bugzilla – Attachment 124778 Details for
Bug 28785
Code in C4::Auth::checkauth is copy pasted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28785: Add skip_version_check for checkauth
Bug-28785-Add-skipversioncheck-for-checkauth.patch (text/plain), 2.42 KB, created by
Martin Renvoize
on 2021-09-10 15:47:53 UTC
(
hide
)
Description:
Bug 28785: Add skip_version_check for checkauth
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-09-10 15:47:53 UTC
Size:
2.42 KB
patch
obsolete
>From 089a3b2e1a702b58256dd8dad15ccb3b908c695f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Jul 2021 11:28:38 +0200 >Subject: [PATCH] Bug 28785: Add skip_version_check for checkauth > >We could have this patch but we also could decide to skip it. The idea >is to avoid 2 checks of the version when we are coming from checkauth. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Auth.pm | 28 ++++++++++++++++------------ > 1 file changed, 16 insertions(+), 12 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 151c7bfbd0..8712ff613c 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -867,7 +867,7 @@ sub checkauth { > elsif ( $sessionID = $query->cookie("CGISESSID") ) { # assignment, not comparison > my ( $return, $more_info ); > ( $return, $session, $more_info ) = check_cookie_auth( $sessionID, $flags, >- { remote_addr => $ENV{REMOTE_ADDR} } >+ { remote_addr => $ENV{REMOTE_ADDR}, skip_version_check => 1 } > ); > > if ( $return eq 'ok' ) { >@@ -1644,19 +1644,23 @@ sub check_cookie_auth { > > my $remote_addr = $params->{remote_addr} || $ENV{REMOTE_ADDR}; > >- unless ( C4::Context->preference('Version') ) { >+ my $skip_version_check = $params->{skip_version_check}; # Only for checkauth > >- # database has not been installed yet >- return ( "maintenance", undef ); >- } >- my $kohaversion = Koha::version(); >- $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; >- if ( C4::Context->preference('Version') < $kohaversion ) { >+ unless ( $skip_version_check ) { >+ unless ( C4::Context->preference('Version') ) { > >- # database in need of version update; assume that >- # no API should be called while databsae is in >- # this condition. >- return ( "maintenance", undef ); >+ # database has not been installed yet >+ return ( "maintenance", undef ); >+ } >+ my $kohaversion = Koha::version(); >+ $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; >+ if ( C4::Context->preference('Version') < $kohaversion ) { >+ >+ # database in need of version update; assume that >+ # no API should be called while databsae is in >+ # this condition. >+ return ( "maintenance", undef ); >+ } > } > > # see if we have a valid session cookie already >-- >2.20.1
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 28785
:
123314
|
123315
|
123316
|
123317
|
123319
|
123320
|
123321
|
123322
|
123323
|
123392
|
123393
|
123394
|
123395
|
124776
|
124777
| 124778 |
124779