From 738842b5020cff9e8532737a128c884c809cb817 Mon Sep 17 00:00:00 2001 From: Adam Bowling Date: Wed, 31 Dec 2014 11:47:01 -0500 Subject: [PATCH] KPAC Login Redirect Fix Fixes the redirect from the KPAC login to return back to the home page of the KPAC from the /opac/login screen, rather than back to the /opac/home screen, which is the current behavior, and confuses users of the KPAC when they end up back in the OPAC after having logged in. Modified KPAC login code to redirect to KPAC after logging in Signed-off-by: Adam Bowling Signed-off-by: Terran McCanna Conflicts: Open-ILS/src/templates/kpac/parts/header.tt2 --- Open-ILS/src/templates/kpac/parts/header.tt2 | 3 ++- Open-ILS/src/templates/opac/parts/login/form.tt2 | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/kpac/parts/header.tt2 b/Open-ILS/src/templates/kpac/parts/header.tt2 index 8f75dceceb..dc26069b26 100644 --- a/Open-ILS/src/templates/kpac/parts/header.tt2 +++ b/Open-ILS/src/templates/kpac/parts/header.tt2 @@ -29,7 +29,8 @@ {redirect_to => redir.replace('^https:', 'http:')}, 1) %]">[% l('Logout ([_1] [_2])', ctx.user.first_given_name, ctx.user.family_name) %] [% ELSE %] - [% l('My Account') %] + [% redir = CGI.url('-base' => 1) _ ctx.kpac_root _ '/home' %] + [% l('Login') %] [% END %] diff --git a/Open-ILS/src/templates/opac/parts/login/form.tt2 b/Open-ILS/src/templates/opac/parts/login/form.tt2 index 9a1d702e3a..928013b940 100644 --- a/Open-ILS/src/templates/opac/parts/login/form.tt2 +++ b/Open-ILS/src/templates/opac/parts/login/form.tt2 @@ -40,6 +40,11 @@ [% redirect = CGI.param('redirect_to'); # Don't use referer unless we got here from elsewhere within the TPAC + IF ctx.kpac_root; + IF !redirect AND ctx.referer.match('^https?://' _ ctx.hostname _ ctx.kpac_root); + redirect = ctx.referer; + END; + END; IF !redirect AND ctx.referer.match('^https?://' _ ctx.hostname _ ctx.opac_root); redirect = ctx.referer; END; -- 2.11.0