--- loncom/auth/lonroles.pm 2005/12/20 15:47:07 1.140 +++ loncom/auth/lonroles.pm 2006/01/03 17:46:35 1.143 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.140 2005/12/20 15:47:07 raeburn Exp $ +# $Id: lonroles.pm,v 1.143 2006/01/03 17:46:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -271,8 +271,9 @@ ENDENTERKEY '.course.helper.not.run'}) { $furl = "/adm/helper/course.initialization.helper"; # Send the user to the course they selected - } elsif ($env{'request.course.fn'}) { - if ($env{'user.adv'}) { + } elsif ($env{'request.course.id'}) { + if (&Apache::lonnet::allowed('whn', + $env{'request.course.id'})) { my $startpage = &courseloadpage($courseid); unless ($startpage eq 'firstres') { $msg = &mt('Entering course ....'); @@ -530,11 +531,7 @@ ENDHEADER foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } if (!$allowed) { $button=0; - $switchserver=&Apache::lonnet::escape('http://'. - $Apache::lonnet::hostname{$home}. - '/adm/login?domain='.$env{'user.domain'}. - '&username='.$env{'user.name'}. - '&firsturl=/priv/'.$env{'user.name'}.'/'); + $switchserver='otherserver='.$home.'&role='.$trolecode; } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home};