--- loncom/auth/lonacc.pm 2002/03/26 16:05:01 1.29 +++ loncom/auth/lonacc.pm 2002/07/03 20:54:49 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.29 2002/03/26 16:05:01 www Exp $ +# $Id: lonacc.pm,v 1.34 2002/07/03 20:54:49 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -178,7 +178,18 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($query,['symb']); } if ($ENV{'form.symb'}) { - $symb=$ENV{'form.symb'}; + $symb=&Apache::lonnet::symbclean($ENV{'form.symb'}); + if (&Apache::lonnet::symbverify($symb,$requrl)) { + my ($map,$mid,$murl)=split(/\_\_\_/,$symb); + &Apache::lonnet::symblist($map,$murl => $mid, + 'last_known' => $murl); + } else { + $r->log_reason('Invalid symb for '.$requrl.': '. + $symb); + $ENV{'user.error.msg'}= + "$requrl:bre:1:1:Invalid Access"; + return HTTP_NOT_ACCEPTABLE; + } } else { $symb=&Apache::lonnet::symbread; } @@ -205,10 +216,17 @@ sub handler { $ENV{'request.filename'} = $r->filename; return OK; } -# ----------------------------------------------- Store where they wanted to go - - $ENV{'request.firsturl'}=$requrl; - return FORBIDDEN; +# -------------------------------------------------------------- Not authorized + $requrl=~/\.(\w+)$/; + if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || + ($requrl=~/^\/adm\/(roles|logout)/)) { +# -------------------------- Store where they wanted to go and get login screen + $ENV{'request.firsturl'}=$requrl; + return FORBIDDEN; + } else { +# --------------------------------------------------------------------- Goodbye + return HTTP_BAD_REQUEST; + } } 1;