Diff for /loncom/enrollment/Autoupdate.pl between versions 1.5 and 1.6

version 1.5, 2007/05/11 17:25:28 version 1.6, 2007/05/29 20:43:17
Line 35 Line 35
     use LONCAPA;      use LONCAPA;
   
     my $perlvarref = LONCAPA::Configuration::read_conf('loncapa.conf');      my $perlvarref = LONCAPA::Configuration::read_conf('loncapa.conf');
       my $logfile = $$perlvarref{'lonDaemons'}.'/logs/autoupdate.log';
     my $hostid = $perlvarref->{'lonHostID'};       my $hostid = $perlvarref->{'lonHostID'}; 
     my @info = ('inststatus','lockedname','lastname','firstname','id');      my @info = ('inststatus','lockedname','internalname','lastname',
                   'firstname','id');
       # Initialize language handler
       &Apache::lonlocal::get_language_handle();
     # find out which users we need to examine      # find out which users we need to examine
     my @domains = sort(&Apache::lonnet::current_machine_domains());      my @domains = sort(&Apache::lonnet::current_machine_domains());
     foreach my $dom (@domains) {      foreach my $dom (@domains) {
Line 56 Line 60
             }              }
         }          }
         next if (!$run_update);          next if (!$run_update);
           open (my $fh,">>$logfile");
           print $fh "********************\n".localtime(time).' '.&mt('Autoupdate messages start for domain: [_1]',$dom).' --'."\n";
         # get user information          # get user information
         my (%instusers,%instids);          my (%instusers,%instids);
         next if (&localenroll::allusers_info($dom,\%instusers,\%instids) ne 'ok');          next if (&localenroll::allusers_info($dom,\%instusers,\%instids) ne 'ok');
Line 145 Line 151
                         } else {                          } else {
                             if (!exists($users{$instids{$userhash{'id'}}})) {                              if (!exists($users{$instids{$userhash{'id'}}})) {
                                 $unamechg{$uname} = $instids{$userhash{'id'}};                                  $unamechg{$uname} = $instids{$userhash{'id'}};
                                 print &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";
                             }                              }
                         }                          }
                     }                      }
Line 155 Line 161
         if (keys(%possnames) > 0) {          if (keys(%possnames) > 0) {
             foreach my $uname (keys(%possnames)) {              foreach my $uname (keys(%possnames)) {
                 my $altnames = join(' or ',@{$possnames{$uname}});                  my $altnames = join(' or ',@{$possnames{$uname}});
                 print &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";
           close($fh);
     }      }
   
 sub descend_tree {  sub descend_tree {

Removed from v.1.5  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>