version 1.12, 2009/11/18 19:15:45
|
version 1.12.2.2, 2009/12/07 04:48:04
|
Line 366 sub update_request_queue {
|
Line 366 sub update_request_queue {
|
@existing,@missingreq,@invalidusers,@limitexceeded,@completed, |
@existing,@missingreq,@invalidusers,@limitexceeded,@completed, |
@processing_errors,@warn_approves,@warn_rejects,@approvals, |
@processing_errors,@warn_approves,@warn_rejects,@approvals, |
@rejections,@rejectionerrors,@nopermissions,%courseroles, |
@rejections,@rejectionerrors,@nopermissions,%courseroles, |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype); |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype, |
|
@warn_coursereqs); |
@approvals = &Apache::loncommon::get_env_multiple('form.approvereq'); |
@approvals = &Apache::loncommon::get_env_multiple('form.approvereq'); |
@rejections = &Apache::loncommon::get_env_multiple('form.rejectreq'); |
@rejections = &Apache::loncommon::get_env_multiple('form.rejectreq'); |
$now = time; |
$now = time; |
Line 455 sub update_request_queue {
|
Line 456 sub update_request_queue {
|
my $uhome = &Apache::lonnet::homeserver($uname,$udom); |
my $uhome = &Apache::lonnet::homeserver($uname,$udom); |
if ($uhome ne 'no_host') { |
if ($uhome ne 'no_host') { |
if (exists($requesthash{$uname.':'.$udom})) { |
if (exists($requesthash{$uname.':'.$udom})) { |
|
if ($cdom eq 'gci' && $cnum eq '9615072b469884921gcil1') { |
|
my $enresult = &enable_gci_submission($uname,$udom, |
|
$access_start,$access_end); |
|
} |
if (exists($classlist->{$uname.':'.$udom})) { |
if (exists($classlist->{$uname.':'.$udom})) { |
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
if (($classlist->{$uname.':'.$udom}->[$idx->{'status'}] eq 'Active') || |
if (($classlist->{$uname.':'.$udom}->[$idx->{'status'}] eq 'Active') || |
Line 501 sub update_request_queue {
|
Line 505 sub update_request_queue {
|
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); |
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); |
if ($userresult ne 'ok') { |
if ($userresult ne 'ok') { |
push(@warn_approves,$uname.':'.$udom); |
push(@warn_approves,$uname.':'.$udom); |
|
} elsif ($udom eq 'gci') { |
|
my %changehash = ( |
|
'reqcrsotherdom.unofficial' => 'gcitest:autolimit=', |
|
); |
|
my $reqresult = &Apache::lonnet::put('environment',\%changehash, |
|
$udom,$uname); |
|
if ($reqresult ne 'ok') { |
|
push(@warn_coursereqs,$uname.':'.$udom); |
|
} |
} |
} |
} else { |
} else { |
push(@processing_errors,$uname.':'.$udom); |
push(@processing_errors,$uname.':'.$udom); |
Line 885 sub update_request_queue {
|
Line 898 sub update_request_queue {
|
$output .= '</ul></p>'; |
$output .= '</ul></p>'; |
} |
} |
} |
} |
|
if (@warn_coursereqs) { |
|
$output .= '<p>'..&mt("For the following users, an error occurred when setting rights to request creation of Concept Test courses:").'<ul>'; |
|
foreach my $user (@warn_coursereqs) { |
|
$output .= '<li>'.$user.'</li>'; |
|
} |
|
$output .= '</ul></p>'; |
|
} |
return $output; |
return $output; |
} |
} |
|
|
|
sub enable_gci_submission { |
|
my ($udom,$uname,$access_end,$access_start) = @_; |
|
my $cdom = 'gci'; |
|
my $cnum = '1H96711d710194bfegcil1'; |
|
my ($stucounts,$idx,$classlist) = &get_student_counts($cdom,$cnum); |
|
if (exists($classlist->{$uname.':'.$udom})) { |
|
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
|
if (($classlist->{$uname.':'.$udom}->[$idx->{'status'}] eq 'Active') || |
|
($classlist->{$uname.':'.$udom}->[$idx->{'status'}] eq 'Future')) { |
|
return; |
|
} |
|
} |
|
} |
|
return |
|
&Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,undef,undef,undef,$access_end,$access_start,'selfenroll',undef,$cdom.'_'.$cnum,1); |
|
} |
|
|
sub get_student_counts { |
sub get_student_counts { |
my ($cdom,$cnum) = @_; |
my ($cdom,$cnum) = @_; |
my (%idx,%stucounts); |
my (%idx,%stucounts); |