--- loncom/interface/domainprefs.pm 2008/12/17 22:12:53 1.79 +++ loncom/interface/domainprefs.pm 2008/12/26 16:34:01 1.82 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.79 2008/12/17 22:12:53 raeburn Exp $ +# $Id: domainprefs.pm,v 1.82 2008/12/26 16:34:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,7 +39,7 @@ use Apache::lonlocal; use Apache::lonmsg(); use LONCAPA qw(:DEFAULT :match); use LONCAPA::Enrollment; -use LONCAPA::loncgi(); +use LONCAPA::lonauthcgi(); use File::Copy; use Locale::Language; use DateTime::TimeZone; @@ -2373,7 +2373,7 @@ sub print_serverstatuses { } } } - my $titles= &LONCAPA::loncgi::serverstatus_titles(); + my $titles= &LONCAPA::lonauthcgi::serverstatus_titles(); my $rownum = 0; my $css_class; foreach my $type (@pages) { @@ -3612,10 +3612,16 @@ sub modify_quotas { } $resulttext .= ''; } + my %newenv; foreach my $item (@usertools) { if (ref($changes{$item}) eq 'HASH') { - my $hashid = $env{'user.name'}.':'.$env{'user.domain'}; - &Apache::lonnet::devalidate_cache_new('usertools.'.$item,$hashid); + my $newacc = + &Apache::lonnet::usertools_access($env{'user.name'}, + $env{'user.domain'}, + $item,'reload'); + if ($env{'environment.availabletools.'.$item} ne $newacc) { + $newenv{'environment.availabletools.'.$item} = $newacc; + } $resulttext .= '
  • '.$titles{$item}.''; + if (keys(%newenv)) { + &Apache::lonnet::appenv(\%newenv); + } } else { $resulttext = &mt('No changes made to availability of home pages, blogs, portfolios or default quotas'); } @@ -4989,23 +4998,30 @@ sub modify_serverstatuses { } my @currmachines = split(/,/,$currserverstatus{$type}{'machines'}); my @newmachines = split(/,/,$newserverstatus{$type}{'machines'}); - foreach my $item (@currmachines) { - if (!grep(/^\Q$item\E$/,@newmachines)) { - $changes{$type}{'machines'} = 1; - last; - } - } - foreach my $item (@newmachines) { - if (!grep(/^\Q$item\E$/,@currmachines)) { + if (@currmachines > 0) { + if (@newmachines > 0) { + foreach my $item (@currmachines) { + if (!grep(/^\Q$item\E$/,@newmachines)) { + $changes{$type}{'machines'} = 1; + last; + } + } + foreach my $item (@newmachines) { + if (!grep(/^\Q$item\E$/,@currmachines)) { + $changes{$type}{'machines'} = 1; + last; + } + } + } else { $changes{$type}{'machines'} = 1; - last; } + } elsif (@newmachines > 0) { + $changes{$type}{'machines'} = 1; } - } } if (keys(%changes) > 0) { - my $titles= &LONCAPA::loncgi::serverstatus_titles(); + my $titles= &LONCAPA::lonauthcgi::serverstatus_titles(); my $putresult = &Apache::lonnet::put_dom('configuration', \%serverstatushash,$dom); if ($putresult eq 'ok') {