From 49e886765c83a1b22e016bfb94a2771999ef7f8f Mon Sep 17 00:00:00 2001 From: berick Date: Fri, 18 Feb 2011 09:04:32 -0500 Subject: [PATCH] after auth expire time, redirect to logout page (which ultimately redirects home) to force removal of the stale auth cookie --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 7 +++++++ Open-ILS/web/templates/default/opac/parts/base.tt2 | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index a7fc0a7715..4e9c683996 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -139,7 +139,10 @@ sub load_common { $ctx->{path_info} = $self->cgi->path_info; $ctx->{opac_root} = $ctx->{base_path} . "/opac"; # absolute base url $ctx->{is_staff} = ($self->apache->headers_in->get('User-Agent') =~ 'oils_xulrunner'); + + # capture some commonly accessed pages $ctx->{home_page} = 'http://' . $self->apache->hostname . $self->ctx->{opac_root} . "/home"; + $ctx->{logout_page} = 'https://' . $self->apache->hostname . $self->ctx->{opac_root} . "/logout"; if($e->authtoken($self->cgi->cookie('ses'))) { @@ -156,6 +159,10 @@ sub load_common { } else { + # For now, keep an eye out for any pages being unceremoniously redirected to logout... + $self->apache->log->info("loading " . $ctx->{path_info} . "; auth session " . + $e->authtoken . " no longer valid; redirecting to logout"); + return $self->load_logout; } } diff --git a/Open-ILS/web/templates/default/opac/parts/base.tt2 b/Open-ILS/web/templates/default/opac/parts/base.tt2 index 892cb2714a..2ff73d5b0f 100644 --- a/Open-ILS/web/templates/default/opac/parts/base.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/base.tt2 @@ -3,7 +3,7 @@ [% IF ctx.authtime %] - + [% END %] -- 2.11.0