version 1.52.2.2, 2016/10/23 20:55:41
|
version 1.52.2.3.2.1, 2020/01/13 17:19:09
|
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 656 sub update_request_queue {
|
Line 656 sub update_request_queue {
|
$beneficiary = 'enroller'; |
$beneficiary = 'enroller'; |
$cid = $env{'request.course.id'}; |
$cid = $env{'request.course.id'}; |
$crstype = lc(&Apache::loncommon::course_type()); |
$crstype = lc(&Apache::loncommon::course_type()); |
$firsturl = &course_portal_url($cnum,$cdom); |
$firsturl = &Apache::lonnet::course_portal_url($cnum,$cdom); |
%requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum); |
%requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum); |
$access_start = $env{'course.'.$cid.'.internal.selfenroll_start_access'}; |
$access_start = $env{'course.'.$cid.'.internal.selfenroll_start_access'}; |
$access_end = $env{'course.'.$cid.'.internal.selfenroll_end_access'}; |
$access_end = $env{'course.'.$cid.'.internal.selfenroll_end_access'}; |
Line 685 sub update_request_queue {
|
Line 685 sub update_request_queue {
|
} |
} |
} |
} |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
$firsturl = &course_portal_url($domconfiguser,$cdom); |
$firsturl = &Apache::lonnet::course_portal_url($domconfiguser,$cdom); |
$approvedmsg = [{ |
$approvedmsg = [{ |
mt => 'Your request for Authoring Space has been approved.', |
mt => 'Your request for Authoring Space has been approved.', |
}, |
}, |
Line 710 sub update_request_queue {
|
Line 710 sub update_request_queue {
|
} |
} |
} |
} |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
$firsturl = &course_portal_url($domconfiguser,$cdom); |
$firsturl = &Apache::lonnet::course_portal_url($domconfiguser,$cdom); |
$approvedmsg = [{ |
$approvedmsg = [{ |
mt => 'Your request for a LON-CAPA account has been approved.', |
mt => 'Your request for a LON-CAPA account has been approved.', |
}, |
}, |
Line 879 sub update_request_queue {
|
Line 879 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 893 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 942 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 985 sub update_request_queue {
|
Line 1004 sub update_request_queue {
|
} else { |
} else { |
$approvedmsg = $approvalmsg{'course'}; |
$approvedmsg = $approvalmsg{'course'}; |
} |
} |
my $firsturl = &course_portal_url($cnum,$cdom); |
my $firsturl = &Apache::lonnet::course_portal_url($cnum,$cdom); |
if (ref($approvedmsg) eq 'ARRAY') { |
if (ref($approvedmsg) eq 'ARRAY') { |
if (ref($approvedmsg->[1]) eq 'HASH') { |
if (ref($approvedmsg->[1]) eq 'HASH') { |
$approvedmsg->[1]->{'args'} = [$firsturl]; |
$approvedmsg->[1]->{'args'} = [$firsturl]; |
Line 1569 sub update_request_queue {
|
Line 1588 sub update_request_queue {
|
return $output; |
return $output; |
} |
} |
|
|
sub course_portal_url { |
|
my ($cnum,$cdom) = @_; |
|
my $chome = &Apache::lonnet::homeserver($cnum,$cdom); |
|
my $hostname = &Apache::lonnet::hostname($chome); |
|
my $protocol = $Apache::lonnet::protocol{$chome}; |
|
$protocol = 'http' if ($protocol ne 'https'); |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); |
|
my $firsturl; |
|
if ($domdefaults{'portal_def'}) { |
|
$firsturl = $domdefaults{'portal_def'}; |
|
} else { |
|
$firsturl = $protocol.'://'.$hostname; |
|
} |
|
return $firsturl; |
|
} |
|
|
|
sub get_student_counts { |
sub get_student_counts { |
my ($cdom,$cnum) = @_; |
my ($cdom,$cnum) = @_; |
my (%idx,%stucounts); |
my (%idx,%stucounts); |
Line 2098 sub process_official_reqs {
|
Line 2101 sub process_official_reqs {
|
my $cid = $dom.'_'.$cnum; |
my $cid = $dom.'_'.$cnum; |
push(@{$newcids{$instcode}},$cid); |
push(@{$newcids{$instcode}},$cid); |
if ($dcname && $dcdom) { |
if ($dcname && $dcdom) { |
my $firsturl = &course_portal_url($cnum,$dom); |
my $firsturl = &Apache::lonnet::course_portal_url($cnum,$dom); |
my $beneficiary = 'pendingrequestor'; |
my $beneficiary = 'pendingrequestor'; |
my $now = time; |
my $now = time; |
my $owner = $ownername.':'.$ownerdom; |
my $owner = $ownername.':'.$ownerdom; |