--- loncom/interface/lonconfigsettings.pm 2020/10/25 19:10:26 1.21.4.11.2.1 +++ loncom/interface/lonconfigsettings.pm 2021/12/13 20:09:54 1.21.4.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.21.4.11.2.1 2020/10/25 19:10:26 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.21.4.12 2021/12/13 20:09:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,7 +39,7 @@ use Apache::courseclassifier(); use LONCAPA qw(:DEFAULT :match); sub print_header { - my ($r,$phase,$context,$jscript,$container,$instcode,$dom,$values) = @_; + my ($r,$phase,$context,$jscript,$container,$instcode,$dom) = @_; my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check, $crstype,@actions,@code_order); if ($phase eq 'display') { @@ -214,20 +214,21 @@ $jscript my $optionsprefix = 'LC_options_helpdesk_'; $onload .= "toggleHelpdeskRow(document.display,'overrides','$customclass','$optionsprefix');"; } - if (grep(/^ltitools$/,@actions)) { - $onload .= "toggleLTITools(document.display,'user','add');"; - if (ref($values) eq 'HASH') { - if (ref($values->{'ltitools'}) eq 'HASH') { - my $numltitools = scalar(keys(%{$values->{'ltitools'}})); - for (my $i=0; $i<$numltitools; $i++) { - $onload .= "toggleLTITools(document.display,'user','$i');"; - } - } - } + if (grep(/^wafproxy$/,@actions)) { + $onload .= "toggleWAF();checkWAF();updateWAF();"; } if (grep(/^scantron$/,@actions)) { $onload .= "toggleScantron('document.display');"; } + if (grep(/^autoupdate$/,@actions)) { + $onload .= "toggleLastActiveDays('document.display');"; + } + if (grep(/^login$/,@actions)) { + my %domservers = &Apache::lonnet::get_servers($dom); + foreach my $server (sort(keys(%domservers))) { + $onload .= "toggleSamlOptions(document.display,'$server');"; + } + } if ($onload) { my %loaditems = ( 'onload' => $onload, @@ -314,7 +315,7 @@ sub make_changes { {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Updated"}); &print_header($r,$phase,$context,undef,$container); - my ($crstype,%lastact); + my ($crstype,%lastact,$errors); if ($context eq 'course') { $crstype = &Apache::loncommon::course_type(); } @@ -328,9 +329,10 @@ sub make_changes { $confname,$item,$roles,$values,\%lastact)); } else { $changes{$item} = {}; - &Apache::courseprefs::process_changes($dom,$item,$values, - $prefs->{$item},$changes{$item}, - $allitems,\%disallowed,$crstype); + $errors = + &Apache::courseprefs::process_changes($dom,$item,$values, + $prefs->{$item},$changes{$item}, + $allitems,\%disallowed,$crstype); if (keys(%{$changes{$item}}) > 0) { $numchanged ++; } @@ -362,6 +364,9 @@ sub make_changes { } $r->print('

'); } + if ($errors) { + $r->print('

'.$errors.'

'); + } } $r->print('

'); my $footer_text = 'Back to configuration display'; @@ -385,7 +390,7 @@ sub display_settings { if (ref($values) eq 'HASH') { $instcode = $values->{'internal.coursecode'}; } - &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom,$values); + &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom); my $divwidth = 900; if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { if (@actions > 0) { @@ -512,8 +517,8 @@ sub display_choices { $thirddiv = 1; } } - $r->print('
'); } + $r->print('

'); $r->print(&print_footer($r,$phase,'display','Display',undef,$container,$parm_permission)); $r->print(''); $r->print(&Apache::loncommon::end_page());