version 1.279, 2009/02/08 20:01:54
|
version 1.280, 2009/02/09 04:11:11
|
Line 4172 sub update_selfenroll_queue {
|
Line 4172 sub update_selfenroll_queue {
|
my $hostname = &Apache::lonnet::hostname($chome); |
my $hostname = &Apache::lonnet::hostname($chome); |
my $protocol = $Apache::lonnet::protocol{$chome}; |
my $protocol = $Apache::lonnet::protocol{$chome}; |
$protocol = 'http' if ($protocol ne 'https'); |
$protocol = 'http' if ($protocol ne 'https'); |
my (@existing,@missingreq,@invalidusers,@limitexceeded,@enrolled,@enrollerrors,); |
my (@existing,@missingreq,@invalidusers,@limitexceeded,@enrolled, |
|
@enrollerrors,@warn_approves,@warn_rejects); |
my $now = time; |
my $now = time; |
my $sender = $env{'user.name'}.':'.$env{'user.domain'}; |
my $sender = $env{'user.name'}.':'.$env{'user.domain'}; |
my $approvedmsg = [{ |
my $approvedmsg = [{ |
Line 4225 sub update_selfenroll_queue {
|
Line 4226 sub update_selfenroll_queue {
|
$stucounts->{'selfenrolled'} ++; |
$stucounts->{'selfenrolled'} ++; |
&Apache::selfenroll::send_notification($uname.':'.$udom,$approvedmsg,$cid, |
&Apache::selfenroll::send_notification($uname.':'.$udom,$approvedmsg,$cid, |
$coursedesc,$now,'enroller',$sender); |
$coursedesc,$now,'enroller',$sender); |
|
my %userrequest = ( |
|
$cdom.'_'.$cnum => { |
|
timestamp => $now, |
|
section => $usec, |
|
adjudicator => $env{'user.name'}.':'.$env{'user.domain'}, |
|
status => 'approved', |
|
} |
|
); |
|
my $userresult = |
|
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); |
|
if ($userresult ne 'ok') { |
|
push(@warn_approves,$uname.':'.$udom); |
|
} |
} else { |
} else { |
push(@enrollerrors,$uname.':'.$udom); |
push(@enrollerrors,$uname.':'.$udom); |
} |
} |
Line 4238 sub update_selfenroll_queue {
|
Line 4252 sub update_selfenroll_queue {
|
foreach my $user (@rejections) { |
foreach my $user (@rejections) { |
&Apache::selfenroll::send_notification($user,$rejectedmsg,$cid, |
&Apache::selfenroll::send_notification($user,$rejectedmsg,$cid, |
$coursedesc,$now,'enroller',$sender); |
$coursedesc,$now,'enroller',$sender); |
|
my ($uname,$udom) = split(/:/,$user); |
|
my %userrequest = ( |
|
$cdom.'_'.$cnum => { |
|
timestamp => $now, |
|
adjudicator => $env{'user.name'}.':'.$env{'user.domain'}, |
|
status => 'rejected', |
|
} |
|
); |
|
my $userresult = |
|
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); |
|
if ($userresult ne 'ok') { |
|
push(@warn_rejects,$user); |
|
} |
} |
} |
} |
} |
if (@changes) { |
if (@changes) { |
Line 4305 sub update_selfenroll_queue {
|
Line 4332 sub update_selfenroll_queue {
|
$r->print('<li>'.$user.'</li>'); |
$r->print('<li>'.$user.'</li>'); |
} |
} |
$r->print('</ul></p>'); |
$r->print('</ul></p>'); |
|
} |
|
if (@warn_approves) { |
|
$r->print('<p>'.&mt("For the following users, an error occurred when updating the user's own self-enroll requests record:").'<ul>'); |
|
foreach my $user (@warn_approves) { |
|
$r->print('<li>'.$user.'</li>'); |
|
} |
|
$r->print('</ul></p>'); |
|
} |
|
if (@warn_rejects) { |
|
$r->print('<p>'.&mt("For the following users, an error occurred when updating the user's own self-enroll requests record:").'<ul>'); |
|
foreach my $user (@warn_rejects) { |
|
$r->print('<li>'.$user.'</li>'); |
|
} |
|
$r->print('</ul></p>'); |
} |
} |
return; |
return; |
} |
} |