--- loncom/interface/selfenroll.pm 2014/04/02 16:51:11 1.29 +++ loncom/interface/selfenroll.pm 2014/04/04 23:06:32 1.30 @@ -1,7 +1,7 @@ # The LearningOnline Network # Allow users to self-enroll in a course # -# $Id: selfenroll.pm,v 1.29 2014/04/02 16:51:11 raeburn Exp $ +# $Id: selfenroll.pm,v 1.30 2014/04/04 23:06:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -562,7 +562,7 @@ sub store_selfenroll_request { }); my $token; if ($status eq 'pending') { - $token = &Apache::lonnet::tmpput(\%selfenroll,$lonhost);; + $token = &Apache::lonnet::tmpput(\%selfenroll,$lonhost); $userenroll{$cdom.'_'.$cnum}{'token'} = $token; $userenroll{$cdom.'_'.$cnum}{'lonhost'} = $lonhost; $userenroll{$cdom.'_'.$cnum}{'handle'} = $handle; @@ -583,11 +583,13 @@ sub store_selfenroll_request { 'token' => $token, ); my %domconfig = &Apache::lonnet::get_dom('configuration',['selfenrollment'],$cdom); + if (ref($domconfig{'selfenrollment'}) eq 'HASH') { my ($url,$buttontext,$code,@fields); if (ref($domconfig{'selfenrollment'}{'validation'}) eq 'HASH') { my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum,{ 'one_time' => 1}); $postvalues{'uniquecode'} = $courseinfo{'internal.uniquecode'}; + $postvalues{'description'} = $courseinfo{'description'}; $url = $domconfig{'selfenrollment'}{'validation'}{'url'}; if (ref($domconfig{'selfenrollment'}{'validation'}{'fields'}) eq 'ARRAY') { @fields = @{$domconfig{'selfenrollment'}{'validation'}{'fields'}}; @@ -602,15 +604,21 @@ sub store_selfenroll_request { $output .= ''."\n"; } } - } - if ($buttontext eq '') { - $buttontext = &mt('Complete my enrollment'); - } - $output .= ''."\n". - ''."\n"; + if ($buttontext eq '') { + $buttontext = &mt('Complete my enrollment'); + } + my $protocol = $Apache::lonnet::protocol{$lonhost}; + $protocol = 'http' if ($protocol ne 'https'); + my $enroller = $protocol.'://'.&Apache::lonnet::hostname($lonhost).'/cgi-bin/enrollqueued.pl'; + $output .= ''."\n". + ''."\n". + ''."\n"; + } else { + $status = 'request'; + } } } else { - $status eq 'request'; + $status = 'request'; } } if ($status eq 'request') {