From 91bf5a300d414c4e9e215ef62abedc98e2a10ec0 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Mon, 10 Jan 2022 14:40:35 -0500 Subject: [PATCH] Conflict resolution fix between master and local for login redirect. Signed-off-by: Terran McCanna --- .../templates-bootstrap/opac/parts/login/form.tt2 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/login/form.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/login/form.tt2 index 6a02c3bed2..8da09dac0c 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/login/form.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/login/form.tt2 @@ -13,7 +13,8 @@ ELSIF ctx.login_failed_event.textcode == 'PATRON_INACTIVE'; l("This account has been deactivated.
Please contact your local library."); ELSE; - l("Login failed.
The username or password provided was not valid.
Passwords and user names are case-sensitive.
Check your Caps-Lock key and try again or contact your local library."); + l("Login failed.
The username or password provided was not valid.
" _ + "Passwords and user names are case-sensitive.
Check your Caps-Lock key and try again or contact your local library."); END; %] @@ -66,6 +67,23 @@ +
+ [% + redirect = CGI.param('redirect_to'); + # Don't use referer unless we got here from elsewhere within the TPAC + IF !redirect AND ctx.referer.match('^https?://' _ ctx.hostname _ ctx.opac_root); + redirect = ctx.referer; + END; + # If no redirect is offered or it's leading us back to the + # login form, redirect the user to My Account + IF !redirect OR redirect.match(ctx.path_info _ '$'); + redirect = CGI.url('-full' => 1) _ '/opac/myopac/main'; + END; + redirect = redirect | replace('^http:', 'https:'); + %] + + +
-- 2.11.0