--- loncom/interface/domainprefs.pm 2017/12/06 23:41:19 1.321
+++ loncom/interface/domainprefs.pm 2017/12/07 01:36:11 1.322
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.321 2017/12/06 23:41:19 raeburn Exp $
+# $Id: domainprefs.pm,v 1.322 2017/12/07 01:36:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4112,12 +4112,13 @@ sub print_ltitools {
for (my $i=0; $i<@items; $i++) {
$css_class = $itemcount%2?' class="LC_odd_row"':'';
my $item = $ordered{$items[$i]};
- my ($title,$key,$secret,$url,$imgsrc);
+ my ($title,$key,$secret,$url,$lifetime,$imgsrc);
if (ref($settings->{$item}) eq 'HASH') {
$title = $settings->{$item}->{'title'};
$url = $settings->{$item}->{'url'};
$key = $settings->{$item}->{'key'};
$secret = $settings->{$item}->{'secret'};
+ $lifetime = $settings->{$item}->{'lifetime'};
my $image = $settings->{$item}->{'image'};
if ($image ne '') {
$imgsrc = '';
@@ -4153,6 +4154,9 @@ sub print_ltitools {
''.$lt{'key'}.':'.
' '.
(' 'x2).
+ ''.$lt{'lifetime'}.':'.
+ ' '.
+ (' 'x2).
''.$lt{'secret'}.':'.
''.
''.
@@ -4353,6 +4357,8 @@ sub print_ltitools {
(' 'x2).
''.$lt{'key'}.': '."\n".
(' 'x2).
+ ''.$lt{'lifetime'}.': '."\n".
+ (' 'x2).
''.$lt{'secret'}.':'.
' '."\n".
''.
@@ -4382,7 +4388,7 @@ sub print_ltitools {
);
my %defaulttimes = (
'passback' => '7',
- 'roster' => '300',
+ 'roster' => '300',
);
foreach my $extra ('passback','roster') {
my $onclick = ' onclick="toggleLTITools(this.form,'."'$extra','add'".');"';
@@ -4453,6 +4459,7 @@ sub ltitools_names {
'msgtype' => 'Message Type',
'url' => 'URL',
'key' => 'Key',
+ 'lifetime' => 'Nonce lifetime (s)',
'secret' => 'Secret',
'icon' => 'Icon',
'user' => 'Username:domain',
@@ -4569,7 +4576,7 @@ sub print_lti {
''.$lt{'version'}.': '."\n".
(' 'x2).
- ''.$lt{'lifetime'}.': '."\n".
+ ''.$lt{'lifetime'}.': '."\n".
'
'.
''.$lt{'key'}.': '."\n".
(' 'x2).
@@ -4587,7 +4594,7 @@ sub lti_names {
'version' => 'LTI Version',
'url' => 'URL',
'key' => 'Key',
- 'lifetime' => 'Nonce lifetime (seconds)',
+ 'lifetime' => 'Nonce lifetime (s)',
'consumer' => 'LTI Consumer',
'secret' => 'Secret',
'email' => 'Email address',
@@ -10644,8 +10651,11 @@ sub modify_ltitools {
$allpos[$position] = $newid;
}
$changes{$newid} = 1;
- foreach my $item ('title','url','key','secret') {
+ foreach my $item ('title','url','key','secret','lifetime') {
$env{'form.ltitools_add_'.$item} =~ s/(`)/'/g;
+ if ($item eq 'lifetime') {
+ $env{'form.ltitools_add_'.$item} =~ s/[^\d.]//g;
+ }
if ($env{'form.ltitools_add_'.$item}) {
if (($item eq 'key') || ($item eq 'secret')) {
$encconfig{$newid}{$item} = $env{'form.ltitools_add_'.$item};
@@ -10768,7 +10778,7 @@ sub modify_ltitools {
} else {
my $newpos = $env{'form.ltitools_'.$itemid};
$newpos =~ s/\D+//g;
- foreach my $item ('title','url') {
+ foreach my $item ('title','url','lifetime') {
$confhash{$itemid}{$item} = $env{'form.ltitools_'.$item.'_'.$i};
if ($domconfig{$action}{$itemid}{$item} ne $confhash{$itemid}{$item}) {
$changes{$itemid} = 1;
@@ -11032,7 +11042,7 @@ sub modify_ltitools {
$resulttext .= '';
my $position = $pos + 1;
$resulttext .= '- '.&mt('Order: [_1]',$position).'
';
- foreach my $item ('version','msgtype','url') {
+ foreach my $item ('version','msgtype','url','lifetime') {
if ($confhash{$itemid}{$item} ne '') {
$resulttext .= '- '.$lt{$item}.': '.$confhash{$itemid}{$item}.'
';
}