--- loncom/interface/domainprefs.pm 2021/12/28 02:04:35 1.399
+++ loncom/interface/domainprefs.pm 2022/01/15 20:21:06 1.402
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.399 2021/12/28 02:04:35 raeburn Exp $
+# $Id: domainprefs.pm,v 1.402 2022/01/15 20:21:06 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).' '.$choices->{'alttext'}.':'.
+ ' '.
+ ' ';
+ }
$datatable .= ' ';
}
$itemcount ++;
@@ -3880,7 +3899,7 @@ sub print_autoenroll {
if (exists($settings->{'failsafe'})) {
$failsafe = $settings->{'failsafe'};
if ($failsafe eq 'zero') {
- $failsafechecked{'zero'} = ' checked="checked"';
+ $failsafechecked{'zero'} = ' checked="checked"';
$failsafechecked{'off'} = '';
$failsafesty = 'inline-block';
} elsif ($failsafe eq 'any') {
@@ -3893,7 +3912,7 @@ sub print_autoenroll {
if ($autofailsafe ne '') {
$failsafechecked{'zero'} = ' checked="checked"';
$failsafe = 'zero';
- $failsafechecked{'off'} = '';
+ $failsafechecked{'off'} = '';
}
}
} else {
@@ -3933,10 +3952,10 @@ sub print_autoenroll {
$coownersoff.' value="0" />'.&mt('No').''.
''.
''.&mt('Failsafe for no drops when institutional data missing').' '.
- ''.
- ' '.&mt('Not in use').' '.
- ' '.&mt('Retrieved section enrollment is zero').' '.
- ' '.&mt('Retrieved section enrollment is zero or greater').' '.
+ ' '.
+ ' '.&mt('Not in use').' '.
+ ' '.&mt('Retrieved section enrollment is zero').' '.
+ ' '.&mt('Retrieved section enrollment is zero or greater').' '.
''.
'
'.
&mt('Threshold for number of students in section to drop: [_1]',
@@ -12856,13 +12875,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 +12961,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 +13094,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 +13137,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 {
@@ -16000,7 +16050,7 @@ sub modify_autoenroll {
my $failsafe = $env{'form.autoenroll_failsafe'};
unless (($failsafe eq 'zero') || ($failsafe eq 'any')) {
$failsafe = 'off';
- undef($autofailsafe);
+ undef($autofailsafe);
}
my %autoenrollhash = (
autoenroll => { 'run' => $env{'form.autoenroll_run'},
@@ -16008,7 +16058,7 @@ sub modify_autoenroll {
'sender_domain' => $sender_domain,
'co-owners' => $coowners,
'autofailsafe' => $autofailsafe,
- 'failsafe' => $failsafe,
+ 'failsafe' => $failsafe,
}
);
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash,
@@ -21255,7 +21305,7 @@ sub modify_wafproxy {
}
}
$output = &mt('Changes were made to Web Application Firewall/Reverse Proxy').'';
- foreach my $item ('alias','remoteip','ipheader','trusted','vpnint','vpnext','sslopt') {
+ foreach my $item ('alias','saml','remoteip','ipheader','trusted','vpnint','vpnext','sslopt') {
if ($changes{$item}) {
if ($item eq 'alias') {
my $numaliased = 0;