--- loncom/auth/lonacc.pm 2000/06/05 20:28:17 1.6 +++ loncom/auth/lonacc.pm 2000/09/15 15:04:17 1.8 @@ -1,12 +1,12 @@ # The LearningOnline Network # Cookie Based Access Handler # 5/21/99,5/22,5/29,5/31,6/15,16/11,22/11, -# 01/06,01/13,05/31,06/01 Gerd Kortemeyer +# 01/06,01/13,05/31,06/01,09/06 Gerd Kortemeyer package Apache::lonacc; use strict; -use Apache::Constants qw(:common :http); +use Apache::Constants qw(:common :http :methods); use Apache::File; use Apache::lonnet; use CGI::Cookie(); @@ -43,6 +43,8 @@ sub handler { # -------------------------------------------------------- Load POST parameters + + my $buffer; $r->read($buffer,$r->header_in('Content-length')); @@ -55,14 +57,22 @@ sub handler { $r->subprocess_env("form.$name" => $value); } + $r->method_number(M_GET); + $r->method('GET'); + $r->headers_in->unset('Content-length'); # ---------------------------------------------------------------- Check access if ($requrl!~/^\/adm\//) { - if (&Apache::lonnet::allowed('bre',$requrl) eq '') { - $ENV{'user.error.msg'}="$requrl:bre:1:1:Access denied"; - return HTTP_NOT_ACCEPTABLE; - } + my $access=&Apache::lonnet::allowed('bre',$requrl); + if ($access eq '1') { + $ENV{'user.error.msg'}="$requrl:bre:0:0:Choose Course"; + return HTTP_NOT_ACCEPTABLE; + } + if (($access ne '2') && ($access ne 'F')) { + $ENV{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; + return HTTP_NOT_ACCEPTABLE; + } } return OK; } else {