--- loncom/enrollment/Enrollment.pm 2004/06/29 04:30:00 1.16 +++ loncom/enrollment/Enrollment.pm 2004/09/13 16:36:34 1.18 @@ -1,5 +1,5 @@ # Automated Enrollment manager -# $Id: Enrollment.pm,v 1.16 2004/06/29 04:30:00 raeburn Exp $ +# $Id: Enrollment.pm,v 1.18 2004/09/13 16:36:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,7 +32,6 @@ use HTML::Entities; use LONCAPA::Configuration; use Time::Local; use lib '/home/httpd/lib/perl'; -use localenroll; use strict; @@ -52,6 +51,7 @@ sub update_LC { my @localstudents = (); my @futurestudents = (); my @activestudents = (); + my @excludedstudents = (); my $currlist; foreach my $uname (keys %{$roster} ) { if ($uname =~ m/^(.+):$dom$/) { @@ -63,6 +63,8 @@ sub update_LC { push @futurestudents, $1; @{$$currlist{$1}} = @{$$roster{$uname}}; push @localstudents, $1; + } elsif ($$roster{$uname}[$lockedtype] == 1) { + push @excludedstudents, $1; } } } @@ -125,7 +127,9 @@ sub update_LC { # Check for multiple sections for a single student my @okusers = (); foreach my $uname (@reg_students) { - if (@{$allenrolled{$uname}} > 1) { + if (grep/^$uname$/,@excludedstudents) { + $$logmsg .= "No re-enrollment for $uname - user was previously manually unenrolled and locked.".$linefeed; + } elsif (@{$allenrolled{$uname}} > 1) { my @sections = (); my $saved; for (my $i=0; $i<@{$allenrolled{$uname}}; $i++) { @@ -281,7 +285,7 @@ sub update_LC { } } } elsif ($auth eq "localauth") { - ($authparam,$create_passwd,$authchk) = &localenroll::create_password($authparam); + ($authparam,$create_passwd,$authchk) = &Apache::lonnet::auto_create_password($crs,$dom,$authparam); } elsif ($auth =~ m/^krb/) { if ($authparam eq '') { $$logmsg .= "No Kerberos domain was provided for the new user - $uname, so the new student was not enrolled in the course.".$linefeed;