Bugzilla – Attachment 15580 Details for
Bug 9587
Allow login via mozilla persona - https://www.mozilla.org/en-US/persona/
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9587 : Handling mismatched emails better
Bug-9587--Handling-mismatched-emails-better.patch (text/plain), 2.02 KB, created by
Chris Cormack
on 2013-02-20 22:43:41 UTC
(
hide
)
Description:
Bug 9587 : Handling mismatched emails better
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-02-20 22:43:41 UTC
Size:
2.02 KB
patch
obsolete
>From e0e635122f84c17c78fc6d8431c0895a7c70d3dd Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Thu, 21 Feb 2013 11:34:41 +1300 >Subject: [PATCH] Bug 9587 : Handling mismatched emails better > >To test: > >Sign in to Koha via persona using an email that doesn't exist in Koha > >Before the patch you will get into an infinite redirect loop > >After the patch it will give you an error message >--- > koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc | 5 ++++- > opac/svc/login | 10 ++++++++-- > 2 files changed, 12 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc >index b875028..78c8bd3 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc >@@ -72,7 +72,10 @@ navigator.id.watch({ > function (data) { > window.location = '/cgi-bin/koha/opac-user.pl'; > } >- ); >+ ) >+ .fail(function() { var errstr = _("Could not login, perhaps your Persona email does not match your Koha one"); >+ alert(errstr); >+ }); > }, > onlogout: function () { > window.location = '/cgi-bin/koha/opac-main.pl?logout.x=1'; >diff --git a/opac/svc/login b/opac/svc/login >index 607b566..c2925b0 100755 >--- a/opac/svc/login >+++ b/opac/svc/login >@@ -44,8 +44,14 @@ if ( $response->is_success ) { > my $decoded_json = decode_json($content); > my ( $userid, $cookie, $sessionID ) = > checkauth( $query, 1, { borrow => 1 }, 'opac', $decoded_json->{'email'} ); >- print $query->header( -cookie => $cookie ); >- print $decoded_json; >+ if ($userid) { # a valid user has logged in >+ print $query->header( -cookie => $cookie ); >+ print $decoded_json; >+ } >+ else { >+# logged in with an email that isn't associated with a borrower >+ die "Email not associated with a borrower"; >+ } > } > else { > warn $response->status_line, "\n"; >-- >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 9587
:
15226
|
15254
|
15257
|
15258
|
15265
|
15266
|
15449
|
15459
|
15474
|
15475
|
15476
|
15477
|
15478
|
15578
|
15580
|
15585