version 1.82, 2008/12/26 16:34:01
|
version 1.83, 2008/12/26 21:48:43
|
Line 4977 sub modify_serverstatuses {
|
Line 4977 sub modify_serverstatuses {
|
my %serverstatushash = ( |
my %serverstatushash = ( |
serverstatuses => \%newserverstatus, |
serverstatuses => \%newserverstatus, |
); |
); |
my $putresult = &Apache::lonnet::put_dom('configuration',\%serverstatushash, |
|
$dom); |
|
my %changes; |
my %changes; |
foreach my $type (@pages) { |
foreach my $type (@pages) { |
if (ref($currserverstatus{$type}) eq 'HASH') { |
foreach my $setting ('namedusers','machines') { |
my @currnamed = split(/,/,$currserverstatus{$type}{'namedusers'}); |
my @current = (); |
my @newusers = split(/,/,$newserverstatus{$type}{'namedusers'}); |
if (ref($currserverstatus{$type}) eq 'HASH') { |
foreach my $item (@currnamed) { |
@current = split(/,/,$currserverstatus{$type}{$setting}); |
if (!grep(/^\Q$item\E$/,@newusers)) { |
|
$changes{$type}{'namedusers'} = 1; |
|
last; |
|
} |
|
} |
|
foreach my $item (@newusers) { |
|
if (!grep(/^\Q$item\E$/,@currnamed)) { |
|
$changes{$type}{'namedusers'} = 1; |
|
last; |
|
} |
|
} |
} |
my @currmachines = split(/,/,$currserverstatus{$type}{'machines'}); |
my @new = split(/,/,$newserverstatus{$type}{$setting}); |
my @newmachines = split(/,/,$newserverstatus{$type}{'machines'}); |
if (@current > 0) { |
if (@currmachines > 0) { |
if (@new > 0) { |
if (@newmachines > 0) { |
foreach my $item (@current) { |
foreach my $item (@currmachines) { |
if (!grep(/^\Q$item\E$/,@new)) { |
if (!grep(/^\Q$item\E$/,@newmachines)) { |
$changes{$type}{$setting} = 1; |
$changes{$type}{'machines'} = 1; |
|
last; |
last; |
} |
} |
} |
} |
foreach my $item (@newmachines) { |
if (!$changes{$type}{$setting}) { |
if (!grep(/^\Q$item\E$/,@currmachines)) { |
foreach my $item (@new) { |
$changes{$type}{'machines'} = 1; |
if (!grep(/^\Q$item\E$/,@current)) { |
last; |
$changes{$type}{$setting} = 1; |
|
last; |
|
} |
} |
} |
} |
} |
} else { |
} else { |
$changes{$type}{'machines'} = 1; |
$changes{$type}{$setting} = 1; |
} |
} |
} elsif (@newmachines > 0) { |
} elsif (@new > 0) { |
$changes{$type}{'machines'} = 1; |
$changes{$type}{$setting} = 1; |
} |
} |
} |
} |
} |
} |