version 1.52.2.2.2.3, 2020/08/22 02:05:53
|
version 1.61, 2021/06/15 20:52:26
|
Line 105 sub send_selfserve_notification {
|
Line 105 sub send_selfserve_notification {
|
$rawsubj = 'Self-enrollment requests processed'; |
$rawsubj = 'Self-enrollment requests processed'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Enrollment requests in the following course: [_1] have been processed.', |
mt => 'Enrollment requests in the following course: [_1] have been processed.', |
args => ["\n$contextdesc"], |
args => ["\n$contextdesc\n"], |
}); |
}); |
} elsif ($context eq 'domainmanagers') { |
} elsif ($context eq 'domainmanagers') { |
$rawsubj = 'Course/Community requests reviewed'; |
$rawsubj = 'Course/Community requests reviewed'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Course/Community creation requests in the following domain: "[_1]" have been reviewed.', |
mt => 'Course/Community creation requests in the following domain: [_1] have been reviewed.', |
args => ["\n$contextdesc"], |
args => ["\n$contextdesc\n"], |
}); |
}); |
if (ref($textstr) eq 'ARRAY') { |
if (ref($textstr) eq 'ARRAY') { |
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
Line 119 sub send_selfserve_notification {
|
Line 119 sub send_selfserve_notification {
|
} elsif ($context eq 'authormanagers') { |
} elsif ($context eq 'authormanagers') { |
$rawsubj = 'Authoring Space requests reviewed'; |
$rawsubj = 'Authoring Space requests reviewed'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Authoring requests in the following domain: "[_1]" have been reviewed.', |
mt => 'Authoring requests in the following domain: [_1] have been reviewed.', |
args => ["\n$contextdesc"], |
args => ["\n$contextdesc\n"], |
}); |
}); |
if (ref($textstr) eq 'ARRAY') { |
if (ref($textstr) eq 'ARRAY') { |
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
Line 128 sub send_selfserve_notification {
|
Line 128 sub send_selfserve_notification {
|
} elsif ($context eq 'usernamemanagers') { |
} elsif ($context eq 'usernamemanagers') { |
$rawsubj = 'LON-CAPA account requests reviewed'; |
$rawsubj = 'LON-CAPA account requests reviewed'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Account requests in the following domain: "[_1]" have been reviewed.', |
mt => 'Account requests in the following domain: [_1] have been reviewed.', |
args => ["\n$contextdesc"], |
args => ["\n$contextdesc\n"], |
}); |
}); |
if (ref($textstr) eq 'ARRAY') { |
if (ref($textstr) eq 'ARRAY') { |
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
Line 506 sub build_queue_display {
|
Line 506 sub build_queue_display {
|
my %crstypes; |
my %crstypes; |
my $output = &Apache::loncommon::start_data_table(). |
my $output = &Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(); |
&Apache::loncommon::start_data_table_header_row(); |
unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) { |
unless (($context eq 'pending') || ($context eq 'displaypending') || ($context eq 'helpdesk')) { |
$output .= '<th>'.&mt('Action').'</th>'; |
$output .= '<th>'.&mt('Action').'</th>'; |
} |
} |
$output .= '<th>'.&mt('Requestor').'</th>'; |
$output .= '<th>'.&mt('Requestor').'</th>'; |
Line 528 sub build_queue_display {
|
Line 528 sub build_queue_display {
|
unofficial => 'Unofficial course', |
unofficial => 'Unofficial course', |
community => 'Community', |
community => 'Community', |
textbook => 'Textbook course', |
textbook => 'Textbook course', |
|
placement => 'Placement test', |
); |
); |
$output .= '<th>'.&mt('Type').'</th>'. |
$output .= '<th>'.&mt('Type').'</th>'. |
'<th>'.&mt('Date requested').'</th>'. |
'<th>'.&mt('Date requested').'</th>'. |
Line 609 sub build_queue_display {
|
Line 610 sub build_queue_display {
|
} elsif ($context eq 'requestusername') { |
} elsif ($context eq 'requestusername') { |
$row .= '<td>'.$showtime.'</td>'."\n". |
$row .= '<td>'.$showtime.'</td>'."\n". |
'<td>'.$detailslink.'</td>'."\n"; |
'<td>'.$detailslink.'</td>'."\n"; |
} else { |
} else { |
if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') { |
if ($context eq 'pending' || $context eq 'displaypending' || $context eq 'stillpending') { |
$row .= '<td>'.$instcode.'</td>'."\n"; |
$row .= '<td>'.$instcode.'</td>'."\n"; |
} else { |
} else { |
Line 879 sub update_request_queue {
|
Line 880 sub update_request_queue {
|
my $dbname = 'nohist_requestedusernames'; |
my $dbname = 'nohist_requestedusernames'; |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
my %curr = &Apache::lonnet::get($dbname,[$uname],$cdom,$domconfiguser); |
my %curr = &Apache::lonnet::get($dbname,[$uname],$cdom,$domconfiguser); |
|
|
if (ref($curr{$uname}) eq 'HASH') { |
if (ref($curr{$uname}) eq 'HASH') { |
my ($username,$logtoken,$serverid,$encpass,$courseid,$id,$firstname, |
my ($logtoken,$serverid,$encpass,$courseid,$id,$firstname, |
$middlename,$lastname,$generation,$inststatus); |
$middlename,$lastname,$generation,$inststatus,$email); |
$curr{$uname}{'timestamp'} = $now; |
$curr{$uname}{'timestamp'} = $now; |
$curr{$uname}{'adjudicator'} = $env{'user.name'}.':'.$env{'user.domain'}; |
$curr{$uname}{'adjudicator'} = $env{'user.name'}.':'.$env{'user.domain'}; |
$courseid = $curr{$uname}{'courseid'}; |
$courseid = $curr{$uname}{'courseid'}; |
Line 893 sub update_request_queue {
|
Line 894 sub update_request_queue {
|
$generation = $curr{$uname}{'generation'}; |
$generation = $curr{$uname}{'generation'}; |
$inststatus = $curr{$uname}{'inststatus'}; |
$inststatus = $curr{$uname}{'inststatus'}; |
|
|
my ($key,$caller)=split(/&/,$curr{$uname}{'tmpinfo'}); |
if ($curr{$uname}{'email'} ne '') { |
if ($caller eq 'createaccount') { |
$email = $curr{$uname}{'email'}; |
my $upass = &Apache::loncommon::des_decrypt($key,$curr{$uname}{'upass'}); |
} elsif ($uname =~ /^[^\@]+\@[^\@]+$/) { |
|
$email = $uname; |
|
} |
|
|
|
my $upass; |
|
if ($curr{$uname}{'tmpinfo'}) { |
|
my ($key,$caller)=split(/&/,$curr{$uname}{'tmpinfo'}); |
|
if ($caller eq 'createaccount') { |
|
if ($curr{$uname}{'upass'} eq '') { |
|
$upass = $curr{$uname}{'upass'}; |
|
} else { |
|
$upass = &Apache::loncommon::des_decrypt($key,$curr{$uname}{'upass'}); |
|
} |
|
} else { |
|
push(@processing_errors,$uname); |
|
} |
|
} else { |
|
$upass = $curr{$uname}{'upass'}; |
|
} |
|
if ($upass eq '') { |
|
push(@processing_errors,$uname); |
|
} else { |
undef($curr{$uname}{'upass'}); |
undef($curr{$uname}{'upass'}); |
my $result = |
my $result = |
&Apache::lonnet::modifyuser($cdom,$uname,$id,'internal',$upass, |
&Apache::lonnet::modifyuser($cdom,$uname,$id,'internal',$upass, |
$firstname,$middlename,$lastname, |
$firstname,$middlename,$lastname, |
$generation,undef,undef,$uname); |
$generation,undef,undef,$email); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$curr{$uname}{'status'} = 'created'; |
$curr{$uname}{'status'} = 'created'; |
push(@completed,$uname); |
push(@completed,$uname); |
Line 921 sub update_request_queue {
|
Line 943 sub update_request_queue {
|
} else { |
} else { |
push(@processing_errors,$uname); |
push(@processing_errors,$uname); |
} |
} |
} else { |
|
push(@processing_errors,$uname); |
|
} |
} |
} else { |
} else { |
push(@invalidusers,$uname); |
push(@invalidusers,$uname); |
Line 1627 sub course_creation {
|
Line 1647 sub course_creation {
|
$owneremail = $emails{$email}; |
$owneremail = $emails{$email}; |
last if ($owneremail ne ''); |
last if ($owneremail ne ''); |
} |
} |
my %reqdetails = &build_batchcreatehash($dom,$context,$details,$owneremail,$domdefs); |
my %reqdetails = &build_batchcreatehash($dom,$cnum,$context,$details,$owneremail,$domdefs); |
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
\%reqdetails,$longroles,$logmsg,$clonemsg,$newusermsg,$addresult, |
\%reqdetails,$longroles,$logmsg,$clonemsg,$newusermsg,$addresult, |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype, |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype, |
Line 1649 sub course_creation {
|
Line 1669 sub course_creation {
|
} |
} |
|
|
sub build_batchcreatehash { |
sub build_batchcreatehash { |
my ($dom,$context,$details,$owneremail,$domdefs) = @_; |
my ($dom,$cnum,$context,$details,$owneremail,$domdefs) = @_; |
my %batchhash; |
my %batchhash; |
my @items = qw{owner domain coursehome clonecrs clonedom datemode dateshift tinyurls enrollstart enrollend accessstart accessend sections users uniquecode}; |
my @items = qw{owner domain coursehome clonecrs clonedom datemode dateshift tinyurls enrollstart enrollend accessstart accessend sections users uniquecode}; |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
Line 1661 sub build_batchcreatehash {
|
Line 1681 sub build_batchcreatehash {
|
if (ref($details->{'crosslists'}) eq 'HASH') { |
if (ref($details->{'crosslists'}) eq 'HASH') { |
foreach my $key (keys(%{$details->{'crosslists'}})) { |
foreach my $key (keys(%{$details->{'crosslists'}})) { |
if (ref($details->{'crosslists'}->{$key}) eq 'HASH') { |
if (ref($details->{'crosslists'}->{$key}) eq 'HASH') { |
$batchhash{'crosslists'}{$key}{'inst'} = $details->{crosslists}->{$key}->{instcode}.$details->{crosslists}->{$key}->{instsec}; |
my $instsec = $details->{crosslists}->{$key}->{instsec}; |
|
$batchhash{'crosslists'}{$key}{'inst'} = $details->{crosslists}->{$key}->{instcode}; |
|
my $crskey = $cnum.':'.$batchhash{'crosslists'}{$key}{'inst'}; |
|
my %formatted = &Apache::lonnet::auto_instsec_reformat($dom,'clutter', |
|
{$crskey => [$instsec]}); |
|
if (ref($formatted{$crskey}) eq 'ARRAY') { |
|
$batchhash{'crosslists'}{$key}{'inst'} .= $formatted{$crskey}->[0]; |
|
} |
$batchhash{'crosslists'}{$key}{'loncapa'} = $details->{crosslists}->{$key}->{loncapa}; |
$batchhash{'crosslists'}{$key}{'loncapa'} = $details->{crosslists}->{$key}->{loncapa}; |
} |
} |
} |
} |
Line 1678 sub build_batchcreatehash {
|
Line 1705 sub build_batchcreatehash {
|
$batchhash{'authparam'} = $domdefs->{'auth_arg_def'}; |
$batchhash{'authparam'} = $domdefs->{'auth_arg_def'}; |
if ($details->{'crstype'} eq 'community') { |
if ($details->{'crstype'} eq 'community') { |
$batchhash{'crstype'} = 'Community'; |
$batchhash{'crstype'} = 'Community'; |
|
} elsif ($details->{'crstype'} eq 'placement') { |
|
$batchhash{'crstype'} = 'Placement'; |
} else { |
} else { |
if ($details->{'crstype'} eq 'textbook') { |
if ($details->{'crstype'} eq 'textbook') { |
if ($details->{'clonecrs'} && $details->{'clonedom'}) { |
if ($details->{'clonecrs'} && $details->{'clonedom'}) { |