--- loncom/interface/domainprefs.pm 2013/09/22 01:54:13 1.160.6.25
+++ loncom/interface/domainprefs.pm 2013/09/29 06:55:58 1.160.6.26
@@ -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 @@ 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.
@@ -408,7 +407,7 @@ sub handler {
}
} 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 @@ 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);
@@ -2978,7 +2977,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});
}
@@ -3157,7 +3156,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 = '';
}
@@ -3178,8 +3177,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');
}
@@ -3204,16 +3205,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;
@@ -3278,6 +3284,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;
}
@@ -3961,7 +3969,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.
@@ -5520,7 +5528,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]";
@@ -5786,7 +5794,7 @@ sub modify_quotas {
%limithash,$toolregexp,%conditions,$resulttext,%changes);
if ($action eq 'quotas') {
$context = 'tools';
- } else {
+ } else {
$context = $action;
}
if ($context eq 'requestcourses') {
@@ -7980,7 +7988,7 @@ 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')) {
$helphash{'helpsettings'}{$item} = $env{'form.'.$item};
}
@@ -8055,7 +8063,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;
@@ -8139,7 +8147,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:').''.
@@ -8566,7 +8574,6 @@ 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') {
@@ -8617,12 +8624,13 @@ 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});
}
- $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).'
';
}
}
}
@@ -8682,7 +8690,7 @@ sub recurse_cat_deletes {
delete($coursecategories->{$subitem});
$deletions->{$subitem} = 1;
&recurse_cat_deletes($subitem,$coursecategories,$deletions);
- }
+ }
}
}
return;
@@ -8920,7 +8928,6 @@ function showSpares(balancer,ishomedom,b
} 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 @@ function showSpares(balancer,ishomedom,b
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 singleServerToggle(balnum,type)
function balanceruleChange(formname,balnum,type) {
if (type == '_LC_external') {
- return;
+ return;
}
var typesRules = getIndicesByName(formname,'loadbalancing_rules_'+balnum+'_'+type);
for (var i=0; i |