when authenticated, force the page to redirect the home page after the auth time...
authorBill Erickson <erickson@esilibrary.com>
Mon, 14 Feb 2011 18:31:50 +0000 (13:31 -0500)
committerBill Erickson <erickson@esilibrary.com>
Mon, 14 Feb 2011 18:31:50 +0000 (13:31 -0500)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/web/templates/default/opac/parts/base.tt2

index 89d616b..a7fc0a7 100644 (file)
@@ -139,13 +139,12 @@ 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');
+    $ctx->{home_page} = 'http://' . $self->apache->hostname . $self->ctx->{opac_root} . "/home";
 
     if($e->authtoken($self->cgi->cookie('ses'))) {
 
         if($e->checkauth) {
 
-            $self->apache->log->warn("authtime = " . $e->authtime);
-
             $ctx->{authtoken} = $e->authtoken;
             $ctx->{authtime} = $e->authtime;
             $ctx->{user} = $e->requestor;
@@ -234,11 +233,9 @@ sub load_login {
 sub load_logout {
     my $self = shift;
 
-    my $url = 'http://' . $self->apache->hostname . $self->ctx->{opac_root} . "/home";
-
     $self->apache->print(
         $self->cgi->redirect(
-            -url => $url,
+            -url => $self->ctx->{home_page},
             -cookie => $self->cgi->cookie(
                 -name => 'ses',
                 -path => '/',
index 27652a5..c83cb88 100644 (file)
@@ -2,6 +2,9 @@
 <html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.locale %]' xml:lang='[% ctx.locale %]'>
     <head>
         <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+        [% IF ctx.authtime %]
+        <meta http-equiv="refresh" content="[% ctx.authtime %];[% ctx.home_page %]">
+        [% END %]
         <link rel="stylesheet" type="text/css"
             href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css" />
         <link rel="stylesheet" type="text/css"