version 1.160.6.26, 2013/09/29 06:55:58
|
version 1.160.6.27, 2013/10/16 23:57:49
|
Line 86 $dom,$settings,$rowtotal,$action.
|
Line 86 $dom,$settings,$rowtotal,$action.
|
|
|
$dom is the domain, $settings is a reference to a hash of current settings for |
$dom is the domain, $settings is a reference to a hash of current settings for |
the current context, $rowtotal is a reference to the scalar used to record the |
the current context, $rowtotal is a reference to the scalar used to record the |
number of rows displayed on the page, and $action is the context (quotas, |
number of rows displayed on the page, and $action is the context (quotas, |
requestcourses or requestauthor). |
requestcourses or requestauthor). |
|
|
The print_quotas routine was orginally created to display/store information |
The print_quotas routine was orginally created to display/store information |
Line 400 sub handler {
|
Line 400 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 498 sub process_changes {
|
Line 499 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 514 sub process_changes {
|
Line 515 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 522 sub process_changes {
|
Line 523 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 '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 772 sub print_config_box {
|
Line 773 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 3739 sub print_usermodification {
|
Line 3740 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 3766 sub print_defaults {
|
Line 3775 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 3775 sub print_defaults {
|
Line 3784 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 3791 sub print_defaults {
|
Line 3800 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 4960 sub modify_login {
|
Line 4969 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 5108 sub modify_rolecolors {
|
Line 5119 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 5789 sub check_switchserver {
|
Line 5802 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 5811 sub modify_quotas {
|
Line 5824 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 6010 sub modify_quotas {
|
Line 6023 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 6221 sub modify_autoenroll {
|
Line 6236 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 6779 sub modify_contacts {
|
Line 6796 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 6854 sub modify_usercreation {
|
Line 6873 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 7421 sub modify_usermodification {
|
Line 7440 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 7483 sub modify_defaults {
|
Line 7502 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 7506 sub modify_defaults {
|
Line 7525 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 7598 sub modify_scantron {
|
Line 7620 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 8022 sub modify_helpsettings {
|
Line 8046 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 8113 sub modify_coursedefaults {
|
Line 8137 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 8137 sub modify_coursedefaults {
|
Line 8160 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 8188 sub modify_coursedefaults {
|
Line 8214 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 8205 sub modify_usersessions {
|
Line 8231 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 8381 sub modify_usersessions {
|
Line 8407 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 8392 sub modify_usersessions {
|
Line 8421 sub modify_usersessions {
|
foreach my $lonhost (sort(keys(%{$changes{$prefix}}))) { |
foreach my $lonhost (sort(keys(%{$changes{$prefix}}))) { |
$resulttext .= '<li><b>'.$lonhost.'</b> '; |
$resulttext .= '<li><b>'.$lonhost.'</b> '; |
my $lonhostdom = &Apache::lonnet::host_domain($lonhost); |
my $lonhostdom = &Apache::lonnet::host_domain($lonhost); |
&Apache::lonnet::remote_devalidate_cache($lonhost,'spares',$lonhostdom); |
my $cachekey = &escape('spares').':'.&escape($lonhostdom); |
|
&Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]); |
if (ref($changes{$prefix}{$lonhost}) eq 'HASH') { |
if (ref($changes{$prefix}{$lonhost}) eq 'HASH') { |
foreach my $type (@{$types{$prefix}}) { |
foreach my $type (@{$types{$prefix}}) { |
if ($changes{$prefix}{$lonhost}{$type}) { |
if ($changes{$prefix}{$lonhost}{$type}) { |
Line 8579 sub modify_loadbalancing {
|
Line 8609 sub modify_loadbalancing {
|
if (ref($changes{'delete'}) eq 'ARRAY') { |
if (ref($changes{'delete'}) eq 'ARRAY') { |
foreach my $balancer (sort(@{$changes{'delete'}})) { |
foreach my $balancer (sort(@{$changes{'delete'}})) { |
$resulttext .= '<li>'.&mt('Load Balancing discontinued for: [_1]',$balancer).'</li>'; |
$resulttext .= '<li>'.&mt('Load Balancing discontinued for: [_1]',$balancer).'</li>'; |
&Apache::lonnet::remote_devalidate_cache($balancer,'loadbalancing',$dom); |
my $cachekey = &escape('loadbalancing').':'.&escape($dom); |
|
&Apache::lonnet::remote_devalidate_cache($balancer,[$cachekey]); |
} |
} |
} |
} |
if (ref($changes{'add'}) eq 'ARRAY') { |
if (ref($changes{'add'}) eq 'ARRAY') { |
Line 8635 sub modify_loadbalancing {
|
Line 8666 sub modify_loadbalancing {
|
} |
} |
} |
} |
} |
} |
&Apache::lonnet::remote_devalidate_cache($balancer,'loadbalancing',$dom); |
my $cachekey = &scape('loadbalancing').':'.&escape($dom); |
|
&Apache::lonnet::remote_devalidate_cache($balancer,[$cachekey]); |
} |
} |
} |
} |
if ($resulttext ne '') { |
if ($resulttext ne '') { |
Line 9357 sub captcha_phrases {
|
Line 9389 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}); |
&Apache::lonnet::remote_devalidate_cache($server,'domainconfig',$dom); |
my @cached; |
|
foreach my $name (@posscached) { |
|
if ($cachekeys->{$name}) { |
|
push(@cached,&escape($name).':'.&escape($dom)); |
|
} |
|
} |
|
if (@cached) { |
|
&Apache::lonnet::remote_devalidate_cache($server,\@cached); |
|
} |
} |
} |
} |
} |
return; |
return; |