';
+ '';
my $rem = $i%($numinrow);
if ($rem == 0) {
if (($i > 0) && ($i < $numspares-1)) {
@@ -3814,7 +3753,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 = '';
}
@@ -3866,7 +3805,7 @@ sub loadbalance_rule_row {
my @rulenames;
my %ruletitles = &offloadtype_text();
if (($type eq '_LC_ipchangesso') || ($type eq '_LC_ipchange')) {
- @rulenames = ('balancer','offloadedto','specific');
+ @rulenames = ('balancer','offloadedto');
} else {
@rulenames = ('default','homeserver');
if ($type eq '_LC_external') {
@@ -3877,7 +3816,7 @@ sub loadbalance_rule_row {
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;
@@ -3928,13 +3867,8 @@ sub loadbalance_rule_row {
' ';
- if (($rulenames[$i] eq 'specific') && ($type =~ /^_LC_ipchange/)) {
- $output .= $ruletitles{'particular'};
- } else {
- $output .= $ruletitles{$rulenames[$i]};
- }
- $output .= ''.$extra.' '."\n";
+ ')"'.$checked.' /> '.$ruletitles{$rulenames[$i]}.
+ ''.$extra.' '."\n";
}
$output .= ''."\n";
return $output;
@@ -3949,7 +3883,6 @@ sub offloadtype_text {
'none' => 'No offload',
'balancer' => 'Session hosted on Load Balancer, after re-authentication',
'offloadedto' => 'Session hosted on offload server, after re-authentication',
- 'particular' => 'Session hosted (after re-auth) on server:',
);
return %ruletitles;
}
@@ -5239,7 +5172,7 @@ sub serverstatus_pages {
sub defaults_javascript {
my ($settings) = @_;
- return unless (ref($settings) eq 'HASH');
+ return unless (ref($settings) eq 'HASH');
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
my $maxnum = scalar(@{$settings->{'inststatusorder'}});
if ($maxnum eq '') {
@@ -5839,7 +5772,6 @@ sub modify_login {
}
my %servers = &Apache::lonnet::internet_dom_servers($dom);
- my %domservers = &Apache::lonnet::get_servers($dom);
my @loginvia_attribs = ('serverpath','custompath','exempt');
if (keys(%servers) > 1) {
foreach my $lonhost (keys(%servers)) {
@@ -5882,7 +5814,22 @@ sub modify_login {
$changes{'loginvia'}{$lonhost} = 1;
}
if ($item eq 'exempt') {
- $new = &check_exempt_addresses($new);
+ $new =~ s/^\s+//;
+ $new =~ s/\s+$//;
+ my @poss_ips = split(/\s*[,:]\s*/,$new);
+ my @okips;
+ foreach my $ip (@poss_ips) {
+ if ($ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) {
+ if (($1 <= 255) && ($2 <= 255) && ($3 <= 255) && ($4 <= 255)) {
+ push(@okips,$ip);
+ }
+ }
+ }
+ if (@okips > 0) {
+ $new = join(',',@okips);
+ } else {
+ $new = '';
+ }
}
$loginhash{login}{loginvia}{$lonhost}{$item} = $new;
}
@@ -5994,85 +5941,6 @@ sub modify_login {
$errors .= '
'.$error.'
';
}
}
-
- my (%currheadtagurls,%currexempt,@newhosts,%newheadtagurls,%possexempt);
- if (ref($domconfig{'login'}) eq 'HASH') {
- if (ref($domconfig{'login'}{'headtag'}) eq 'HASH') {
- foreach my $lonhost (keys(%{$domconfig{'login'}{'headtag'}})) {
- if ($domservers{$lonhost}) {
- if (ref($domconfig{'login'}{'headtag'}{$lonhost}) eq 'HASH') {
- $currheadtagurls{$lonhost} = $domconfig{'login'}{'headtag'}{$lonhost}{'url'};
- $currexempt{$lonhost} = $domconfig{'login'}{'headtagexempt'}{$lonhost}{'exempt'}
- }
- }
- }
- }
- }
- my @delheadtagurls = &Apache::loncommon::get_env_multiple('form.loginheadtag_del');
- foreach my $lonhost (sort(keys(%domservers))) {
- if (grep(/^\Q$lonhost\E$/,@delheadtagurls)) {
- $changes{'headtag'}{$lonhost} = 1;
- } else {
- if ($env{'form.loginheadtagexempt_'.$lonhost}) {
- $possexempt{$lonhost} = &check_exempt_addresses($env{'form.loginheadtagexempt_'.$lonhost});
- }
- if ($env{'form.loginheadtag_'.$lonhost.'.filename'}) {
- push(@newhosts,$lonhost);
- } elsif ($currheadtagurls{$lonhost}) {
- $loginhash{'login'}{'headtag'}{$lonhost}{'url'} = $currheadtagurls{$lonhost};
- if ($currexempt{$lonhost}) {
- if ((!exists($possexempt{$lonhost})) || ($possexempt{$lonhost} ne $currexempt{$lonhost})) {
- $changes{'headtag'}{$lonhost} = 1;
- }
- } elsif ($possexempt{$lonhost}) {
- $changes{'headtag'}{$lonhost} = 1;
- }
- if ($possexempt{$lonhost}) {
- $loginhash{'login'}{'headtag'}{$lonhost}{'exempt'} = $possexempt{$lonhost};
- }
- }
- }
- }
- if (@newhosts) {
- my $error;
- my ($configuserok,$author_ok,$switchserver) = &config_check($dom,$confname,$servadm);
- if ($configuserok eq 'ok') {
- if ($switchserver) {
- $error = &mt("Upload of custom markup is not permitted to this server: [_1]",$switchserver);
- } elsif ($author_ok eq 'ok') {
- foreach my $lonhost (@newhosts) {
- my $formelem = 'loginheadtag_'.$lonhost;
- (my $result,$newheadtagurls{$lonhost}) = &publishlogo($r,'upload',$formelem,$dom,$confname,
- "login/headtag/$lonhost",'','',
- $env{'form.loginheadtag_'.$lonhost.'.filename'});
- if ($result eq 'ok') {
- $loginhash{'login'}{'headtag'}{$lonhost}{'url'} = $newheadtagurls{$lonhost};
- $changes{'headtag'}{$lonhost} = 1;
- if ($possexempt{$lonhost}) {
- $loginhash{'login'}{'headtag'}{$lonhost}{'exempt'} = $possexempt{$lonhost};
- }
- } else {
- my $puberror = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",
- $newheadtagurls{$lonhost},$result);
- $errors .= '
'.$puberror.'
';
- if ((grep(/^\Q$lonhost\E$/,keys(%currheadtagurls))) &&
- (!grep(/^\Q$lonhost\E$/,@delheadtagurls))) {
- $loginhash{'login'}{'headtag'}{$lonhost} = $currheadtagurls{$lonhost};
- }
- }
- }
- } else {
- $error = &mt("Upload of custom markup file(s) failed because an author role could not be assigned to a Domain Configuration user ([_1]) in domain: [_2]. Error was: [_3].",$confname,$dom,$author_ok);
- }
- } else {
- $error = &mt("Upload of custom markup file(s) failed because a Domain Configuration user ([_1]) could not be created in domain: [_2]. Error was: [_3].",$confname,$dom,$configuserok);
- }
- if ($error) {
- &Apache::lonnet::logthis($error);
- $errors .= '
'.$error.'
';
- }
- }
-
&process_captcha('login',\%changes,$loginhash{'login'},$domconfig{'login'});
my $defaulthelpfile = '/adm/loginproblems.html';
@@ -6173,25 +6041,6 @@ sub modify_login {
}
}
}
- } elsif ($item eq 'headtag') {
- if (ref($changes{$item}) eq 'HASH') {
- foreach my $lonhost (sort(keys(%{$changes{$item}}))) {
- if (grep(/^\Q$lonhost\E$/,@delheadtagurls)) {
- $resulttext .= '
'.&mt('custom markup file removed for [_1]',$domservers{$lonhost}).'