--- loncom/interface/domainprefs.pm 2021/12/30 02:39:01 1.401
+++ loncom/interface/domainprefs.pm 2022/02/06 21:36:59 1.404
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.401 2021/12/30 02:39:01 raeburn Exp $
+# $Id: domainprefs.pm,v 1.404 2022/02/06 21:36:59 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1357,6 +1357,7 @@ sub print_login {
}
}
my @images = ('img','logo','domlogo','login');
+ my @alttext = ('img','logo','domlogo');
my @logintext = ('textcol','bgcol');
my @bgs = ('pgbg','mainbg','sidebg');
my @links = ('link','alink','vlink');
@@ -1398,6 +1399,13 @@ sub print_login {
$designs{'showlogo'}{$item} = $settings->{'showlogo'}{$item};
}
}
+ foreach my $item (@alttext) {
+ if (ref($settings->{'alttext'}) eq 'HASH') {
+ if ($settings->{'alttext'}->{$item} ne '') {
+ $designs{'alttext'}{$item} = $settings->{'alttext'}{$item};
+ }
+ }
+ }
foreach my $item (@logintext) {
if ($settings->{$item} ne '') {
$designs{'logintext'}{$item} = $settings->{$item};
@@ -1707,6 +1715,7 @@ sub login_choices {
current => "Current",
samllanding => "Dual login?",
samloptions => "Options",
+ alttext => "Alt text",
);
return %choices;
}
@@ -2052,7 +2061,7 @@ sub display_color_options {
$css_class = $itemcount%2?' class="LC_odd_row"':'';
$datatable .= '
'.
''.$choices->{$img};
- my ($imgfile,$img_import,$login_hdr_pick,$logincolors);
+ my ($imgfile,$img_import,$login_hdr_pick,$logincolors,$alttext);
if ($role eq 'login') {
if ($img eq 'login') {
$login_hdr_pick =
@@ -2060,8 +2069,13 @@ sub display_color_options {
$logincolors =
&login_text_colors($img,$role,$logintext,$phase,$choices,
$designs,$defaults);
- } elsif ($img ne 'domlogo') {
- $datatable.= &logo_display_options($img,$defaults,$designs);
+ } else {
+ if ($img ne 'domlogo') {
+ $datatable.= &logo_display_options($img,$defaults,$designs);
+ }
+ if (ref($designs->{'alttext'}) eq 'HASH') {
+ $alttext = $designs->{'alttext'}{$img};
+ }
}
}
$datatable .= ' | ';
@@ -2153,6 +2167,11 @@ sub display_color_options {
$datatable .=' ';
}
}
+ if (($role eq 'login') && ($img ne 'login')) {
+ $datatable .= (' ' x2).' ';
+ }
$datatable .= '
';
}
$itemcount ++;
@@ -6844,6 +6863,7 @@ sub print_coursedefaults {
postsubmit => 'Disable submit button/keypress following student submission',
canclone => "People who may clone a course (besides course's owner and coordinators)",
mysqltables => 'Lifetime (s) of "Temporary" MySQL tables (student performance data) on homeserver',
+ ltiauth => 'Student username in LTI launch of deep-linked URL can be accepted without re-authentication',
);
my %staticdefaults = (
anonsurvey_threshold => 10,
@@ -6966,8 +6986,12 @@ sub print_coursedefaults {
my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout,%currmysql);
my $currusecredits = 0;
my $postsubmitclient = 1;
+ my $ltiauth = 0;
my @types = ('official','unofficial','community','textbook','placement');
if (ref($settings) eq 'HASH') {
+ if ($settings->{'ltiauth'}) {
+ $ltiauth = 1;
+ }
$currdefresponder = $settings->{'anonsurvey_threshold'};
if (ref($settings->{'uploadquota'}) eq 'HASH') {
foreach my $type (keys(%{$settings->{'uploadquota'}})) {
@@ -7113,7 +7137,16 @@ sub print_coursedefaults {
}
$datatable .= ''."\n";
$itemcount ++;
-
+ %defaultchecked = ('ltiauth' => 'off');
+ @toggles = ('ltiauth');
+ $current = {
+ 'ltiauth' => $ltiauth,
+ };
+ ($table,$itemcount) =
+ &radiobutton_prefs($current,\@toggles,\%defaultchecked,
+ \%choices,$itemcount,undef,undef,'left');
+ $datatable .= $table;
+ $itemcount ++;
}
$$rowtotal += $itemcount;
return $datatable;
@@ -12856,13 +12889,18 @@ sub modify_colors {
$domconfig->{$role} = {};
}
foreach my $img (@images) {
- if (($role eq 'login') && (($img eq 'img') || ($img eq 'logo'))) {
- if (defined($env{'form.login_showlogo_'.$img})) {
- $confhash->{$role}{'showlogo'}{$img} = 1;
- } else {
- $confhash->{$role}{'showlogo'}{$img} = 0;
+ if ($role eq 'login') {
+ if (($img eq 'img') || ($img eq 'logo')) {
+ if (defined($env{'form.login_showlogo_'.$img})) {
+ $confhash->{$role}{'showlogo'}{$img} = 1;
+ } else {
+ $confhash->{$role}{'showlogo'}{$img} = 0;
+ }
}
- }
+ if ($env{'form.login_alt_'.$img} ne '') {
+ $confhash->{$role}{'alttext'}{$img} = $env{'form.login_alt_'.$img};
+ }
+ }
if ( ! $env{'form.'.$role.'_'.$img.'.filename'}
&& !defined($domconfig->{$role}{$img})
&& !$env{'form.'.$role.'_del_'.$img}
@@ -12937,15 +12975,29 @@ sub modify_colors {
$changes{$role}{'images'}{$img} = 1;
}
}
- if (($role eq 'login') && (($img eq 'logo') || ($img eq 'img'))) {
- if (ref($domconfig->{'login'}{'showlogo'}) eq 'HASH') {
- if ($confhash->{$role}{'showlogo'}{$img} ne
- $domconfig->{$role}{'showlogo'}{$img}) {
- $changes{$role}{'showlogo'}{$img} = 1;
+ if ($role eq 'login') {
+ if (($img eq 'logo') || ($img eq 'img')) {
+ if (ref($domconfig->{'login'}{'showlogo'}) eq 'HASH') {
+ if ($confhash->{$role}{'showlogo'}{$img} ne
+ $domconfig->{$role}{'showlogo'}{$img}) {
+ $changes{$role}{'showlogo'}{$img} = 1;
+ }
+ } else {
+ if ($confhash->{$role}{'showlogo'}{$img} == 0) {
+ $changes{$role}{'showlogo'}{$img} = 1;
+ }
}
- } else {
- if ($confhash->{$role}{'showlogo'}{$img} == 0) {
- $changes{$role}{'showlogo'}{$img} = 1;
+ }
+ if ($img ne 'login') {
+ if (ref($domconfig->{$role}{'alttext'}) eq 'HASH') {
+ if ($confhash->{$role}{'alttext'}{$img} ne
+ $domconfig->{$role}{'alttext'}{$img}) {
+ $changes{$role}{'alttext'}{$img} = 1;
+ }
+ } else {
+ if ($confhash->{$role}{'alttext'}{$img} ne '') {
+ $changes{$role}{'alttext'}{$img} = 1;
+ }
}
}
}
@@ -13056,6 +13108,11 @@ sub default_change_checker {
if ($confhash->{$role}{'showlogo'}{$img} == 0) {
$changes->{$role}{'showlogo'}{$img} = 1;
}
+ if (ref($confhash->{$role}{'alttext'}) eq 'HASH') {
+ if ($confhash->{$role}{'alttext'}{$img} ne '') {
+ $changes->{$role}{'alttext'}{$img} = 1;
+ }
+ }
}
}
if ($confhash->{$role}{'font'}) {
@@ -13094,6 +13151,13 @@ sub display_colorchgs {
} else {
$resulttext .= ''.&mt("$choices{$item} set to not be displayed").'';
}
+ } elsif (($role eq 'login') && ($key eq 'alttext')) {
+ if ($confhash->{$role}{$key}{$item} ne '') {
+ $resulttext .= ''.&mt("$choices{$key} for $choices{$item} set to [_1].",
+ $confhash->{$role}{$key}{$item}).'';
+ } else {
+ $resulttext .= ''.&mt("$choices{$key} for $choices{$item} deleted.").'';
+ }
} elsif ($confhash->{$role}{$item} eq '') {
$resulttext .= ''.&mt("$choices{$item} set to default").'';
} else {
@@ -20397,8 +20461,9 @@ sub modify_coursedefaults {
'uselcmath' => 'on',
'usejsme' => 'on',
'inline_chem' => 'on',
+ 'ltiauth' => 'off',
);
- my @toggles = ('canuse_pdfforms','uselcmath','usejsme','inline_chem');
+ my @toggles = ('canuse_pdfforms','uselcmath','usejsme','inline_chem','ltiauth');
my @numbers = ('anonsurvey_threshold','uploadquota_official','uploadquota_unofficial',
'uploadquota_community','uploadquota_textbook','uploadquota_placement',
'mysqltables_official','mysqltables_unofficial','mysqltables_community',
@@ -20609,8 +20674,8 @@ sub modify_coursedefaults {
if (($changes{'canuse_pdfforms'}) || ($changes{'uploadquota'}) || ($changes{'postsubmit'}) ||
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) ||
($changes{'canclone'}) || ($changes{'mysqltables'}) || ($changes{'texengine'}) ||
- ($changes{'inline_chem'})) {
- foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine') {
+ ($changes{'inline_chem'}) || ($changes{'ltiauth'})) {
+ foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine','ltiauth') {
if ($changes{$item}) {
$domdefaults{$item}=$defaultshash{'coursedefaults'}{$item};
}
@@ -20784,6 +20849,12 @@ sub modify_coursedefaults {
} else {
$resulttext .= ''.&mt('By default, only course owner and coordinators may clone a course.').'';
}
+ } elsif ($item eq 'ltiauth') {
+ if ($env{'form.'.$item} eq '1') {
+ $resulttext .= ''.&mt('LTI launch of deep-linked URL need not require re-authentication').'';
+ } else {
+ $resulttext .= ''.&mt('LTI launch of deep-linked URL will require re-authentication').'';
+ }
}
}
$resulttext .= '';