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

raeburn raeburn at source.lon-capa.org
Sun Sep 29 02:55:59 EDT 2013


raeburn		Sun Sep 29 06:55:59 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    - Backport 1.209.
    - Remove trailing whitespace
    - Remove some completely blank lines.
  
  
-------------- next part --------------
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.25 loncom/interface/domainprefs.pm:1.160.6.26
--- loncom/interface/domainprefs.pm:1.160.6.25	Sun Sep 22 01:54:13 2013
+++ loncom/interface/domainprefs.pm	Sun Sep 29 06:55:58 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.25 2013/09/22 01:54:13 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.26 2013/09/29 06:55:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -97,7 +97,6 @@
 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. 
@@ -408,7 +407,7 @@
         }
     } 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);
@@ -422,7 +421,7 @@
     } 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);
@@ -2978,7 +2977,7 @@
     }
     my ($othertitle,$usertypes,$types) =
         &Apache::loncommon::sorted_inst_types($dom);
-    my $rownum = 6;
+    my $rownum = 8;
     if (ref($types) eq 'ARRAY') {
         $rownum += scalar(@{$types});
     }
@@ -3157,7 +3156,7 @@
             if (ref($currrules) eq 'HASH') {
                 $current = $currrules->{$type};
             }
-            if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) {
+            if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) {
                 if ($dom ne &Apache::lonnet::host_domain($lonhost)) {
                     $current = '';
                 }
@@ -3178,8 +3177,10 @@
            '_LC_author'      => &mt('Users from [_1] with author role',$dom),
            '_LC_internetdom' => &mt('Users not from [_1], but from [_2]',$dom,$intdom),
            '_LC_external'    => &mt('Users not from [_1]',$intdom),
+           '_LC_ipchangesso' => &mt('SSO users from [_1], with IP mismatch',$dom),
+           '_LC_ipchange'    => &mt('Non-SSO users with IP mismatch'),
                      );
-    my @alltypes = ('_LC_adv','_LC_author','_LC_internetdom','_LC_external');
+    my @alltypes = ('_LC_adv','_LC_author','_LC_internetdom','_LC_external','_LC_ipchangesso','_LC_ipchange');
     if (ref($types) eq 'ARRAY') {
         unshift(@alltypes,@{$types},'default');
     }
@@ -3204,16 +3205,21 @@
 sub loadbalance_rule_row {
     my ($type,$title,$current,$servers,$currbalancer,$lonhost,$dom,
         $targets_div_style,$homedom_div_style,$css_class,$balnum,$num,$islast) = @_;
-    my @rulenames = ('default','homeserver');
+    my @rulenames;
     my %ruletitles = &offloadtype_text();
-    if ($type eq '_LC_external') {
-        push(@rulenames,'externalbalancer');
+    if (($type eq '_LC_ipchangesso') || ($type eq '_LC_ipchange')) {
+        @rulenames = ('balancer','offloadedto');
     } else {
-        push(@rulenames,'specific');
+        @rulenames = ('default','homeserver');
+        if ($type eq '_LC_external') {
+            push(@rulenames,'externalbalancer');
+        } else {
+            push(@rulenames,'specific');
+        }
+        push(@rulenames,'none');
     }
-    push(@rulenames,'none');
     my $style = $targets_div_style;
-    if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) {
+    if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) {
         $style = $homedom_div_style;
     }
     my $space;
@@ -3278,6 +3284,8 @@
            'externalbalancer' => "Offloads to Load Balancer in user's domain",
            'specific'         => 'Offloads to specific server',
            'none'             => 'No offload',
+           'balancer'         => 'Session hosted on Load Balancer, after re-authentication',
+           'offloadedto'      => 'Session hosted on offload server, after re-authentication',
     );
     return %ruletitles;
 }
@@ -3961,7 +3969,7 @@
             } 
             $datatable .= '<td>'.$errorstr.'</td><td> ';
         } 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 .= '<td><span class="LC_nobreak">'.
                           $link.
@@ -5520,7 +5528,7 @@
     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]";
@@ -5786,7 +5794,7 @@
         %limithash,$toolregexp,%conditions,$resulttext,%changes);
     if ($action eq 'quotas') {
         $context = 'tools'; 
-    } else { 
+    } else {
         $context = $action;
     }
     if ($context eq 'requestcourses') {
@@ -7980,7 +7988,7 @@
                 } elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) {
                     $changes{$item} = 1;
                 }
-	    }
+            }
             if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
                 $helphash{'helpsettings'}{$item} = $env{'form.'.$item};
             }
@@ -8055,7 +8063,7 @@
         }
         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;
@@ -8139,7 +8147,7 @@
                         $resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>';
                     }
                 } elsif ($item eq 'anonsurvey_threshold') {
-                        $resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>';
+                    $resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>';
                 } elsif ($item eq 'uploadquota') {
                     if (ref($defaultshash{'coursedefaults'}{'uploadquota'}) eq 'HASH') {
                         $resulttext .= '<li>'.&mt('Default quota for content uploaded to a course/community via Course Editor set as follows:').'<ul>'.
@@ -8566,7 +8574,6 @@
         }
         my $putresult = &Apache::lonnet::put_dom('configuration',
                                                  \%defaultshash,$dom);
-
         if ($putresult eq 'ok') {
             if (keys(%changes) > 0) {
                 if (ref($changes{'delete'}) eq 'ARRAY') {
@@ -8617,12 +8624,13 @@
                                         my $balancetext;
                                         if ($rule eq '') {
                                             $balancetext =  $ruletitles{'default'};
-                                        } elsif (($rule eq 'homeserver') || ($rule eq 'externalbalancer')) {
+                                        } elsif (($rule eq 'homeserver') || ($rule eq 'externalbalancer') ||
+                                                 ($rule eq 'balancer') || ($rule eq 'offloadedto')) {
                                             $balancetext =  $ruletitles{$rule};
                                         } 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>';
                                     }
                                 }
                             }
@@ -8682,7 +8690,7 @@
                 delete($coursecategories->{$subitem});
                 $deletions->{$subitem} = 1;
                 &recurse_cat_deletes($subitem,$coursecategories,$deletions);
-            }  
+            }
         }
     }
     return;
@@ -8920,7 +8928,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';
@@ -8937,7 +8944,6 @@
                 if ((currBalancers.indexOf(alltargets[m]) == -1) && (alltargets[m] != balancer)) {
                     idx ++;
                     item.options[idx] = new Option(alltargets[m],alltargets[m],false,false);
-
                 }
             }
         }
@@ -9010,7 +9016,7 @@
 
 function balanceruleChange(formname,balnum,type) {
     if (type == '_LC_external') {
-        return; 
+        return;
     }
     var typesRules = getIndicesByName(formname,'loadbalancing_rules_'+balnum+'_'+type);
     for (var i=0; i<typesRules.length; i++) {


More information about the LON-CAPA-cvs mailing list