version 1.11, 2007/11/15 21:24:56
|
version 1.14, 2009/09/06 02:11:46
|
Line 42
|
Line 42
|
exit; |
exit; |
} |
} |
my @info = ('inststatus','lockedname','internalname','lastname', |
my @info = ('inststatus','lockedname','internalname','lastname', |
'firstname','id','permanentemail'); |
'firstname','middlename','generation','id','permanentemail'); |
# Initialize language handler |
# Initialize language handler |
&Apache::lonlocal::get_language_handle(); |
&Apache::lonlocal::get_language_handle(); |
# find out which users we need to examine |
# find out which users we need to examine |
Line 82
|
Line 82
|
(my $insttypechg,@inststatuses) = |
(my $insttypechg,@inststatuses) = |
&affiliations_check(\%userhash,$instusers{$uname}); |
&affiliations_check(\%userhash,$instusers{$uname}); |
if ($insttypechg) { |
if ($insttypechg) { |
my $inststatusstr = join(':',&escape(@inststatuses)); |
my $inststatusstr = join(':',map { &escape($_) } (@inststatuses)); |
my %statushash = ( inststatus => $inststatusstr ); |
my %statushash = ( inststatus => $inststatusstr ); |
my $statusres = &Apache::lonnet::put('environment',\%statushash,$dom,$uname); |
my $statusres = &Apache::lonnet::put('environment',\%statushash,$dom,$uname); |
} |
} |
Line 121
|
Line 121
|
# Make the change |
# Make the change |
if ($changed) { |
if ($changed) { |
my %userupdate; |
my %userupdate; |
|
foreach my $item ('lastname','firstname','middlename','generation','id', |
|
'permanentemail') { |
|
$userupdate{$item} = $userhash{$item}; |
|
} |
foreach my $field (@fields) { |
foreach my $field (@fields) { |
$userupdate{$field} = $instusers{$uname}{$field}; |
$userupdate{$field} = $instusers{$uname}{$field}; |
} |
} |
Line 205 sub affiliations_check {
|
Line 209 sub affiliations_check {
|
@inststatuses = @{$insthashref->{'inststatus'}}; |
@inststatuses = @{$insthashref->{'inststatus'}}; |
} |
} |
} |
} |
my @currstatuses = &unescape(split(/:/,$userhash->{'inststatus'})); |
my @currstatuses = map { &unescape($_); } (split(/:/,$userhash->{'inststatus'})); |
foreach my $status (@inststatuses) { |
foreach my $status (@inststatuses) { |
if (!grep/^\Q$status\E/,@currstatuses) { |
if (!grep/^\Q$status\E/,@currstatuses) { |
$insttypechg = 1; |
$insttypechg = 1; |