--- loncom/auth/lonroles.pm 2000/09/30 19:19:34 1.8 +++ loncom/auth/lonroles.pm 2000/10/04 15:29:50 1.11 @@ -5,7 +5,7 @@ # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer) # 11/23 Gerd Kortemeyer) # 1/14,03/06,06/01,07/22,07/24,07/25, -# 09/04,09/06,09/28,09/29,09/30 Gerd Kortemeyer +# 09/04,09/06,09/28,09/29,09/30,10/2 Gerd Kortemeyer # package Apache::lonroles; @@ -16,24 +16,14 @@ use Apache::Constants qw(:common); use Apache::File(); sub handler { - my $r = shift; - $r->content_type('text/html'); - $r->send_http_header; - return OK if $r->header_only; -# ---------------------------------------------------------------- Print Header - $r->print(< - -LON-CAPA User Roles - - -ENDHEADER + my $r = shift; my $now=time; my $then=$ENV{'user.login.time'}; my $envkey; + # ================================================================== Roles Init if ($ENV{'form.selectrole'}) { @@ -58,18 +48,32 @@ ENDHEADER &Apache::lonnet::appenv('request.role' => $trolecode); my ($cdom,$cnum)=split(/\//,$where); if ($cnum) { - $r->print( &Apache::lonuserstate::readmap($where) ); + &Apache::lonuserstate::readmap($where); + if ($ENV{'form.orgurl'}) { + $r->internal_redirect($ENV{'form.orgurl'}); + return OK; + } } } } } } - - $r->print('

Role not active

'); - return OK; } + + # =============================================================== No Roles Init + $r->content_type('text/html'); + $r->send_http_header; + return OK if $r->header_only; + + $r->print(< + +LON-CAPA User Roles + +ENDHEADER + # ------------------------------------------ Get Error Message from Environment my ($fn,$priv,$nochoose,$error,$msg)=split(/:/,$ENV{'user.error.msg'}); @@ -121,7 +125,7 @@ ENDHEADER } else { $r->print("

Enter a Course

\n"); } - $r->print('
'); + $r->print(''); $r->print(''); $r->print(''); }