From 25e01e22cd659f72194e0bebcd2354f32e9dbfac 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. Signed-off-by: Adam Bowling --- Open-ILS/src/templates/opac/parts/login/form.tt2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Open-ILS/src/templates/opac/parts/login/form.tt2 b/Open-ILS/src/templates/opac/parts/login/form.tt2 index d025df7be6..e06444ccf4 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