'."\n".
''.$pubtext.' '."\n".
@@ -4407,7 +4450,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) {
@@ -4699,7 +4742,7 @@ sub usertype_update_row {
}
sub modify_login {
- my ($r,$dom,$confname,%domconfig) = @_;
+ my ($r,$dom,$confname,$lastactref,%domconfig) = @_;
my ($resulttext,$errors,$colchgtext,%changes,%colchanges,%newfile,%newurl,
%curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon);
%title = ( coursecatalog => 'Display course catalog',
@@ -4879,7 +4922,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};
@@ -4937,6 +4980,7 @@ sub modify_login {
}
if (keys(%changes) > 0 || $colchgtext) {
&Apache::loncommon::devalidate_domconfig_cache($dom);
+ $$lastactref = 'update';
$resulttext = &mt('Changes made:').'
';
foreach my $item (sort(keys(%changes))) {
if ($item eq 'loginvia') {
@@ -4996,7 +5040,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 {
@@ -5057,7 +5101,7 @@ sub color_font_choices {
links => "Link colors",
images => "Images",
font => "Font color",
- fontmenu => "Font Menu",
+ fontmenu => "Font menu",
pgbg => "Page",
tabbg => "Header",
sidebg => "Border",
@@ -5069,7 +5113,7 @@ sub color_font_choices {
}
sub modify_rolecolors {
- my ($r,$dom,$confname,$roles,%domconfig) = @_;
+ my ($r,$dom,$confname,$roles,$lastactref,%domconfig) = @_;
my ($resulttext,%rolehash);
$rolehash{'rolecolors'} = {};
if (ref($domconfig{'rolecolors'}) ne 'HASH') {
@@ -5084,6 +5128,7 @@ sub modify_rolecolors {
if ($putresult eq 'ok') {
if (keys(%changes) > 0) {
&Apache::loncommon::devalidate_domconfig_cache($dom);
+ $$lastactref = 'update';
$resulttext = &display_colorchgs($dom,\%changes,$roles,
$rolehash{'rolecolors'});
} else {
@@ -5109,24 +5154,45 @@ sub modify_colors {
my @images;
my $servadm = $r->dir_config('lonAdmEMail');
my $errors;
+ my %defaults;
foreach my $role (@{$roles}) {
if ($role eq 'login') {
%choices = &login_choices();
@logintext = ('textcol','bgcol');
} else {
%choices = &color_font_choices();
- $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
}
if ($role eq 'login') {
@images = ('img','logo','domlogo','login');
@bgs = ('pgbg','mainbg','sidebg');
} else {
@images = ('img');
- @bgs = ('pgbg','tabbg','sidebg');
+ @bgs = ('pgbg','tabbg','sidebg');
}
- $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};
- foreach my $item (@bgs,@links,@logintext) {
- $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
+ my %defaults = &role_defaults($role,\@bgs,\@links,\@images,\@logintext);
+ unless ($env{'form.'.$role.'_font'} eq $defaults{'font'}) {
+ $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};
+ }
+ if ($role eq 'login') {
+ foreach my $item (@logintext) {
+ unless ($env{'form.'.$role.'_'.$item} eq $defaults{'logintext'}{$item}) {
+ $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
+ }
+ }
+ } else {
+ unless($env{'form.'.$role.'_fontmenu'} eq $defaults{'fontmenu'}) {
+ $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
+ }
+ }
+ foreach my $item (@bgs) {
+ unless ($env{'form.'.$role.'_'.$item} eq $defaults{'bgs'}{$item} ) {
+ $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
+ }
+ }
+ foreach my $item (@links) {
+ unless ($env{'form.'.$role.'_'.$item} eq $defaults{'links'}{$item}) {
+ $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
+ }
}
my ($configuserok,$author_ok,$switchserver) =
&config_check($dom,$confname,$servadm);
@@ -5474,7 +5540,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);
@@ -5494,7 +5560,7 @@ sub publishlogo {
if ($file=~/\.(\w+)$/ &&
(&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
$output =
- &mt('Invalid file extension ([_1]) - reserved for LONCAPA use.',$1);
+ &mt('Invalid file extension ([_1]) - reserved for internal 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);
@@ -5966,7 +6032,7 @@ sub modify_quotas {
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
$resulttext = &mt('Changes made:').'
'.
+ &mt('E-mail record of completed LON-CAPA updates to [_1] set to "'.
+ $offon[$env{'form.reportupdates'}].'".',
+ &Apache::loncommon::modal_link('http://loncapa.org/core.html',
+ &mt('LON-CAPA core group - MSU'),600,500)).
+ '
';
+ }
$resulttext .= '
';
} else {
$resulttext = &mt('No changes made to contact information');
@@ -7047,7 +7147,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') {
@@ -7175,7 +7275,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'})) {
@@ -7214,7 +7314,7 @@ sub process_captcha {
$changes->{'cancreate'} = ['recaptchakeys'];
}
} else {
- $changes->{'recaptchakeys'} = 1;
+ $changes->{'recaptchakeys'} = 1;
}
}
return;
@@ -7341,7 +7441,7 @@ sub modify_usermodification {
}
sub modify_defaults {
- my ($dom,$r) = @_;
+ my ($dom,$r,%domconfig) = @_;
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors);
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def');
@@ -7427,8 +7527,17 @@ sub modify_defaults {
my $cachetime = 24*60*60;
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'} || $changes{'datelocale_def'}) {
- my $sysmail = $r->dir_config('lonSysEMail');
- &Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext);
+ my $notify = 1;
+ if (ref($domconfig{'contacts'}) eq 'HASH') {
+ if ($domconfig{'contacts'}{'reportupdates'} == 0) {
+ $notify = 0;
+ }
+ }
+ if ($notify) {
+ &Apache::lonmsg::sendemail('installrecord@loncapa.org',
+ "LON-CAPA Domain Settings Change - $dom",
+ $mailmsgtext);
+ }
}
} else {
$resulttext = &mt('No changes made to default authentication/language/timezone settings');
@@ -7448,7 +7557,7 @@ sub modify_defaults {
}
sub modify_scantron {
- my ($r,$dom,$confname,%domconfig) = @_;
+ my ($r,$dom,$confname,$lastactref,%domconfig) = @_;
my ($resulttext,%confhash,%changes,$errors);
my $custom = 'custom.tab';
my $default = 'default.tab';
@@ -7509,6 +7618,7 @@ sub modify_scantron {
}
$resulttext .= '
';
&Apache::loncommon::devalidate_domconfig_cache($dom);
+ $$lastactref = 'update';
} else {
$resulttext = &mt('No changes made to bubblesheet format file');
}
@@ -7899,7 +8009,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};
}
}
@@ -7973,7 +8083,7 @@ sub modify_coursedefaults {
}
foreach my $item (@numbers) {
my ($currdef,$newdef);
- my $newdef = $env{'form.'.$item};
+ $newdef = $env{'form.'.$item};
if ($item eq 'anonsurvey_threshold') {
$currdef = $domconfig{'coursedefaults'}{$item};
$newdef =~ s/\D//g;
@@ -8302,7 +8412,8 @@ sub modify_usersessions {
foreach my $lonhost (sort(keys(%{$changes{$prefix}}))) {
$resulttext .= '
'.$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') {
foreach my $type (@{$types{$prefix}}) {
if ($changes{$prefix}{$lonhost}{$type}) {
@@ -8392,7 +8503,7 @@ sub modify_loadbalancing {
if ($balancer eq '') {
next;
}
- if (!exists($servers{$balancer})) {
+ if (!exists($servers{$balancer})) {
if (exists($currbalancer{$balancer})) {
push(@{$changes{'delete'}},$balancer);
}
@@ -8443,14 +8554,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) {
@@ -8459,7 +8570,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};
}
@@ -8484,17 +8595,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 .= '