--- loncom/auth/lonroles.pm 2005/12/20 19:07:10 1.141 +++ loncom/auth/lonroles.pm 2006/01/06 21:04:33 1.145 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.141 2005/12/20 19:07:10 albertel Exp $ +# $Id: lonroles.pm,v 1.145 2006/01/06 21:04:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -271,8 +271,13 @@ 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{'request.role.adv'}) { + } elsif ($env{'request.course.id'}) { + if (&Apache::lonnet::allowed('whn', + $env{'request.course.id'}) + || &Apache::lonnet::allowed('whn', + $env{'request.course.id'}.'/' + .$env{'request.course.sec'}) + ) { my $startpage = &courseloadpage($courseid); unless ($startpage eq 'firstres') { $msg = &mt('Entering course ....'); @@ -530,11 +535,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}; @@ -1032,11 +1033,10 @@ sub set_privileges { sub courseloadpage { my ($courseid) = @_; my $startpage; - my %entry_settings = - &Apache::lonnet::dump('nohist_whatsnew',$env{'user.domain'}, - $env{'user.name'},$courseid.':courseinit'); + my %entry_settings = &Apache::lonnet::get('nohist_whatsnew', + [$courseid.':courseinit']); my ($tmp) = %entry_settings; - unless ($tmp =~ /^Error/) { + unless ($tmp =~ /^error: 2 /) { $startpage = $entry_settings{$courseid.':courseinit'}; } if ($startpage eq '') { 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.