version 1.12, 2004/11/27 17:23:09
|
version 1.15, 2005/11/07 15:43:22
|
Line 48
|
Line 48
|
foreach my $dom (@domains) { |
foreach my $dom (@domains) { |
#only run if configured to |
#only run if configured to |
if (! &localenroll::run($dom)) { next; } |
if (! &localenroll::run($dom)) { next; } |
$ENV{'user.domain'} = $dom; |
$env{'user.domain'} = $dom; |
# Determine the courses |
# Determine the courses |
my %courses = &Apache::lonnet::courseiddump($dom,'.',1,'.','.',1,\@hostids); |
my %courses = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.',1,\@hostids); |
my %affiliates = (); |
my %affiliates = (); |
my %enrollvar = (); |
my %enrollvar = (); |
my %reply = (); |
my %reply = (); |
Line 105
|
Line 105
|
} |
} |
} |
} |
foreach my $xlist (@crosslistings) { |
foreach my $xlist (@crosslistings) { |
if ($xlist =~ m/^(\w+):(\w*)$/) { |
if ($xlist =~ m/^([^:]+):(\w*)$/) { |
my $course_id = $1; |
my $course_id = $1; |
my $gp = $2; |
my $gp = $2; |
if (!grep/^$course_id$/,@{$affiliates{$crs}}) { |
if (!grep/^$course_id$/,@{$affiliates{$crs}}) { |
Line 136
|
Line 136
|
if ($changecount > 0) { |
if ($changecount > 0) { |
unless ($enrollvar{$crs}{notifylist} eq '') { |
unless ($enrollvar{$crs}{notifylist} eq '') { |
# Send message about enrollment changes to notifylist. |
# Send message about enrollment changes to notifylist. |
# Set $ENV{'user.name'}, $ENV{'user.home'} for use by logging in lonmsg |
# Set $env{'user.name'}, $env{'user.home'} for use by logging in lonmsg |
unless ( ($enrollvar{$crs}{'courseowner'} eq '') || (!defined($enrollvar{$crs}{'courseowner'}) ) ) { |
unless ( ($enrollvar{$crs}{'courseowner'} eq '') || (!defined($enrollvar{$crs}{'courseowner'}) ) ) { |
$ENV{'user.name'} = $enrollvar{$crs}{'courseowner'}; |
$env{'user.name'} = $enrollvar{$crs}{'courseowner'}; |
$ENV{'user.home'} = &Apache::lonnet::homeserver($ENV{'user.name'},$dom); |
$env{'user.home'} = &Apache::lonnet::homeserver($env{'user.name'},$dom); |
|
|
my $subject = "Student enrollment changes in $enrollvar{$crs}{coursecode}"; |
my $subject = "Student enrollment changes in $enrollvar{$crs}{coursecode}"; |
my $message = "The following $changecount change(s) occurred in $enrollvar{$crs}{description} - $enrollvar{$crs}{coursecode} as a result of the automated classlist update:\n\n".$response; |
my $message = "The following $changecount change(s) occurred in $enrollvar{$crs}{description} - $enrollvar{$crs}{coursecode} as a result of the automated classlist update:\n\n".$response; |
Line 158
|
Line 158
|
} |
} |
if ( ($enrollvar{$crs}{notifylist} eq '') && ($newusermsg ne '') ) { |
if ( ($enrollvar{$crs}{notifylist} eq '') && ($newusermsg ne '') ) { |
my $subject = "New user accounts in $enrollvar{$crs}{'coursecode'}"; |
my $subject = "New user accounts in $enrollvar{$crs}{'coursecode'}"; |
my $status = &Apache::lonmsg::user_normal_msg($ENV{'user.name'},$dom,$subject,$newusermsg); |
my $status = &Apache::lonmsg::user_normal_msg($env{'user.name'},$dom,$subject,$newusermsg); |
} |
} |
delete($ENV{'user.name'}); |
delete($env{'user.name'}); |
delete($ENV{'user.home'}); |
delete($env{'user.home'}); |
} |
} |
} |
} |
} |
} |
Line 181
|
Line 181
|
} |
} |
print $fh "-- ".localtime(time)." Enrollment messages end\n*******************\n\n"; |
print $fh "-- ".localtime(time)." Enrollment messages end\n*******************\n\n"; |
close($fh); |
close($fh); |
delete($ENV{'user.domain'}); |
delete($env{'user.domain'}); |
# Check for photos |
# Check for photos |
} |
} |
|
|