--- loncom/enrollment/Autoupdate.pl 2007/05/29 20:43:17 1.6 +++ loncom/enrollment/Autoupdate.pl 2007/05/29 21:09:47 1.8 @@ -1,7 +1,7 @@ #!/usr/bin/perl # # Automated Userinfo update script -# $Id: Autoupdate.pl,v 1.6 2007/05/29 20:43:17 raeburn Exp $ +# $Id: Autoupdate.pl,v 1.8 2007/05/29 21:09:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,8 +60,8 @@ } } next if (!$run_update); - open (my $fh,">>$logfile"); - print $fh "********************\n".localtime(time).' '.&mt('Autoupdate messages start for domain: [_1]',$dom).' --'."\n"; + open(my $fh,">>$logfile"); + print $fh ("********************\n".localtime(time).' '.&mt('Autoupdate messages start for domain: [_1]',$dom).' --'."\n"); # get user information my (%instusers,%instids); next if (&localenroll::allusers_info($dom,\%instusers,\%instids) ne 'ok'); @@ -151,7 +151,7 @@ } else { if (!exists($users{$instids{$userhash{'id'}}})) { $unamechg{$uname} = $instids{$userhash{'id'}}; - print $fh &mt('Username change to [_1] detected for [_2] in domain [_3].',$unamechg{$uname},$uname,$dom)."\n"; + print $fh (&mt('Username change to [_1] detected for [_2] in domain [_3].',$unamechg{$uname},$uname,$dom)."\n"); } } } @@ -161,10 +161,10 @@ if (keys(%possnames) > 0) { foreach my $uname (keys(%possnames)) { my $altnames = join(' or ',@{$possnames{$uname}}); - print $fh &mt('Possible username change to [_1] detected for [_2] in domain [_3].',$altnames,$uname,$dom)."\n"; + print $fh (&mt('Possible username change to [_1] detected for [_2] in domain [_3].',$altnames,$uname,$dom)."\n"); } } - print $fh "-- ".localtime(time).' '.&mt('Autoupdate messages end')."\n*******************\n\n"; + print $fh ("-- ".&Apache::lonlocal::locallocaltime(time).' '.&mt('Autoupdate messages end')."\n*******************\n\n"); close($fh); } @@ -227,8 +227,8 @@ sub affiliations_check { my ($userhash,$insthashref) = @_; my (@inststatuses,$insttypechg);; if (ref($insthashref) eq 'HASH') { - if (ref($insthashref->{type}) eq 'ARRAY') { - @inststatuses = @{$insthashref->{type}}; + if (ref($insthashref->{'inststatus'}) eq 'ARRAY') { + @inststatuses = @{$insthashref->{'inststatus'}}; } } my @currstatuses = &unescape(split(/:/,$userhash->{'inststatus'}));