From 71993eec0006abcd8ca9aaad1cc34b195027c337 Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 1 Dec 2016 13:38:51 +1300 Subject: [PATCH] Bug 18118 - Unexpected behaviour with 'GoogleOpenIDConnect' and 'OpacPublic' syspref combination. Content-Type: text/plain; charset="utf-8" to test this patch... 1/ configure a working 'GoogleOpenIDConnect' account 2/ set 'OpacPublic' syspref to OFF 3/ log in user successfully via google-auth, observe redirect to opac-user.pl (bad) 4/ apply patch 5/ log in user successfully via google-auth, observe expected redirect to opac-main.pl (good) --- opac/svc/auth/googleopenidconnect | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/opac/svc/auth/googleopenidconnect b/opac/svc/auth/googleopenidconnect index ab71918..d6c8228 100755 --- a/opac/svc/auth/googleopenidconnect +++ b/opac/svc/auth/googleopenidconnect @@ -182,8 +182,16 @@ elsif ( defined $query->param('code') ) { my ( $userid, $cookie, $session_id ) = checkauth( $query, 1, {}, 'opac', $email ); if ($userid) { # A user with this email is registered in koha + + #handle redirect to main.pl, for private opac + my $uri; + if (C4::Context->preference('OpacPublic') ) { + $uri = '/cgi-bin/koha/opac-user.pl'; + } else { + $uri = '/cgi-bin/koha/opac-main.pl'; + } print $query->redirect( - -uri => '/cgi-bin/koha/opac-user.pl', + -uri => $uri, -cookie => $cookie ); } -- 2.1.4