--- loncom/interface/createaccount.pm 2012/05/01 14:20:10 1.40.2.5.2.16 +++ loncom/interface/createaccount.pm 2012/05/01 16:09:26 1.40.2.5.2.17 @@ -3,7 +3,7 @@ # institutional log-in ID (institutional authentication required - localauth # or kerberos) or an e-mail address. # -# $Id: createaccount.pm,v 1.40.2.5.2.16 2012/05/01 14:20:10 raeburn Exp $ +# $Id: createaccount.pm,v 1.40.2.5.2.17 2012/05/01 16:09:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -697,7 +697,7 @@ sub process_mailtoken { } my %form = &start_session($r,$data{'username'},$domain, $lonhost,$data{'courseid'}, - $token); + $token,'new'); $nostart = 1; $noend = 1; } else { @@ -724,7 +724,7 @@ sub process_mailtoken { } sub start_session { - my ($r,$username,$domain,$lonhost,$courseid,$token) = @_; + my ($r,$username,$domain,$lonhost,$courseid,$token,$usertype) = @_; my %form = ( uname => $username, udom => $domain, @@ -735,6 +735,9 @@ sub start_session { if ($courseid ne '') { $form{'courseid'} = $courseid; $firsturl = '/adm/selfenroll?courseid='.$courseid; + if ($usertype) { + $firsturl .= '&usertype='.$usertype; + } } } if ($r->dir_config('lonBalancer') eq 'yes') { @@ -1144,7 +1147,7 @@ sub username_activation { if ($result eq 'ok') { my $delete = &Apache::lonnet::tmpdel($env{'form.authtoken'}); $output = &mt('A LON-CAPA account has been created for username: [_1] in domain: [_2].',$username,$domain); - my %form = &start_session($r,$username,$domain,$lonhost,$courseid); + my %form = &start_session($r,$username,$domain,$lonhost,$courseid,undef,'new'); my $nostart = 1; return ('ok',$output,$nostart); } else {