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>
Sun, 17 Sep 2017 20:10:16 +0000 (16:10 -0400)
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 <abowling@emeralddata.net>
Open-ILS/src/templates/opac/parts/login/form.tt2

index 267bd86..c018b05 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;