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>
[%
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;