--- loncom/lti/ltiutils.pm 2018/08/12 02:24:42 1.13 +++ loncom/lti/ltiutils.pm 2018/08/14 17:24:21 1.14 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA LTI interactions # -# $Id: ltiutils.pm,v 1.13 2018/08/12 02:24:42 raeburn Exp $ +# $Id: ltiutils.pm,v 1.14 2018/08/14 17:24:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -276,7 +276,7 @@ sub verify_lis_item { my ($has_action, $valid_for); if ($context eq 'grade') { $has_action = $ltitools->{'passback'}; - $valid_for = $ltitools->{'passbackvalid'} + $valid_for = $ltitools->{'passbackvalid'} * 86400; # convert days to seconds } elsif ($context eq 'roster') { $has_action = $ltitools->{'roster'}; $valid_for = $ltitools->{'rostervalid'}; @@ -382,13 +382,13 @@ sub set_service_secret { my $warning; my ($needsnew,$oldsecret,$lifetime); if ($name eq 'grade') { - $lifetime = $ltitools->{'passbackvalid'} + $lifetime = $ltitools->{'passbackvalid'} * 86400; # convert days to seconds } elsif ($name eq 'roster') { $lifetime = $ltitools->{'rostervalid'}; } - if ($toolsettings->{$name} eq '') { + if ($toolsettings->{$name.'secret'} eq '') { $needsnew = 1; - } elsif (($toolsettings->{$name.'date'} + $lifetime) < $now) { + } elsif (($toolsettings->{$name.'secretdate'} + $lifetime) < $now) { $oldsecret = $toolsettings->{$name.'secret'}; $needsnew = 1; }