--- loncom/interface/domainprefs.pm 2013/08/13 19:18:43 1.160.6.23
+++ loncom/interface/domainprefs.pm 2013/08/08 00:53:32 1.202
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.23 2013/08/13 19:18:43 raeburn Exp $
+# $Id: domainprefs.pm,v 1.202 2013/08/08 00:53:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -86,7 +86,7 @@ $dom,$settings,$rowtotal,$action.
$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
-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).
The print_quotas routine was orginally created to display/store information
@@ -97,7 +97,6 @@ i.e., blogs, aboutme page, and portfolio
used by course owners to request creation of a course, and to display/store
default quota sizes for authoring spaces.
-
Outputs: 1
$datatable - HTML containing form elements which allow settings to be changed.
@@ -212,13 +211,15 @@ sub handler {
'quotas','autoenroll','autoupdate','autocreate',
'directorysrch','usercreation','usermodification',
'contacts','defaults','scantron','coursecategories',
- 'serverstatuses','requestcourses','coursedefaults',
- 'usersessions','loadbalancing','requestauthor'],$dom);
+ 'serverstatuses','requestcourses','helpsettings',
+ 'coursedefaults','usersessions','loadbalancing',
+ 'requestauthor'],$dom);
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
'autoupdate','autocreate','directorysrch','contacts',
'usercreation','usermodification','scantron',
'requestcourses','requestauthor','coursecategories',
- 'serverstatuses','coursedefaults','usersessions');
+ 'serverstatuses','helpsettings',
+ 'coursedefaults','usersessions');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
%existing = %{$domconfig{'loadbalancing'}};
@@ -355,12 +356,26 @@ sub handler {
col3 => 'Specific IPs',
}],
},
- 'coursedefaults' =>
+ 'helpsettings' =>
+ {text => 'Help page settings',
+ help => 'Domain_Configuration_Help_Settings',
+ header => [{col1 => 'Help Settings (logged-in users)',
+ col2 => 'Value'}],
+ },
+ 'coursedefaults' =>
{text => 'Course/Community defaults',
help => 'Domain_Configuration_Course_Defaults',
- header => [{col1 => 'Defaults which can be overridden for each course by a DC',
+ header => [{col1 => 'Defaults which can be overridden in each course by a CC',
+ col2 => 'Value',},
+ {col1 => 'Defaults which can be overridden for each course by a DC',
col2 => 'Value',},],
},
+ 'privacy' =>
+ {text => 'User Privacy',
+ help => 'Domain_Configuration_User_Privacy',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ },
'usersessions' =>
{text => 'User session hosting/offloading',
help => 'Domain_Configuration_User_Sessions',
@@ -404,7 +419,7 @@ sub handler {
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles);
} elsif ($phase eq 'display') {
my $js = &recaptcha_js().
- &credits_js();
+ &credits_js();
if ((keys(%servers) > 1) || (keys(%existing) > 0)) {
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($dom);
@@ -418,12 +433,12 @@ sub handler {
} else {
# check if domconfig user exists for the domain.
my $servadm = $r->dir_config('lonAdmEMail');
- my ($configuserok,$author_ok,$switchserver) =
+ my ($configuserok,$author_ok,$switchserver) =
&config_check($dom,$confname,$servadm);
unless ($configuserok eq 'ok') {
&Apache::lonconfigsettings::print_header($r,$phase,$context);
$r->print(&mt('The domain configuration user "[_1]" has yet to be created.',
- $confname).
+ $confname).
' '
);
if ($switchserver) {
@@ -511,7 +526,7 @@ sub process_changes {
} elsif ($action eq 'contacts') {
$output = &modify_contacts($dom,%domconfig);
} elsif ($action eq 'defaults') {
- $output = &modify_defaults($dom,$r,%domconfig);
+ $output = &modify_defaults($dom,$r);
} elsif ($action eq 'scantron') {
$output = &modify_scantron($r,$dom,$confname,%domconfig);
} elsif ($action eq 'coursecategories') {
@@ -522,6 +537,8 @@ sub process_changes {
$output = &modify_quotas($dom,$action,%domconfig);
} elsif ($action eq 'requestauthor') {
$output = &modify_quotas($dom,$action,%domconfig);
+ } elsif ($action eq 'helpsettings') {
+ $output = &modify_helpsettings($r,$dom,$confname,%domconfig);
} elsif ($action eq 'coursedefaults') {
$output = &modify_coursedefaults($dom,%domconfig);
} elsif ($action eq 'usersessions') {
@@ -554,7 +571,7 @@ sub print_config_box {
if ($numheaders > 1) {
my $colspan = '';
my $rightcolspan = '';
- if (($action eq 'rolecolors') || ($action eq 'coursecategories') ||
+ if (($action eq 'rolecolors') || ($action eq 'coursecategories') ||
(($action eq 'login') && ($numheaders < 3))) {
$colspan = ' colspan="2"';
}
@@ -593,6 +610,8 @@ sub print_config_box {
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal);
} elsif ($action eq 'rolecolors') {
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal);
+ } elsif ($action eq 'coursedefaults') {
+ $output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal);
}
$output .= '
@@ -682,6 +701,8 @@ sub print_config_box {
'.&mt($item->{'header'}->[2]->{'col2'}).' '.
&print_usersessions('bottom',$dom,$settings,\$rowtotal);
$rowtotal ++;
+ } elsif ($action eq 'coursedefaults') {
+ $output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'rolecolors') {
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).'
@@ -778,8 +799,6 @@ sub print_config_box {
$output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'loadbalancing') {
$output .= &print_loadbalancing($dom,$settings,\$rowtotal);
- } elsif ($action eq 'coursedefaults') {
- $output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal);
}
}
$output .= '
@@ -1533,7 +1552,7 @@ sub print_quotas {
} elsif ($context eq 'requestauthor') {
@usertools = ('author');
@options = ('norequest','approval','automatic');
- %titles = &authorrequest_titles();
+ %titles = &authorrequest_titles();
} else {
@usertools = ('aboutme','blog','webdav','portfolio');
%titles = &tool_titles();
@@ -2133,7 +2152,7 @@ sub print_autocreate {
}
}
}
- if ($settings->{'xmldc'} ne '') {
+ if ($settings->{'xmldc'} ne '') {
$currhash{$settings->{'xmldc'}} = 1;
}
} else {
@@ -2290,7 +2309,7 @@ sub print_contacts {
my @contacts = ('adminemail','supportemail');
my (%checked,%to,%otheremails,%bccemails);
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail',
- 'requestsmail','updatesmail','idconflictsmail');
+ 'requestsmail','updatesmail');
foreach my $type (@mailings) {
$otheremails{$type} = '';
}
@@ -2327,21 +2346,21 @@ sub print_contacts {
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
$checked{'requestsmail'}{'adminemail'} = ' checked="checked" ';
$checked{'updatesmail'}{'adminemail'} = ' checked="checked" ';
- $checked{'idconflictsmail'}{'adminemail'} = ' checked="checked" ';
}
my ($titles,$short_titles) = &contact_titles();
my $rownum = 0;
my $css_class;
foreach my $item (@contacts) {
+ $rownum ++;
$css_class = $rownum%2?' class="LC_odd_row"':'';
$datatable .= ''.
''.$titles->{$item}.
' '.
' ';
- $rownum ++;
}
foreach my $type (@mailings) {
+ $rownum ++;
$css_class = $rownum%2?' class="LC_odd_row"':'';
$datatable .= ''.
''.
@@ -2364,21 +2383,7 @@ sub print_contacts {
'value="'.$bccemails{$type}.'" />';
}
$datatable .= ' '."\n";
- $rownum ++;
}
- my %choices;
- $choices{'reporterrors'} = &mt('E-mail error reports to [_1]',
- &Apache::loncommon::modal_link('http://loncapa.org/core.html',
- &mt('LON-CAPA core group - MSU'),600,500));
- $choices{'reportupdates'} = &mt('E-mail record of completed LON-CAPA updates to [_1]',
- &Apache::loncommon::modal_link('http://loncapa.org/core.html',
- &mt('LON-CAPA core group - MSU'),600,500));
- my @toggles = ('reporterrors','reportupdates');
- my %defaultchecked = ('reporterrors' => 'on',
- 'reportupdates' => 'on');
- (my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
- \%choices,$rownum);
- $datatable .= $reports;
$$rowtotal += $rownum;
return $datatable;
}
@@ -2519,7 +2524,7 @@ sub print_coursedefaults {
$datatable .= ''."\n";
$itemcount += 2;
my $onclick = 'toggleCredits(this.form);';
- my $display = 'none';
+ my $display = 'none';
if ($currusecredits) {
$display = 'block';
}
@@ -3005,7 +3010,7 @@ sub print_loadbalancing {
''.
'';
if ($lonhost eq '') {
- $datatable .= '';
+ $datatable .= '';
if (keys(%currbalancer) > 0) {
$datatable .= &mt('Add balancer:');
} else {
@@ -3021,7 +3026,7 @@ sub print_loadbalancing {
next if ($currbalancer{$server});
$datatable .= ''.$server.' '."\n";
}
- $datatable .=
+ $datatable .=
''."\n".
' '."\n";
} else {
@@ -3060,7 +3065,7 @@ sub print_loadbalancing {
if (exists($currbalancer{$spares[$i]})) {
$disabled = ' disabled="disabled"';
}
- $targettable .=
+ $targettable .=
'
'.$chkboxval.
' ';
@@ -3144,7 +3149,7 @@ sub loadbalancing_rules {
$css_class,$balnum,$islast) = @_;
my $output;
my $num = 0;
- my ($alltypes,$othertypes,$titles) =
+ my ($alltypes,$othertypes,$titles) =
&loadbalancing_titles($dom,$intdom,$usertypes,$types);
if ((ref($alltypes) eq 'ARRAY') && (ref($titles) eq 'HASH')) {
foreach my $type (@{$alltypes}) {
@@ -3216,7 +3221,7 @@ sub loadbalance_rule_row {
if ($islast && $num == 1) {
$space = '
';
}
- my $output =
+ my $output =
''.$space.
''.$title.'
'."\n".
''.$space.
@@ -3236,7 +3241,7 @@ sub loadbalance_rule_row {
unless ($checked) {
$default = ' selected="selected"';
}
- $extra =
+ $extra =
': '."\n".
@@ -3296,7 +3301,6 @@ sub contact_titles {
'lonstatusmail' => 'E-mail from nightly status check (warnings/errors)',
'requestsmail' => 'E-mail from course requests requiring approval',
'updatesmail' => 'E-mail from nightly check of LON-CAPA module integrity/updates',
- 'idconflictsmail' => 'E-mail from bi-nightly check for multiple users sharing same student/employee ID',
);
my %short_titles = &Apache::lonlocal::texthash (
adminemail => 'Admin E-mail address',
@@ -3339,7 +3343,7 @@ sub authorrequest_titles {
automatic => 'Automatic approval',
);
return %titles;
-}
+}
sub courserequest_conditions {
my %conditions = &Apache::lonlocal::texthash (
@@ -3578,9 +3582,9 @@ sub captcha_choice {
#
# Note: If reCAPTCHA is to be used for LON-CAPA servers in a domain, a domain coordinator should visit:
# https://www.google.com/recaptcha and generate a Public and Private key. For domains with multiple
-# servers a single key pair will be used for all servers, so the internet domain (e.g., yourcollege.edu)
+# servers a single key pair will be used for all servers, so the internet domain (e.g., yourcollege.edu)
# specified for use with the key should be broad enough to accommodate all servers in the LON-CAPA domain.
-#
+#
$output .= ' '."\n".
''."\n".
''.$pubtext.' '."\n".
@@ -3957,7 +3961,7 @@ sub print_scantronformat {
}
$datatable .= ' '.$errorstr.' ';
} elsif ($scantronurl) {
- my $link = &Apache::loncommon::modal_link($scantronurl,&mt('Custom bubblesheet format file'),600,500,
+ my $link = &Apache::loncommon::modal_link($scantronurl,&mt('Custom bubblesheet format file'),600,500,
undef,undef,undef,undef,'background-color:#ffffff');
$datatable .= ' '.
$link.
@@ -4418,7 +4422,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) {
@@ -4890,7 +4894,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};
@@ -5007,7 +5011,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 {
@@ -5506,7 +5510,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);
@@ -5514,7 +5518,7 @@ sub publishlogo {
if ($fname=~m|/|) {
($fnamepath,$file) = ($fname =~ m|^(.*)/([^/]+)$|);
}
- my @parts=split(/\//,"$filepath/$relpath/$fnamepath");
+ my @parts=split(/\//,"$filepath/$relpath/$fnamepath");
my $count;
for ($count=5;$count<=$#parts;$count++) {
$filepath.="/$parts[$count]";
@@ -5780,7 +5784,7 @@ sub modify_quotas {
%limithash,$toolregexp,%conditions,$resulttext,%changes);
if ($action eq 'quotas') {
$context = 'tools';
- } else {
+ } else {
$context = $action;
}
if ($context eq 'requestcourses') {
@@ -5998,7 +6002,7 @@ sub modify_quotas {
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
$resulttext = &mt('Changes made:').'';
- unless (($context eq 'requestcourses') ||
+ unless (($context eq 'requestcourses') ||
($context eq 'requestauthor')) {
if (ref($changes{'defaultquota'}) eq 'HASH') {
$resulttext .= ''.&mt('Portfolio default quotas').'';
@@ -6032,7 +6036,7 @@ sub modify_quotas {
my (%haschgs,%inconf);
if ($context eq 'requestauthor') {
%haschgs = %changes;
- %inconf = %confhash;
+ %inconf = %confhash;
} else {
if (ref($changes{$item}) eq 'HASH') {
%haschgs = %{$changes{$item}};
@@ -6046,7 +6050,7 @@ sub modify_quotas {
&Apache::lonnet::usertools_access($env{'user.name'},
$env{'user.domain'},
$item,'reload',$context);
- if (($context eq 'requestcourses') ||
+ if (($context eq 'requestcourses') ||
($context eq 'requestauthor')) {
if ($env{'environment.canrequest.'.$item} ne $newacc) {
$newenv{'environment.canrequest.'.$item} = $newacc;
@@ -6612,7 +6616,7 @@ sub modify_directorysrch {
} else {
$chgtext =~ s/\; $//;
}
- $resulttext .=
+ $resulttext .=
''.
&mt("Users from domain '[_1]' permitted to search the institutional directory set to: [_2]",
''.$dom.' ',$chgtext).
@@ -6668,8 +6672,7 @@ sub modify_contacts {
my (%others,%to,%bcc);
my @contacts = ('supportemail','adminemail');
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail',
- 'requestsmail','updatesmail','idconflictsmail');
- my @toggles = ('reporterrors','reportupdates');
+ 'requestsmail','updatesmail');
foreach my $type (@mailings) {
@{$newsetting{$type}} =
&Apache::loncommon::get_env_multiple('form.'.$type);
@@ -6691,11 +6694,6 @@ sub modify_contacts {
$to{$item} = $env{'form.'.$item};
$contacts_hash{'contacts'}{$item} = $to{$item};
}
- foreach my $item (@toggles) {
- if ($env{'form.'.$item} =~ /^(0|1)$/) {
- $contacts_hash{'contacts'}{$item} = $env{'form.'.$item};
- }
- }
if (keys(%currsetting) > 0) {
foreach my $item (@contacts) {
if ($to{$item} ne $currsetting{$item}) {
@@ -6734,7 +6732,7 @@ sub modify_contacts {
foreach my $item (@contacts) {
if ($to{$item} ne $default{$item}) {
$changes{$item} = 1;
- }
+ }
}
foreach my $type (@mailings) {
if ((@{$newsetting{$type}} != 1) || ($newsetting{$type}[0] ne $default{$type})) {
@@ -6751,14 +6749,6 @@ sub modify_contacts {
}
}
}
- foreach my $item (@toggles) {
- if (($env{'form.'.$item} == 1) && ($currsetting{$item} == 0)) {
- $changes{$item} = 1;
- } elsif ((!$env{'form.'.$item}) &&
- (($currsetting{$item} eq '') || ($currsetting{$item} == 1))) {
- $changes{$item} = 1;
- }
- }
my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash,
$dom);
if ($putresult eq 'ok') {
@@ -6793,23 +6783,6 @@ sub modify_contacts {
$resulttext .= ' ';
}
}
- my @offon = ('off','on');
- if ($changes{'reporterrors'}) {
- $resulttext .= ''.
- &mt('E-mail error reports to [_1] set to "'.
- $offon[$env{'form.reporterrors'}].'".',
- &Apache::loncommon::modal_link('http://loncapa.org/core.html',
- &mt('LON-CAPA core group - MSU'),600,500)).
- ' ';
- }
- if ($changes{'reportupdates'}) {
- $resulttext .= ''.
- &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');
@@ -7110,7 +7083,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') {
@@ -7238,7 +7211,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'})) {
@@ -7277,7 +7250,7 @@ sub process_captcha {
$changes->{'cancreate'} = ['recaptchakeys'];
}
} else {
- $changes->{'recaptchakeys'} = 1;
+ $changes->{'recaptchakeys'} = 1;
}
}
return;
@@ -7404,7 +7377,7 @@ sub modify_usermodification {
}
sub modify_defaults {
- my ($dom,$r,%domconfig) = @_;
+ my ($dom,$r) = @_;
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');
@@ -7490,17 +7463,8 @@ 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 $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);
- }
+ my $sysmail = $r->dir_config('lonSysEMail');
+ &Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext);
}
} else {
$resulttext = &mt('No changes made to default authentication/language/timezone settings');
@@ -7970,8 +7934,8 @@ sub modify_helpsettings {
} elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) {
$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};
}
}
@@ -8129,7 +8093,7 @@ sub modify_coursedefaults {
$resulttext .= ' '.&mt('Course/Community users can create/upload PDF forms set to "off"').' ';
}
} elsif ($item eq 'anonsurvey_threshold') {
- $resulttext .= ''.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).' ';
+ $resulttext .= ''.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).' ';
} elsif ($item eq 'uploadquota') {
if (ref($defaultshash{'coursedefaults'}{'uploadquota'}) eq 'HASH') {
$resulttext .= ''.&mt('Default quota for content uploaded to a course/community via Course Editor set as follows:').''.
@@ -8464,7 +8428,7 @@ sub modify_loadbalancing {
if ($balancer eq '') {
next;
}
- if (!exists($servers{$balancer})) {
+ if (!exists($servers{$balancer})) {
if (exists($currbalancer{$balancer})) {
push(@{$changes{'delete'}},$balancer);
}
@@ -8515,14 +8479,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) {
@@ -8531,7 +8495,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};
}
@@ -8556,7 +8520,7 @@ 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') {
@@ -8566,7 +8530,7 @@ sub modify_loadbalancing {
}
}
if (ref($changes{'add'}) eq 'ARRAY') {
- foreach my $balancer (sort(@{$changes{'add'}})) {
+ foreach my $balancer (sort(@{$changes{'add'}})) {
$resulttext .= ''.&mt('Load Balancing enabled for: [_1]',$balancer);
}
}
@@ -8612,7 +8576,7 @@ sub modify_loadbalancing {
} else {
$balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type});
}
- $resulttext .= ' '.&mt('Load Balancer: [_1] -- balancing for [_2] set to - "[_3]"',$balancer,$titles->{$type},$balancetext).' ';
+ $resulttext .= ''.&mt('Load Balancer: [_1] -- balancing for [_2] set to - "[_3]"',$balancer,$titles->{$type},$balancetext).' ';
}
}
}
@@ -8672,7 +8636,7 @@ sub recurse_cat_deletes {
delete($coursecategories->{$subitem});
$deletions->{$subitem} = 1;
&recurse_cat_deletes($subitem,$coursecategories,$deletions);
- }
+ }
}
}
return;
@@ -8705,7 +8669,7 @@ sub active_dc_picker {
}
}
@domcoord = sort(@domcoord);
- my $numdcs = scalar(@domcoord);
+ my $numdcs = scalar(@domcoord);
my $rows = 0;
my $table;
if ($numdcs > 1) {
@@ -8839,7 +8803,7 @@ sub lonbalance_targets_js {
}
&get_loadbalancers_config($servers,\%existing,\%currbalancer,
\%currtargets,\%currrules);
- my $balancers = join("','",sort(keys(%currbalancer)));
+ my $balancers = join("','",sort(keys(%currbalancer)));
return <<"END";