--- loncom/auth/lonroles.pm 2000/10/02 21:34:58 1.9 +++ loncom/auth/lonroles.pm 2000/10/04 14:09:01 1.10 @@ -16,27 +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 - if ($ENV{'form.orgurl'}) { - $r->print(''); - } - $r->print(''); + my $r = shift; my $now=time; my $then=$ENV{'user.login.time'}; my $envkey; + # ================================================================== Roles Init if ($ENV{'form.selectrole'}) { @@ -62,19 +49,29 @@ ENDHEADER my ($cdom,$cnum)=split(/\//,$where); if ($cnum) { &Apache::lonuserstate::readmap($where); - $r->print('

Role initialized

'); + $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'});