[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Sun Sep 29 02:53:36 EDT 2013


raeburn		Sun Sep 29 06:53:36 2013 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - Whitespace changes only.
    - Remove trailing spaces.
    - Remove some completely blank lines.
  
  
-------------- next part --------------
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.209 loncom/interface/domainprefs.pm:1.210
--- loncom/interface/domainprefs.pm:1.209	Sun Sep 29 00:49:28 2013
+++ loncom/interface/domainprefs.pm	Sun Sep 29 06:53:35 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.209 2013/09/29 00:49:28 raeburn Exp $
+# $Id: domainprefs.pm,v 1.210 2013/09/29 06:53:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -86,7 +86,7 @@
 
 $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
@@ -442,7 +442,7 @@
         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).
                       '<br />'
             );
             if ($switchserver) {
@@ -575,7 +575,7 @@
     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"';
         }
@@ -1556,7 +1556,7 @@
     } 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();
@@ -2156,7 +2156,7 @@
                 }
             }
         }
-        if ($settings->{'xmldc'} ne '') { 
+        if ($settings->{'xmldc'} ne '') {
             $currhash{$settings->{'xmldc'}} = 1;
         }
     } else {
@@ -2542,7 +2542,7 @@
         $datatable .= '</tr></table></td></tr>'."\n";
         $itemcount += 2;
         my $onclick = 'toggleCredits(this.form);';
-        my $display = 'none';  
+        my $display = 'none';
         if ($currusecredits) {
             $display = 'block';
         }
@@ -3028,7 +3028,7 @@
                       '<td rowspan="'.$rownum.'" valign="top">'.
                       '<p>';
         if ($lonhost eq '') {
-            $datatable .= '<span class="LC_nobreak">'; 
+            $datatable .= '<span class="LC_nobreak">';
             if (keys(%currbalancer) > 0) {
                 $datatable .= &mt('Add balancer:');
             } else {
@@ -3044,7 +3044,7 @@
                 next if ($currbalancer{$server});
                 $datatable .= '<option value="'.$server.'">'.$server.'</option>'."\n";
             }
-            $datatable .= 
+            $datatable .=
                 '</select>'."\n".
                 '<input type="hidden" name="loadbalancing_prevlonhost_'.$balnum.'" id="loadbalancing_prevlonhost_'.$balnum.'" value="" /> </span>'."\n";
         } else {
@@ -3083,7 +3083,7 @@
                 if (exists($currbalancer{$spares[$i]})) {
                     $disabled = ' disabled="disabled"';
                 }
-                $targettable .= 
+                $targettable .=
                     '<td><label><input type="checkbox" name="loadbalancing_target_'.$balnum.'_'.$sparetype.'"'.
                     $checked.$disabled.' value="'.$chkboxval.'" id="loadbalancing_target_'.$balnum.'_'.$sparetype.'_'.$i.'" onclick="checkOffloads('."this,'$balnum','$sparetype'".');" /><span id="loadbalancing_targettxt_'.$balnum.'_'.$sparetype.'_'.$i.'"> '.$chkboxval.
                     '</span></label></td>';
@@ -3167,7 +3167,7 @@
         $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}) {
@@ -3246,7 +3246,7 @@
     if ($islast && $num == 1) {
         $space = '<div display="inline-block"> </div>';
     }
-    my $output = 
+    my $output =
         '<tr class="'.$css_class.'" id="balanceruletr_'.$balnum.'_'.$num.'"><td valign="top">'.$space.
         '<div id="balanceruletitle_'.$balnum.'_'.$type.'" style="'.$style.'">'.$title.'</div></td>'."\n".
         '<td valaign="top">'.$space.
@@ -3266,7 +3266,7 @@
                 unless ($checked) {
                     $default = ' selected="selected"';
                 }
-                $extra = 
+                $extra =
                     ': <select name="loadbalancing_singleserver_'.$balnum.'_'.$type.
                     '" id="loadbalancing_singleserver_'.$balnum.'_'.$type.
                     '" onchange="singleServerToggle('."'$balnum','$type'".')">'."\n".
@@ -3371,7 +3371,7 @@
                                    automatic  => 'Automatic approval',
                  );
     return %titles;
-} 
+}
 
 sub courserequest_conditions {
     my %conditions = &Apache::lonlocal::texthash (
@@ -3610,9 +3610,9 @@
 #
 # 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 .= '</td></tr>'."\n".
                '<tr><td>'."\n".
                '<span class="LC_nobreak"><span id="'.$context.'_recaptchapubtxt">'.$pubtext.'</span> '."\n".
@@ -4922,7 +4922,7 @@
                     } 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 .= '<li><span class="LC_error">'.$puberror.'</span></li>';
-                        if ((grep(/^\Q$lang\E$/, at currlangs)) && 
+                        if ((grep(/^\Q$lang\E$/, at currlangs)) &&
                             (!grep(/^\Q$lang\E$/, at delurls))) {
 
                             $loginhash{'login'}{'helpurl'}{$lang} = $domconfig{'login'}{'helpurl'}{$lang};
@@ -5040,7 +5040,7 @@
                     }
                 } 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 {
@@ -5540,7 +5540,7 @@
 # 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);
@@ -6032,7 +6032,7 @@
             &Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
 
             $resulttext = &mt('Changes made:').'<ul>';
-            unless (($context eq 'requestcourses') || 
+            unless (($context eq 'requestcourses') ||
                     ($context eq 'requestauthor')) {
                 if (ref($changes{'defaultquota'}) eq 'HASH') {
                     $resulttext .= '<li>'.&mt('Portfolio default quotas').'<ul>';
@@ -6066,7 +6066,7 @@
                 my (%haschgs,%inconf);
                 if ($context eq 'requestauthor') {
                     %haschgs = %changes;
-                    %inconf = %confhash; 
+                    %inconf = %confhash;
                 } else {
                     if (ref($changes{$item}) eq 'HASH') {
                         %haschgs = %{$changes{$item}};
@@ -6080,7 +6080,7 @@
                         &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;
@@ -6647,7 +6647,7 @@
                         } else {
                             $chgtext =~ s/\; $//;
                         }
-                        $resulttext .= 
+                        $resulttext .=
                             '<li>'.
                             &mt("Users from domain '[_1]' permitted to search the institutional directory set to: [_2]",
                                 '<span class="LC_cusr_emph">'.$dom.'</span>',$chgtext).
@@ -7147,7 +7147,7 @@
                             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') {
@@ -7275,7 +7275,7 @@
         $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'})) {
@@ -7314,7 +7314,7 @@
                 $changes->{'cancreate'} = ['recaptchakeys'];
             }
         } else {
-            $changes->{'recaptchakeys'} = 1; 
+            $changes->{'recaptchakeys'} = 1;
         }
     }
     return;
@@ -8009,7 +8009,7 @@
                     $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};
             }
         }
@@ -8502,7 +8502,7 @@
         if ($balancer eq '') {
             next;
         }
-        if (!exists($servers{$balancer})) { 
+        if (!exists($servers{$balancer})) {
             if (exists($currbalancer{$balancer})) {
                 push(@{$changes{'delete'}},$balancer);
             }
@@ -8553,14 +8553,14 @@
             }
         } 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) {
@@ -8569,7 +8569,7 @@
         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};
                 }
@@ -8594,7 +8594,6 @@
         }
         my $putresult = &Apache::lonnet::put_dom('configuration',
                                                  \%defaultshash,$dom);
- 
         if ($putresult eq 'ok') {
             if (keys(%changes) > 0) {
                 if (ref($changes{'delete'}) eq 'ARRAY') {
@@ -8604,7 +8603,7 @@
                     }
                 }
                 if (ref($changes{'add'}) eq 'ARRAY') {
-                    foreach my $balancer (sort(@{$changes{'add'}})) {   
+                    foreach my $balancer (sort(@{$changes{'add'}})) {
                         $resulttext .= '<li>'.&mt('Load Balancing enabled for: [_1]',$balancer);
                     }
                 }
@@ -8651,7 +8650,7 @@
                                         } else {
                                             $balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type});
                                         }
-                                        $resulttext .= '<li>'.&mt('Load Balancer: [_1] -- balancing for [_2] set to - "[_3]"',$balancer,$titles->{$type},$balancetext).'</li>';     
+                                        $resulttext .= '<li>'.&mt('Load Balancer: [_1] -- balancing for [_2] set to - "[_3]"',$balancer,$titles->{$type},$balancetext).'</li>';
                                     }
                                 }
                             }
@@ -8744,7 +8743,7 @@
         }
     }
     @domcoord = sort(@domcoord);
-    my $numdcs = scalar(@domcoord); 
+    my $numdcs = scalar(@domcoord);
     my $rows = 0;
     my $table;
     if ($numdcs > 1) {
@@ -8878,7 +8877,7 @@
     }
     &get_loadbalancers_config($servers,\%existing,\%currbalancer,
                               \%currtargets,\%currrules);
-    my $balancers = join("','",sort(keys(%currbalancer))); 
+    my $balancers = join("','",sort(keys(%currbalancer)));
     return <<"END";
 
 <script type="text/javascript">
@@ -8949,7 +8948,6 @@
             } else {
                 document.getElementById('balanceruletitle_'+balnum+'_'+insttypes[k]).style.display='none';
                 document.getElementById('balancerule_'+balnum+'_'+insttypes[k]).style.display='none';
-
             }
         } else {
             document.getElementById('balanceruletitle_'+balnum+'_'+insttypes[k]).style.display='block';
@@ -8961,12 +8959,11 @@
             var item = document.getElementById('loadbalancing_singleserver_'+balnum+'_'+insttypes[k]);
             item.options.length = 0;
             item.options[0] = new Option("","",true,true);
-            var idx = 0;  
+            var idx = 0;
             for (var m=0; m<alltargets.length; m++) {
                 if ((currBalancers.indexOf(alltargets[m]) == -1) && (alltargets[m] != balancer)) {
                     idx ++;
                     item.options[idx] = new Option(alltargets[m],alltargets[m],false,false);
-                    
                 }
             }
         }


More information about the LON-CAPA-cvs mailing list