Bugzilla – Attachment 48390 Details for
Bug 13871
OverDrive message when user authentication fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13871 - OverDrive message when user authentication fails
Bug-13871---OverDrive-message-when-user-authentica.patch (text/plain), 4.61 KB, created by
Marcel de Rooy
on 2016-02-26 09:47:32 UTC
(
hide
)
Description:
Bug 13871 - OverDrive message when user authentication fails
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-02-26 09:47:32 UTC
Size:
4.61 KB
patch
obsolete
>From 10953c74d60b6839199e6f1ec9f4fe111a631132 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Mon, 23 Mar 2015 12:06:27 +1300 >Subject: [PATCH] Bug 13871 - OverDrive message when user authentication fails >MIME-Version: 1.0 >Content-Type: text/plain; charset=utf-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset=utf-8 > >NOTE: apply this patch after the additional perltidy patch > >this patch is basically a small work-around to fix some confusing login text, >when users enter incorrect auth details via Overdrive's website > >with this option disabled (default) there is no change to SIP's behaviour > >to test... > >1/ configure your overdrive account to talk to your Koha's SIP service > >2/ start Koha's SIP > >3/ enter a correct username and correct password in overdrive >see overdrive display '(1) Greetings from Koha' (good) > >4/ enter a correct username and *incorrect* password in overdrive >see overdrive display '(1) Greetings from Koha' (bad) > >5/ enter an incorrect username in overdrive >see overdrive display '(1)' (badder) > >6/ apply patch, enable 'overdrive-mode' in Koha's SIPConfig.xml > >example... >--------------------- ><accounts> ><login id="kohasip" password="xxxxx" delimiter="|" >error-detect="enabled" institution="YYY" overdrive-mode="1" /> ></accounts> >--------------------- > >7/ restart SIP > >8/ enter a correct username and correct password >see overdrive display '(1) Greetings from Kohaâ¦' > >9/ enter a correct username and *incorrect* password >see overdrive display '(1) Invalid patron or patron password' > >10/ enter an incorrect username and incorrect password >see overdrive display '(1) Invalid patron or patron password' > >http://bugs.koha-community.org/show_bug.cgi?id=1387 > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/SIP/Sip/MsgType.pm | 28 ++++++++++++++++++++++++---- > 1 file changed, 24 insertions(+), 4 deletions(-) > >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index b0607df..451f228 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -406,11 +406,26 @@ sub handle { > # > sub build_patron_status { > my ( $patron, $lang, $fields, $server ) = @_; >- >+ my $overdrive_mode = $server->{account}->{'overdrive-mode'}; > my $patron_pwd = $fields->{ (FID_PATRON_PWD) }; > my $resp = (PATRON_STATUS_RESP); >+ my $password_ok = 1; >+ my $password_rc; > > if ($patron) { >+ if ($patron_pwd) { >+ $password_rc = $patron->check_password($patron_pwd); >+ $password_ok = 0 unless $password_rc; >+ } >+ elsif ( $overdrive_mode >+ and not exists $fields->{'AL'} # not block_request >+ and not $patron_pwd ) # no password supplied >+ { >+ $password_ok = 0; >+ } >+ } >+ >+ if ( $patron and $password_ok ) { > $resp .= patron_status_string($patron); > $resp .= $lang . timestamp(); > $resp .= add_field( FID_PERSONAL_NAME, $patron->name ); >@@ -418,11 +433,12 @@ sub build_patron_status { > # while the patron ID we got from the SC is valid, let's > # use the one returned from the ILS, just in case... > $resp .= add_field( FID_PATRON_ID, $patron->id ); >+ > if ( $protocol_version >= 2 ) { > $resp .= add_field( FID_VALID_PATRON, 'Y' ); > > # Patron password is a required field. >- $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) ); >+ $resp .= add_field( FID_VALID_PATRON_PWD, sipbool($password_rc) ); > $resp .= maybe_add( FID_CURRENCY, $patron->currency ); > $resp .= maybe_add( FID_FEE_AMT, $patron->fee_amount ); > } >@@ -430,11 +446,12 @@ sub build_patron_status { > $resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg, $server ); > $resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server ) > if ( $server->{account}->{send_patron_home_library_in_af} ); >- > $resp .= maybe_add( FID_PRINT_LINE, $patron->print_line ); > } else { > >- # Invalid patron id. Report that the user has no privs., >+ # Invalid patron id (and/or passwd for overdrive_mode) >+ # Report that the user has no privs. >+ > # no personal name, and is invalid (if we're using 2.00) > $resp .= 'YYYY' . ( ' ' x 10 ) . $lang . timestamp(); > $resp .= add_field( FID_PERSONAL_NAME, '' ); >@@ -445,6 +462,9 @@ sub build_patron_status { > > ( $protocol_version >= 2 ) > and $resp .= add_field( FID_VALID_PATRON, 'N' ); >+ >+ $resp .= >+ maybe_add( FID_SCREEN_MSG, 'Invalid patron or patron password' ); > } > > $resp .= add_field( FID_INST_ID, $fields->{ (FID_INST_ID) } ); >-- >1.7.10.4
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 13871
:
37539
|
37543
|
38451
|
38452
|
38453
|
38454
|
38455
|
45645
|
45646
|
45647
|
45648
|
45649
|
48386
|
48387
|
48388
|
48389
|
48390
|
48391
|
48392
|
48393
|
48667
|
48668
|
48669
|
48670
|
48671
|
48672
|
51421
|
51422