--- loncom/interface/domainprefs.pm 2013/09/21 13:49:31 1.208 +++ loncom/interface/domainprefs.pm 2013/09/29 00:49:28 1.209 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.208 2013/09/21 13:49:31 raeburn Exp $ +# $Id: domainprefs.pm,v 1.209 2013/09/29 00:49:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2997,7 +2997,7 @@ sub print_loadbalancing { } my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); - my $rownum = 6; + my $rownum = 8; if (ref($types) eq 'ARRAY') { $rownum += scalar(@{$types}); } @@ -3176,7 +3176,7 @@ sub loadbalancing_rules { 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 = ''; } @@ -3197,8 +3197,10 @@ sub loadbalancing_titles { '_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'); } @@ -3223,16 +3225,21 @@ sub loadbalancing_titles { 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; @@ -3297,6 +3304,8 @@ sub offloadtype_text { '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; } @@ -8636,7 +8645,8 @@ sub modify_loadbalancing { 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}); @@ -9369,7 +9379,6 @@ sub captcha_phrases { ); } - sub devalidate_remote_domconfs { my ($dom) = @_; my $primary_id = &Apache::lonnet::domain($dom,'primary');