From: Bill Erickson Date: Tue, 29 Sep 2015 21:50:31 +0000 (-0400) Subject: JBAS-886 remoteauth/ezproxy checks expire date X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=69cd782f5253758503d103f931114ada7f97079d;p=working%2FEvergreen.git JBAS-886 remoteauth/ezproxy checks expire date Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/remoteauth.cgi b/Open-ILS/examples/remoteauth.cgi index 94959d2325..675d3f9b28 100755 --- a/Open-ILS/examples/remoteauth.cgi +++ b/Open-ILS/examples/remoteauth.cgi @@ -26,6 +26,9 @@ use warnings; use CGI; use Digest::MD5 qw(md5_hex); +use DateTime; +use DateTime::Format::ISO8601; +use OpenSRF::Utils qw/:datetime/; use OpenSRF::System; use OpenSRF::AppSession; @@ -94,15 +97,26 @@ if (!($u || $usrname || $barcode) || !$p) { and $user->active eq 't' and $user->passwd eq md5_hex($p)) { - $e->requestor($user); - if ($e->allowed('ACCESS_EBOOKS_AND_DATABASES', $user->home_ou)) { + my $expire = + DateTime::Format::ISO8601->new->parse_datetime( + cleanse_ISO8601($user->expire_date)); - OpenILS::Application::AppUtils - ->log_user_activity($user->id, $agent, 'verify'); + if ($expire < DateTime->now) { + print '+NO'; - print '+VALID'; } else { - print '+NO'; + + $e->requestor($user); + if ($e->allowed('ACCESS_EBOOKS_AND_DATABASES', $user->home_ou)) { + + OpenILS::Application::AppUtils + ->log_user_activity($user->id, $agent, 'verify'); + + print '+VALID'; + + } else { + print '+NO'; + } } } else { print '+NO';