--- loncom/auth/lonroles.pm 2001/05/03 17:54:12 1.24 +++ loncom/auth/lonroles.pm 2001/06/02 16:14:40 1.26 @@ -9,7 +9,7 @@ # 12/08,12/28, # 01/15/01 Gerd Kortemeyer # 02/27/01 Scott Harrison -# 03/02,05/03 Gerd Kortemeyer +# 03/02,05/03,05/25,05/30,06/01 Gerd Kortemeyer package Apache::lonroles; @@ -18,6 +18,7 @@ use Apache::lonnet(); use Apache::lonuserstate(); use Apache::Constants qw(:common); use Apache::File(); +use Apache::lonmenu; sub handler { @@ -58,7 +59,7 @@ sub handler { my ($cdom,$cnum,$csec)=split(/\//,$where); &Apache::lonnet::appenv('request.role' => $trolecode, 'request.course.sec' => $csec); - if ($cnum) { + if (($cnum) && ($role ne 'ca')) { my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum); if (($ENV{'form.orgurl'}) && @@ -68,12 +69,16 @@ sub handler { } else { $r->content_type('text/html'); $r->send_http_header; + my $swinfo=&Apache::lonmenu::rawconfig; print (<Entering Course + Entering course ... @@ -94,12 +99,17 @@ ENDREDIR $r->send_http_header; return OK if $r->header_only; + my $swinfo=&Apache::lonmenu::rawconfig; + $r->print(< LON-CAPA User Roles - + ENDHEADER # ------------------------------------------ Get Error Message from Environment @@ -130,6 +140,11 @@ ENDHEADER $r->print("Action : $msg\n
"); } else { $r->print("

LON-CAPA User Roles

"); + if ($ENV{'user.error.msg'}) { + $r->print( + '

You need to choose another user role or '. + 'enter a specific course for this function

'); + } } # -------------------------------------------------------- Choice or no choice? if ($nochoose) {