'."\n".
''.$pubtext.' '."\n".
@@ -3740,18 +3746,10 @@ sub print_usermodification {
}
sub print_defaults {
- my ($dom,$settings,$rowtotal) = @_;
+ my ($dom,$rowtotal) = @_;
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def',
'datelocale_def','portal_def');
- 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 %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my $titles = &defaults_titles($dom);
my $rownum = 0;
my ($datatable,$css_class);
@@ -3775,7 +3773,7 @@ sub print_defaults {
my %authnames = &authtype_names();
foreach my $auth (@authtypes) {
my $checked = ' ';
- if ($defaults{$item} eq $auth) {
+ if ($domdefaults{$item} eq $auth) {
$checked = ' checked="checked" ';
}
$datatable .= '
';
$rownum ++;
@@ -4439,7 +4437,7 @@ sub build_category_rows {
if (ref($cats->[$depth]{$parent}) eq 'ARRAY') {
my $numchildren = @{$cats->[$depth]{$parent}};
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
- $text .= '
';
+ $text .= '
';
my ($idxnum,$parent_name,$parent_item);
my $higher = $depth - 1;
if ($higher == 0) {
@@ -4731,7 +4729,7 @@ sub usertype_update_row {
}
sub modify_login {
- my ($r,$dom,$confname,$lastactref,%domconfig) = @_;
+ my ($r,$dom,$confname,%domconfig) = @_;
my ($resulttext,$errors,$colchgtext,%changes,%colchanges,%newfile,%newurl,
%curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon);
%title = ( coursecatalog => 'Display course catalog',
@@ -4911,7 +4909,7 @@ sub modify_login {
} else {
my $puberror = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",$newfile{$lang},$result);
$errors .= '
'.$puberror.'
';
- if ((grep(/^\Q$lang\E$/,@currlangs)) &&
+ if ((grep(/^\Q$lang\E$/,@currlangs)) &&
(!grep(/^\Q$lang\E$/,@delurls))) {
$loginhash{'login'}{'helpurl'}{$lang} = $domconfig{'login'}{'helpurl'}{$lang};
@@ -4969,9 +4967,6 @@ sub modify_login {
}
if (keys(%changes) > 0 || $colchgtext) {
&Apache::loncommon::devalidate_domconfig_cache($dom);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domainconfig'} = 1;
- }
$resulttext = &mt('Changes made:').'
';
foreach my $item (sort(keys(%changes))) {
if ($item eq 'loginvia') {
@@ -5031,7 +5026,7 @@ sub modify_login {
}
} elsif ($item eq 'captcha') {
if (ref($loginhash{'login'}) eq 'HASH') {
- my $chgtxt;
+ my $chgtxt;
if ($loginhash{'login'}{$item} eq 'notused') {
$chgtxt .= &mt('No CAPTCHA validation in use for helpdesk form.');
} else {
@@ -5104,7 +5099,7 @@ sub color_font_choices {
}
sub modify_rolecolors {
- my ($r,$dom,$confname,$roles,$lastactref,%domconfig) = @_;
+ my ($r,$dom,$confname,$roles,%domconfig) = @_;
my ($resulttext,%rolehash);
$rolehash{'rolecolors'} = {};
if (ref($domconfig{'rolecolors'}) ne 'HASH') {
@@ -5119,9 +5114,6 @@ sub modify_rolecolors {
if ($putresult eq 'ok') {
if (keys(%changes) > 0) {
&Apache::loncommon::devalidate_domconfig_cache($dom);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domainconfig'} = 1;
- }
$resulttext = &display_colorchgs($dom,\%changes,$roles,
$rolehash{'rolecolors'});
} else {
@@ -5533,7 +5525,7 @@ sub publishlogo {
# See if there is anything left
unless ($fname) { return ('error: no uploaded file'); }
$fname="$subdir/$fname";
- my $docroot=$r->dir_config('lonDocRoot');
+ my $docroot=$r->dir_config('lonDocRoot');
my $filepath="$docroot/priv";
my $relpath = "$dom/$confname";
my ($fnamepath,$file,$fetchthumb);
@@ -5553,7 +5545,7 @@ sub publishlogo {
if ($file=~/\.(\w+)$/ &&
(&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
$output =
- &mt('Invalid file extension ([_1]) - reserved for internal use.',$1);
+ &mt('Invalid file extension ([_1]) - reserved for LONCAPA use.',$1);
} elsif ($file=~/\.(\w+)$/ &&
!defined(&Apache::loncommon::fileembstyle($1))) {
$output = &mt('Unrecognized file extension ([_1]) - rename the file with a proper extension and re-upload.',$1);
@@ -5802,7 +5794,7 @@ sub check_switchserver {
}
sub modify_quotas {
- my ($dom,$action,$lastactref,%domconfig) = @_;
+ my ($dom,$action,%domconfig) = @_;
my ($context,@usertools,@options,%validations,%titles,%confhash,%toolshash,
%limithash,$toolregexp,%conditions,$resulttext,%changes);
if ($action eq 'quotas') {
@@ -5824,7 +5816,7 @@ sub modify_quotas {
@usertools = ('aboutme','blog','webdav','portfolio');
%titles = &tool_titles();
}
- my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
foreach my $key (keys(%env)) {
if ($context eq 'requestcourses') {
@@ -6023,11 +6015,9 @@ sub modify_quotas {
if (keys(%changes) > 0) {
my $cachetime = 24*60*60;
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domdefaults'} = 1;
- }
+
$resulttext = &mt('Changes made:').'
'.
&mt("Users from domain '[_1]' permitted to search the institutional directory set to: [_2]",
''.$dom.'',$chgtext).
@@ -6690,7 +6677,7 @@ sub modify_directorysrch {
}
sub modify_contacts {
- my ($dom,$lastactref,%domconfig) = @_;
+ my ($dom,%domconfig) = @_;
my ($resulttext,%currsetting,%newsetting,%changes,%contacts_hash);
if (ref($domconfig{'contacts'}) eq 'HASH') {
foreach my $key (keys(%{$domconfig{'contacts'}})) {
@@ -6795,10 +6782,6 @@ sub modify_contacts {
$dom);
if ($putresult eq 'ok') {
if (keys(%changes) > 0) {
- &Apache::loncommon::devalidate_domconfig_cache($dom);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domainconfig'} = 1;
- }
my ($titles,$short_titles) = &contact_titles();
$resulttext = &mt('Changes made:').'
';
foreach my $item (@contacts) {
@@ -6873,7 +6856,7 @@ sub modify_usercreation {
foreach my $item(@contexts) {
if ($item eq 'selfcreate') {
@{$cancreate{$item}} = &Apache::loncommon::get_env_multiple('form.can_createuser_'.$item);
- my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
if (!((($domdefaults{'auth_def'} =~/^krb/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth'))) {
if (ref($cancreate{$item}) eq 'ARRAY') {
if (grep(/^login$/,@{$cancreate{$item}})) {
@@ -7146,7 +7129,7 @@ sub modify_usercreation {
if ($captchas{$cancreate{$type}}) {
$chgtext .= &mt("Validation for self-creation screen set to $captchas{$cancreate{$type}}.");
} else {
- $chgtext .= &mt('Validation for self-creation screen set to unknown type.');
+ $chgtext .= &mt('Validation for self-creation screen set to unknown type.');
}
}
} elsif ($type eq 'recaptchakeys') {
@@ -7274,7 +7257,7 @@ sub process_captcha {
$newsettings->{'captcha'} = 'original';
}
if ($current->{'captcha'} ne $newsettings->{'captcha'}) {
- if ($container eq 'cancreate') {
+ if ($container eq 'cancreate') {
if (ref($changes->{'cancreate'}) eq 'ARRAY') {
push(@{$changes->{'cancreate'}},'captcha');
} elsif (!defined($changes->{'cancreate'})) {
@@ -7313,7 +7296,7 @@ sub process_captcha {
$changes->{'cancreate'} = ['recaptchakeys'];
}
} else {
- $changes->{'recaptchakeys'} = 1;
+ $changes->{'recaptchakeys'} = 1;
}
}
return;
@@ -7440,9 +7423,9 @@ sub modify_usermodification {
}
sub modify_defaults {
- my ($dom,$lastactref,%domconfig) = @_;
+ my ($dom,$r,%domconfig) = @_;
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors);
- my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def');
my @authtypes = ('internal','krb4','krb5','localauth');
foreach my $item (@items) {
@@ -7502,7 +7485,7 @@ sub modify_defaults {
if ($putresult eq 'ok') {
if (keys(%changes) > 0) {
$resulttext = &mt('Changes made:').'
';
- my $version = &Apache::lonnet::get_server_loncaparev($dom);
+ my $version = $r->dir_config('lonVersion');
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))) {
my $value = $env{'form.'.$item};
@@ -7525,9 +7508,6 @@ sub modify_defaults {
$mailmsgtext .= "\n";
my $cachetime = 24*60*60;
&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'}) {
my $notify = 1;
if (ref($domconfig{'contacts'}) eq 'HASH') {
@@ -7559,7 +7539,7 @@ sub modify_defaults {
}
sub modify_scantron {
- my ($r,$dom,$confname,$lastactref,%domconfig) = @_;
+ my ($r,$dom,$confname,%domconfig) = @_;
my ($resulttext,%confhash,%changes,$errors);
my $custom = 'custom.tab';
my $default = 'default.tab';
@@ -7620,9 +7600,6 @@ sub modify_scantron {
}
$resulttext .= '
';
&Apache::loncommon::devalidate_domconfig_cache($dom);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domainconfig'} = 1;
- }
} else {
$resulttext = &mt('No changes made to bubblesheet format file');
}
@@ -8013,7 +7990,7 @@ sub modify_helpsettings {
$changes{$item} = 1;
}
}
- if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
+ if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
$helphash{'helpsettings'}{$item} = $env{'form.'.$item};
}
}
@@ -8046,7 +8023,7 @@ sub modify_helpsettings {
}
sub modify_coursedefaults {
- my ($dom,$lastactref,%domconfig) = @_;
+ my ($dom,%domconfig) = @_;
my ($resulttext,$errors,%changes,%defaultshash);
my %defaultchecked = ('canuse_pdfforms' => 'off');
my @toggles = ('canuse_pdfforms');
@@ -8087,7 +8064,7 @@ sub modify_coursedefaults {
}
foreach my $item (@numbers) {
my ($currdef,$newdef);
- $newdef = $env{'form.'.$item};
+ my $newdef = $env{'form.'.$item};
if ($item eq 'anonsurvey_threshold') {
$currdef = $domconfig{'coursedefaults'}{$item};
$newdef =~ s/\D//g;
@@ -8137,9 +8114,10 @@ sub modify_coursedefaults {
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash,
$dom);
if ($putresult eq 'ok') {
+ my %domdefaults;
if (keys(%changes) > 0) {
- my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'}) || ($changes{'uploadquota'})) {
+ %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
if ($changes{'canuse_pdfforms'}) {
$domdefaults{'canuse_pdfforms'}=$defaultshash{'coursedefaults'}{'canuse_pdfforms'};
}
@@ -8160,9 +8138,6 @@ sub modify_coursedefaults {
}
my $cachetime = 24*60*60;
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domdefaults'} = 1;
- }
}
$resulttext = &mt('Changes made:').'
';
foreach my $item (sort(keys(%changes))) {
@@ -8214,7 +8189,7 @@ sub modify_coursedefaults {
}
sub modify_usersessions {
- my ($dom,$lastactref,%domconfig) = @_;
+ my ($dom,%domconfig) = @_;
my @hostingtypes = ('version','excludedomain','includedomain');
my @offloadtypes = ('primary','default');
my %types = (
@@ -8231,7 +8206,7 @@ sub modify_usersessions {
foreach my $prefix (@prefixes) {
$defaultshash{'usersessions'}{$prefix} = {};
}
- my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my $resulttext;
my %iphost = &Apache::lonnet::get_iphost();
foreach my $prefix (@prefixes) {
@@ -8407,9 +8382,6 @@ sub modify_usersessions {
}
my $cachetime = 24*60*60;
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domdefaults'} = 1;
- }
if (keys(%changes) > 0) {
my %lt = &usersession_titles();
$resulttext = &mt('Changes made:').'
';
@@ -8421,8 +8393,7 @@ sub modify_usersessions {
foreach my $lonhost (sort(keys(%{$changes{$prefix}}))) {
$resulttext .= '
'.$lonhost.' ';
my $lonhostdom = &Apache::lonnet::host_domain($lonhost);
- my $cachekey = &escape('spares').':'.&escape($lonhostdom);
- &Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]);
+ &Apache::lonnet::remote_devalidate_cache($lonhost,'spares',$lonhostdom);
if (ref($changes{$prefix}{$lonhost}) eq 'HASH') {
foreach my $type (@{$types{$prefix}}) {
if ($changes{$prefix}{$lonhost}{$type}) {
@@ -8512,7 +8483,7 @@ sub modify_loadbalancing {
if ($balancer eq '') {
next;
}
- if (!exists($servers{$balancer})) {
+ if (!exists($servers{$balancer})) {
if (exists($currbalancer{$balancer})) {
push(@{$changes{'delete'}},$balancer);
}
@@ -8563,14 +8534,14 @@ sub modify_loadbalancing {
}
} else {
if (ref($defaultshash{'loadbalancing'}{$balancer}) eq 'HASH') {
- foreach my $sparetype (@sparestypes) {
+ foreach my $sparetype (@sparestypes) {
if (ref($defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}) eq 'ARRAY') {
if (@{$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}} > 0) {
$changes{'curr'}{$balancer}{'targets'} = 1;
}
}
}
- }
+ }
}
my $ishomedom;
if (&Apache::lonnet::host_domain($balancer) eq $dom) {
@@ -8579,7 +8550,7 @@ sub modify_loadbalancing {
if (ref($alltypes) eq 'ARRAY') {
foreach my $type (@{$alltypes}) {
my $rule;
- unless ((($type eq '_LC_external') || ($type eq '_LC_internetdom')) &&
+ unless ((($type eq '_LC_external') || ($type eq '_LC_internetdom')) &&
(!$ishomedom)) {
$rule = $env{'form.loadbalancing_rules_'.$i.'_'.$type};
}
@@ -8604,17 +8575,17 @@ sub modify_loadbalancing {
}
my $putresult = &Apache::lonnet::put_dom('configuration',
\%defaultshash,$dom);
+
if ($putresult eq 'ok') {
if (keys(%changes) > 0) {
if (ref($changes{'delete'}) eq 'ARRAY') {
foreach my $balancer (sort(@{$changes{'delete'}})) {
$resulttext .= '