KPAC Login Redirect Fix
authorAdam Bowling <abowling@emeralddata.net>
Wed, 31 Dec 2014 16:47:01 +0000 (11:47 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 9 Dec 2017 19:34:00 +0000 (14:34 -0500)
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 <abowling@emeralddata.net>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Conflicts:

Open-ILS/src/templates/kpac/parts/header.tt2

Open-ILS/src/templates/kpac/parts/header.tt2
Open-ILS/src/templates/opac/parts/login/form.tt2

index 8f75dce..dc26069 100644 (file)
@@ -29,7 +29,8 @@
                 {redirect_to => redir.replace('^https:', 'http:')}, 1) %]">[% 
                     l('Logout ([_1] [_2])', ctx.user.first_given_name, ctx.user.family_name) %]</a>
         [% ELSE %]
-            <a href="[% mkurl(ctx.opac_root _ '/login').replace('^http:', 'https:') %]">[% l('My Account') %]</a>
+                   [% redir = CGI.url('-base' => 1) _ ctx.kpac_root _ '/home' %]
+            <a href="[% mkurl(ctx.opac_root _ '/login?redirect_to=' _ redir).replace('^http:', 'https:') %]">[% l('Login') %]</a>
         [% END %]
     </div>
     
index da424a6..35dd3e0 100644 (file)
         [%
             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;