updated cstoreditor to fetch full cached object to get the authtime; capturing authti...
authorBill Erickson <erickson@esilibrary.com>
Mon, 14 Feb 2011 18:03:24 +0000 (13:03 -0500)
committerBill Erickson <erickson@esilibrary.com>
Mon, 14 Feb 2011 18:03:24 +0000 (13:03 -0500)
Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm

index ff298f4..03237ca 100644 (file)
@@ -115,11 +115,19 @@ sub log {
 sub checkauth {
        my $self = shift;
        $self->log(D, "checking auth token ".$self->authtoken);
-       my ($reqr, $evt) = $U->checkses($self->authtoken);
-       $self->event($evt) if $evt;
-       return $self->{requestor} = $reqr;
-}
 
+       my $content = $U->simplereq( 
+               'open-ils.auth', 
+               'open-ils.auth.session.retrieve', $self->authtoken, 1);
+
+    if(!$content or $U->event_code($content)) {
+        $self->event( ($content) ? $content : OpenILS::Event->new('NO_SESSION'));
+        return undef;
+    }
+
+    $self->{authtime} = $content->{authtime};
+       return $self->{requestor} = $content->{userobj};
+}
 
 =head test
 sub checkauth {
@@ -177,6 +185,12 @@ sub authtoken {
        return $self->{authtoken};
 }
 
+sub authtime {
+       my( $self, $auth ) = @_;
+       $self->{authtime} = $auth if $auth;
+       return $self->{authtime};
+}
+
 sub timeout {
     my($self, $to) = @_;
     $self->{timeout} = $to if defined $to;
index 99df8e7..89d616b 100644 (file)
@@ -144,8 +144,12 @@ sub load_common {
 
         if($e->checkauth) {
 
+            $self->apache->log->warn("authtime = " . $e->authtime);
+
             $ctx->{authtoken} = $e->authtoken;
+            $ctx->{authtime} = $e->authtime;
             $ctx->{user} = $e->requestor;
+
             $ctx->{user_stats} = $U->simplereq(
                 'open-ils.actor', 
                 'open-ils.actor.user.opac.vital_stats',