version 1.25.2.1, 2010/01/18 15:58:25
|
version 1.27, 2012/05/16 21:19:39
|
Line 54 sub handler {
|
Line 54 sub handler {
|
&Apache::lonlocal::get_language_handle($r); |
&Apache::lonlocal::get_language_handle($r); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['courseid']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['courseid']); |
my $js = &Apache::createaccount::catreturn_js(); |
my $js = &Apache::createaccount::catreturn_js(); |
my ($coursechk,$courseid) = &validate_course_id($env{'form.courseid'}); |
|
if ($coursechk ne 'ok') { |
my $courseid = Apache::lonnet::is_course($env{'form.courseid'}); |
&page_header($r,$courseid,$js); |
|
|
unless ($courseid) { |
|
&page_header($r,$env{'form.courseid'},$js); |
$r->print('<h3>'.&mt('Self-enrollment error').'</h3>'. |
$r->print('<h3>'.&mt('Self-enrollment error').'</h3>'. |
'<span class="LC_error">'. |
'<span class="LC_error">'. |
&mt('Invalid domain or course number').'</span>'); |
&mt('Invalid domain or course number').'</span>'); |
Line 342 sub enrollment_limit_check {
|
Line 344 sub enrollment_limit_check {
|
sub page_header { |
sub page_header { |
my ($r,$courseid,$js,$desc) = @_; |
my ($r,$courseid,$js,$desc) = @_; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Self-enroll in a LON-CAPA course',$js, |
&Apache::loncommon::start_page('Self-enroll in a LON-CAPA course',$js); |
{'no_inline_link' => 1,}); |
|
$r->print($start_page); |
$r->print($start_page); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::createaccount::selfenroll_crumbs($r,$courseid,$desc); |
&Apache::createaccount::selfenroll_crumbs($r,$courseid,$desc); |
Line 359 sub page_footer {
|
Line 360 sub page_footer {
|
return; |
return; |
} |
} |
|
|
sub validate_course_id { |
|
my ($courseid) = @_; |
|
my ($cdom,$cnum) = ($env{'form.courseid'} =~ /^($match_domain)_($match_courseid)$/); |
|
if ($cdom ne '' && $cnum ne '') { |
|
if (&Apache::lonnet::is_course($cdom,$cnum)) { |
|
return ('ok',$courseid); |
|
} |
|
} |
|
return; |
|
} |
|
|
|
sub user_is_known { |
sub user_is_known { |
my $known = 0; |
my $known = 0; |
if ($env{'user.name'} ne '' && $env{'user.name'} ne 'public' |
if ($env{'user.name'} ne '' && $env{'user.name'} ne 'public' |
Line 564 sub store_selfenroll_request {
|
Line 554 sub store_selfenroll_request {
|
} |
} |
$output = &mt('Your request for self-enrollment has been recorded.').'<br />'. |
$output = &mt('Your request for self-enrollment has been recorded.').'<br />'. |
&mt('A message will be sent to your LON-CAPA account when the course coordinator takes action on your request.').'<br />'. |
&mt('A message will be sent to your LON-CAPA account when the course coordinator takes action on your request.').'<br />'. |
&mt('To access your LON-CAPA message, go to the Main Menu and click on "Send and Receive Messages".'); |
&mt('To access your LON-CAPA message, go to the Main Menu and click on "Send and Receive Messages".').'<br />'; |
my %emails = &Apache::loncommon::getemails($uname,$udom); |
my %emails = &Apache::loncommon::getemails($uname,$udom); |
if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) { |
if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) { |
my $address = $emails{'permanentemail'}; |
my $address = $emails{'permanentemail'}; |
Line 577 sub store_selfenroll_request {
|
Line 567 sub store_selfenroll_request {
|
$output .= '<span class="LC_warning">'.$warning.'</span><br />'; |
$output .= '<span class="LC_warning">'.$warning.'</span><br />'; |
} |
} |
|
|
$output .= '<br />'.&Apache::loncoursequeueadmin::queued_selfenrollment(); |
$output .= &Apache::loncoursequeueadmin::queued_selfenrollment(); |
|
|
if ($selfenroll_notifylist) { |
if ($selfenroll_notifylist) { |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |