--- loncom/interface/domainprefs.pm 2013/10/06 20:33:45 1.211 +++ loncom/interface/domainprefs.pm 2013/10/06 21:25:59 1.212 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.211 2013/10/06 20:33:45 raeburn Exp $ +# $Id: domainprefs.pm,v 1.212 2013/10/06 21:25:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -416,10 +416,11 @@ sub handler { my $confname = $dom.'-domainconfig'; if ($phase eq 'process') { - if (&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order, - \%prefs,\%domconfig,$confname,\@roles) eq 'update') { + my $result = &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order, + \%prefs,\%domconfig,$confname,\@roles); + if (ref($result) eq 'HASH') { $r->rflush(); - &devalidate_remote_domconfs($dom); + &devalidate_remote_domconfs($dom,$result); } } elsif ($phase eq 'display') { my $js = &recaptcha_js(). @@ -514,7 +515,7 @@ sub process_changes { $output = &modify_rolecolors($r,$dom,$confname,$roles, $lastactref,%domconfig); } elsif ($action eq 'quotas') { - $output = &modify_quotas($dom,$action,%domconfig); + $output = &modify_quotas($dom,$action,$lastactref,%domconfig); } elsif ($action eq 'autoenroll') { $output = &modify_autoenroll($dom,$lastactref,%domconfig); } elsif ($action eq 'autoupdate') { @@ -530,7 +531,7 @@ sub process_changes { } elsif ($action eq 'contacts') { $output = &modify_contacts($dom,$lastactref,%domconfig); } elsif ($action eq 'defaults') { - $output = &modify_defaults($dom,$r,%domconfig); + $output = &modify_defaults($dom,$lastactref,%domconfig); } elsif ($action eq 'scantron') { $output = &modify_scantron($r,$dom,$confname,$lastactref,%domconfig); } elsif ($action eq 'coursecategories') { @@ -538,15 +539,15 @@ sub process_changes { } elsif ($action eq 'serverstatuses') { $output = &modify_serverstatuses($dom,%domconfig); } elsif ($action eq 'requestcourses') { - $output = &modify_quotas($dom,$action,%domconfig); + $output = &modify_quotas($dom,$action,$lastactref,%domconfig); } elsif ($action eq 'requestauthor') { - $output = &modify_quotas($dom,$action,%domconfig); + $output = &modify_quotas($dom,$action,$lastactref,%domconfig); } elsif ($action eq 'helpsettings') { $output = &modify_helpsettings($r,$dom,$confname,%domconfig); } elsif ($action eq 'coursedefaults') { - $output = &modify_coursedefaults($dom,%domconfig); + $output = &modify_coursedefaults($dom,$lastactref,%domconfig); } elsif ($action eq 'usersessions') { - $output = &modify_usersessions($dom,%domconfig); + $output = &modify_usersessions($dom,$lastactref,%domconfig); } elsif ($action eq 'loadbalancing') { $output = &modify_loadbalancing($dom,%domconfig); } @@ -794,7 +795,7 @@ sub print_config_box { } elsif ($action eq 'contacts') { $output .= &print_contacts($dom,$settings,\$rowtotal); } elsif ($action eq 'defaults') { - $output .= &print_defaults($dom,\$rowtotal); + $output .= &print_defaults($dom,$settings,\$rowtotal); } elsif ($action eq 'scantron') { $output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); } elsif ($action eq 'serverstatuses') { @@ -3759,10 +3760,18 @@ sub print_usermodification { } sub print_defaults { - my ($dom,$rowtotal) = @_; + my ($dom,$settings,$rowtotal) = @_; my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', 'datelocale_def','portal_def'); - my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); + my %defaults; + if (ref($settings) eq 'HASH') { + %defaults = %{$settings}; + } else { + my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); + foreach my $item (@items) { + $defaults{$item} = $domdefaults{$item}; + } + } my $titles = &defaults_titles($dom); my $rownum = 0; my ($datatable,$css_class); @@ -3786,7 +3795,7 @@ sub print_defaults { my %authnames = &authtype_names(); foreach my $auth (@authtypes) { my $checked = ' '; - if ($domdefaults{$item} eq $auth) { + if ($defaults{$item} eq $auth) { $checked = ' checked="checked" '; } $datatable .= '