version 1.211, 2013/10/06 20:33:45
|
version 1.212, 2013/10/06 21:25:59
|
Line 416 sub handler {
|
Line 416 sub handler {
|
my $confname = $dom.'-domainconfig'; |
my $confname = $dom.'-domainconfig'; |
|
|
if ($phase eq 'process') { |
if ($phase eq 'process') { |
if (&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order, |
my $result = &Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order, |
\%prefs,\%domconfig,$confname,\@roles) eq 'update') { |
\%prefs,\%domconfig,$confname,\@roles); |
|
if (ref($result) eq 'HASH') { |
$r->rflush(); |
$r->rflush(); |
&devalidate_remote_domconfs($dom); |
&devalidate_remote_domconfs($dom,$result); |
} |
} |
} elsif ($phase eq 'display') { |
} elsif ($phase eq 'display') { |
my $js = &recaptcha_js(). |
my $js = &recaptcha_js(). |
Line 514 sub process_changes {
|
Line 515 sub process_changes {
|
$output = &modify_rolecolors($r,$dom,$confname,$roles, |
$output = &modify_rolecolors($r,$dom,$confname,$roles, |
$lastactref,%domconfig); |
$lastactref,%domconfig); |
} elsif ($action eq 'quotas') { |
} elsif ($action eq 'quotas') { |
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,$lastactref,%domconfig); |
} elsif ($action eq 'autoenroll') { |
} elsif ($action eq 'autoenroll') { |
$output = &modify_autoenroll($dom,$lastactref,%domconfig); |
$output = &modify_autoenroll($dom,$lastactref,%domconfig); |
} elsif ($action eq 'autoupdate') { |
} elsif ($action eq 'autoupdate') { |
Line 530 sub process_changes {
|
Line 531 sub process_changes {
|
} elsif ($action eq 'contacts') { |
} elsif ($action eq 'contacts') { |
$output = &modify_contacts($dom,$lastactref,%domconfig); |
$output = &modify_contacts($dom,$lastactref,%domconfig); |
} elsif ($action eq 'defaults') { |
} elsif ($action eq 'defaults') { |
$output = &modify_defaults($dom,$r,%domconfig); |
$output = &modify_defaults($dom,$lastactref,%domconfig); |
} elsif ($action eq 'scantron') { |
} elsif ($action eq 'scantron') { |
$output = &modify_scantron($r,$dom,$confname,$lastactref,%domconfig); |
$output = &modify_scantron($r,$dom,$confname,$lastactref,%domconfig); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
Line 538 sub process_changes {
|
Line 539 sub process_changes {
|
} elsif ($action eq 'serverstatuses') { |
} elsif ($action eq 'serverstatuses') { |
$output = &modify_serverstatuses($dom,%domconfig); |
$output = &modify_serverstatuses($dom,%domconfig); |
} elsif ($action eq 'requestcourses') { |
} elsif ($action eq 'requestcourses') { |
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,$lastactref,%domconfig); |
} elsif ($action eq 'requestauthor') { |
} elsif ($action eq 'requestauthor') { |
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,$lastactref,%domconfig); |
} elsif ($action eq 'helpsettings') { |
} elsif ($action eq 'helpsettings') { |
$output = &modify_helpsettings($r,$dom,$confname,%domconfig); |
$output = &modify_helpsettings($r,$dom,$confname,%domconfig); |
} elsif ($action eq 'coursedefaults') { |
} elsif ($action eq 'coursedefaults') { |
$output = &modify_coursedefaults($dom,%domconfig); |
$output = &modify_coursedefaults($dom,$lastactref,%domconfig); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
$output = &modify_usersessions($dom,%domconfig); |
$output = &modify_usersessions($dom,$lastactref,%domconfig); |
} elsif ($action eq 'loadbalancing') { |
} elsif ($action eq 'loadbalancing') { |
$output = &modify_loadbalancing($dom,%domconfig); |
$output = &modify_loadbalancing($dom,%domconfig); |
} |
} |
Line 794 sub print_config_box {
|
Line 795 sub print_config_box {
|
} elsif ($action eq 'contacts') { |
} elsif ($action eq 'contacts') { |
$output .= &print_contacts($dom,$settings,\$rowtotal); |
$output .= &print_contacts($dom,$settings,\$rowtotal); |
} elsif ($action eq 'defaults') { |
} elsif ($action eq 'defaults') { |
$output .= &print_defaults($dom,\$rowtotal); |
$output .= &print_defaults($dom,$settings,\$rowtotal); |
} elsif ($action eq 'scantron') { |
} elsif ($action eq 'scantron') { |
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'serverstatuses') { |
} elsif ($action eq 'serverstatuses') { |
Line 3759 sub print_usermodification {
|
Line 3760 sub print_usermodification {
|
} |
} |
|
|
sub print_defaults { |
sub print_defaults { |
my ($dom,$rowtotal) = @_; |
my ($dom,$settings,$rowtotal) = @_; |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', |
'datelocale_def','portal_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 $titles = &defaults_titles($dom); |
my $rownum = 0; |
my $rownum = 0; |
my ($datatable,$css_class); |
my ($datatable,$css_class); |
Line 3786 sub print_defaults {
|
Line 3795 sub print_defaults {
|
my %authnames = &authtype_names(); |
my %authnames = &authtype_names(); |
foreach my $auth (@authtypes) { |
foreach my $auth (@authtypes) { |
my $checked = ' '; |
my $checked = ' '; |
if ($domdefaults{$item} eq $auth) { |
if ($defaults{$item} eq $auth) { |
$checked = ' checked="checked" '; |
$checked = ' checked="checked" '; |
} |
} |
$datatable .= '<label><input type="radio" name="'.$item. |
$datatable .= '<label><input type="radio" name="'.$item. |
Line 3795 sub print_defaults {
|
Line 3804 sub print_defaults {
|
} |
} |
} elsif ($item eq 'timezone_def') { |
} elsif ($item eq 'timezone_def') { |
my $includeempty = 1; |
my $includeempty = 1; |
$datatable .= &Apache::loncommon::select_timezone($item,$domdefaults{$item},undef,$includeempty); |
$datatable .= &Apache::loncommon::select_timezone($item,$defaults{$item},undef,$includeempty); |
} elsif ($item eq 'datelocale_def') { |
} elsif ($item eq 'datelocale_def') { |
my $includeempty = 1; |
my $includeempty = 1; |
$datatable .= &Apache::loncommon::select_datelocale($item,$domdefaults{$item},undef,$includeempty); |
$datatable .= &Apache::loncommon::select_datelocale($item,$defaults{$item},undef,$includeempty); |
} elsif ($item eq 'lang_def') { |
} elsif ($item eq 'lang_def') { |
my %langchoices = &get_languages_hash(); |
my %langchoices = &get_languages_hash(); |
$langchoices{''} = 'No language preference'; |
$langchoices{''} = 'No language preference'; |
%langchoices = &Apache::lonlocal::texthash(%langchoices); |
%langchoices = &Apache::lonlocal::texthash(%langchoices); |
$datatable .= &Apache::loncommon::select_form($domdefaults{$item},$item, |
$datatable .= &Apache::loncommon::select_form($defaults{$item},$item, |
\%langchoices); |
\%langchoices); |
} else { |
} else { |
my $size; |
my $size; |
Line 3811 sub print_defaults {
|
Line 3820 sub print_defaults {
|
$size = ' size="25"'; |
$size = ' size="25"'; |
} |
} |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$domdefaults{$item}.'"'.$size.' />'; |
$defaults{$item}.'"'.$size.' />'; |
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$rownum ++; |
$rownum ++; |
Line 4980 sub modify_login {
|
Line 4989 sub modify_login {
|
} |
} |
if (keys(%changes) > 0 || $colchgtext) { |
if (keys(%changes) > 0 || $colchgtext) { |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
$$lastactref = 'update'; |
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domainconfig'} = 1; |
|
} |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $item (sort(keys(%changes))) { |
foreach my $item (sort(keys(%changes))) { |
if ($item eq 'loginvia') { |
if ($item eq 'loginvia') { |
Line 5128 sub modify_rolecolors {
|
Line 5139 sub modify_rolecolors {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
$$lastactref = 'update'; |
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domainconfig'} = 1; |
|
} |
$resulttext = &display_colorchgs($dom,\%changes,$roles, |
$resulttext = &display_colorchgs($dom,\%changes,$roles, |
$rolehash{'rolecolors'}); |
$rolehash{'rolecolors'}); |
} else { |
} else { |
Line 5809 sub check_switchserver {
|
Line 5822 sub check_switchserver {
|
} |
} |
|
|
sub modify_quotas { |
sub modify_quotas { |
my ($dom,$action,%domconfig) = @_; |
my ($dom,$action,$lastactref,%domconfig) = @_; |
my ($context,@usertools,@options,%validations,%titles,%confhash,%toolshash, |
my ($context,@usertools,@options,%validations,%titles,%confhash,%toolshash, |
%limithash,$toolregexp,%conditions,$resulttext,%changes); |
%limithash,$toolregexp,%conditions,$resulttext,%changes); |
if ($action eq 'quotas') { |
if ($action eq 'quotas') { |
Line 5831 sub modify_quotas {
|
Line 5844 sub modify_quotas {
|
@usertools = ('aboutme','blog','webdav','portfolio'); |
@usertools = ('aboutme','blog','webdav','portfolio'); |
%titles = &tool_titles(); |
%titles = &tool_titles(); |
} |
} |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
Line 6030 sub modify_quotas {
|
Line 6043 sub modify_quotas {
|
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
unless (($context eq 'requestcourses') || |
unless (($context eq 'requestcourses') || |
($context eq 'requestauthor')) { |
($context eq 'requestauthor')) { |
Line 6241 sub modify_autoenroll {
|
Line 6256 sub modify_autoenroll {
|
if ($changes{'coowners'}) { |
if ($changes{'coowners'}) { |
$resulttext .= '<li>'.&mt("$title{'coowners'} set to $offon[$env{'form.autoassign_coowners'}]").'</li>'; |
$resulttext .= '<li>'.&mt("$title{'coowners'} set to $offon[$env{'form.autoassign_coowners'}]").'</li>'; |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
$$lastactref = 'update'; |
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domainconfig'} = 1; |
|
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
Line 6799 sub modify_contacts {
|
Line 6816 sub modify_contacts {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
$$lastactref = 'update'; |
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domainconfig'} = 1; |
|
} |
my ($titles,$short_titles) = &contact_titles(); |
my ($titles,$short_titles) = &contact_titles(); |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
Line 6874 sub modify_usercreation {
|
Line 6893 sub modify_usercreation {
|
foreach my $item(@contexts) { |
foreach my $item(@contexts) { |
if ($item eq 'selfcreate') { |
if ($item eq 'selfcreate') { |
@{$cancreate{$item}} = &Apache::loncommon::get_env_multiple('form.can_createuser_'.$item); |
@{$cancreate{$item}} = &Apache::loncommon::get_env_multiple('form.can_createuser_'.$item); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
if (!((($domdefaults{'auth_def'} =~/^krb/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth'))) { |
if (!((($domdefaults{'auth_def'} =~/^krb/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth'))) { |
if (ref($cancreate{$item}) eq 'ARRAY') { |
if (ref($cancreate{$item}) eq 'ARRAY') { |
if (grep(/^login$/,@{$cancreate{$item}})) { |
if (grep(/^login$/,@{$cancreate{$item}})) { |
Line 7441 sub modify_usermodification {
|
Line 7460 sub modify_usermodification {
|
} |
} |
|
|
sub modify_defaults { |
sub modify_defaults { |
my ($dom,$r,%domconfig) = @_; |
my ($dom,$lastactref,%domconfig) = @_; |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def'); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def'); |
my @authtypes = ('internal','krb4','krb5','localauth'); |
my @authtypes = ('internal','krb4','krb5','localauth'); |
foreach my $item (@items) { |
foreach my $item (@items) { |
Line 7503 sub modify_defaults {
|
Line 7522 sub modify_defaults {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
my $version = $r->dir_config('lonVersion'); |
my $version = &Apache::lonnet::get_server_loncaparev($dom); |
my $mailmsgtext = "Changes made to domain settings in a LON-CAPA installation - domain: $dom (running version: $version) - dns_domain.tab needs to be updated with the following changes, to support legacy 2.4, 2.5 and 2.6 versions of LON-CAPA.\n\n"; |
my $mailmsgtext = "Changes made to domain settings in a LON-CAPA installation - domain: $dom (running version: $version) - dns_domain.tab needs to be updated with the following changes, to support legacy 2.4, 2.5 and 2.6 versions of LON-CAPA.\n\n"; |
foreach my $item (sort(keys(%changes))) { |
foreach my $item (sort(keys(%changes))) { |
my $value = $env{'form.'.$item}; |
my $value = $env{'form.'.$item}; |
Line 7526 sub modify_defaults {
|
Line 7545 sub modify_defaults {
|
$mailmsgtext .= "\n"; |
$mailmsgtext .= "\n"; |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'} || $changes{'datelocale_def'}) { |
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'} || $changes{'datelocale_def'}) { |
my $notify = 1; |
my $notify = 1; |
if (ref($domconfig{'contacts'}) eq 'HASH') { |
if (ref($domconfig{'contacts'}) eq 'HASH') { |
Line 7618 sub modify_scantron {
|
Line 7640 sub modify_scantron {
|
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
$$lastactref = 'update'; |
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domainconfig'} = 1; |
|
} |
} else { |
} else { |
$resulttext = &mt('No changes made to bubblesheet format file'); |
$resulttext = &mt('No changes made to bubblesheet format file'); |
} |
} |
Line 8042 sub modify_helpsettings {
|
Line 8066 sub modify_helpsettings {
|
} |
} |
|
|
sub modify_coursedefaults { |
sub modify_coursedefaults { |
my ($dom,%domconfig) = @_; |
my ($dom,$lastactref,%domconfig) = @_; |
my ($resulttext,$errors,%changes,%defaultshash); |
my ($resulttext,$errors,%changes,%defaultshash); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my @toggles = ('canuse_pdfforms'); |
my @toggles = ('canuse_pdfforms'); |
Line 8133 sub modify_coursedefaults {
|
Line 8157 sub modify_coursedefaults {
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
$dom); |
$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
my %domdefaults; |
|
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'}) || ($changes{'uploadquota'})) { |
if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'}) || ($changes{'uploadquota'})) { |
%domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
|
if ($changes{'canuse_pdfforms'}) { |
if ($changes{'canuse_pdfforms'}) { |
$domdefaults{'canuse_pdfforms'}=$defaultshash{'coursedefaults'}{'canuse_pdfforms'}; |
$domdefaults{'canuse_pdfforms'}=$defaultshash{'coursedefaults'}{'canuse_pdfforms'}; |
} |
} |
Line 8157 sub modify_coursedefaults {
|
Line 8180 sub modify_coursedefaults {
|
} |
} |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
} |
} |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $item (sort(keys(%changes))) { |
foreach my $item (sort(keys(%changes))) { |
Line 8208 sub modify_coursedefaults {
|
Line 8234 sub modify_coursedefaults {
|
} |
} |
|
|
sub modify_usersessions { |
sub modify_usersessions { |
my ($dom,%domconfig) = @_; |
my ($dom,$lastactref,%domconfig) = @_; |
my @hostingtypes = ('version','excludedomain','includedomain'); |
my @hostingtypes = ('version','excludedomain','includedomain'); |
my @offloadtypes = ('primary','default'); |
my @offloadtypes = ('primary','default'); |
my %types = ( |
my %types = ( |
Line 8225 sub modify_usersessions {
|
Line 8251 sub modify_usersessions {
|
foreach my $prefix (@prefixes) { |
foreach my $prefix (@prefixes) { |
$defaultshash{'usersessions'}{$prefix} = {}; |
$defaultshash{'usersessions'}{$prefix} = {}; |
} |
} |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
my $resulttext; |
my $resulttext; |
my %iphost = &Apache::lonnet::get_iphost(); |
my %iphost = &Apache::lonnet::get_iphost(); |
foreach my $prefix (@prefixes) { |
foreach my $prefix (@prefixes) { |
Line 8401 sub modify_usersessions {
|
Line 8427 sub modify_usersessions {
|
} |
} |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my %lt = &usersession_titles(); |
my %lt = &usersession_titles(); |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
Line 9380 sub captcha_phrases {
|
Line 9409 sub captcha_phrases {
|
} |
} |
|
|
sub devalidate_remote_domconfs { |
sub devalidate_remote_domconfs { |
my ($dom) = @_; |
my ($dom,$cachekeys) = @_; |
my $primary_id = &Apache::lonnet::domain($dom,'primary'); |
return unless (ref($cachekeys) eq 'HASH'); |
my $intdom = &Apache::lonnet::internet_dom($primary_id); |
|
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %thismachine; |
my %thismachine; |
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
|
my @posscached = ('domainconfig','domdefaults'); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
foreach my $server (keys(%servers)) { |
foreach my $server (keys(%servers)) { |
next if ($thismachine{$server}); |
next if ($thismachine{$server}); |
my $cachekey = &escape('domainconfig').':'.&escape($dom); |
my @cached; |
&Apache::lonnet::remote_devalidate_cache($server,[$cachekey]); |
foreach my $name (@posscached) { |
|
if ($cachekeys->{$name}) { |
|
push(@cached,&escape($name).':'.&escape($dom)); |
|
} |
|
} |
|
if (@cached) { |
|
&Apache::lonnet::remote_devalidate_cache($server,\@cached); |
|
} |
} |
} |
} |
} |
return; |
return; |