--- loncom/auth/loncacc.pm 2002/12/10 20:37:21 1.24 +++ loncom/auth/loncacc.pm 2003/05/06 21:45:25 1.27 @@ -2,7 +2,7 @@ # Cookie Based Access Handler for Construction Area # (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer) # -# $Id: loncacc.pm,v 1.24 2002/12/10 20:37:21 matthew Exp $ +# $Id: loncacc.pm,v 1.27 2003/05/06 21:45:25 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,6 @@ # YEAR=2001 # 01/06,01/11,6/1,9/25,9/28,11/22,12/25,12/26, # 01/06/01,05/04,05/05,05/09 Gerd Kortemeyer -# 12/21 Scott Harrison # YEAR=2002 # 1/4 Gerd Kortemeyer ### @@ -39,7 +38,7 @@ package Apache::loncacc; use strict; -use Apache::Constants qw(:common :http :methods); +use Apache::Constants qw(:common :http :methods REDIRECT); use Apache::File; use CGI::Cookie(); use Fcntl qw(:flock); @@ -100,13 +99,22 @@ sub handler { $r->log_reason("Unauthorized $requrl", $r->filename); return HTTP_NOT_ACCEPTABLE; } +# Construction space needs Remote to work + if ($ENV{'environment.remote'} eq 'off') { + $r->content_type('text/html'); + $r->header_out(Location => + 'http://'.$r->server->server_hostname. + '/adm/remote?action=launch&url='. + &Apache::lonnet::escape($requrl)); + return REDIRECT; + } # -------------------------------------------------------- Load POST parameters my $buffer; - $r->read($buffer,$r->header_in('Content-length')); + $r->read($buffer,$r->header_in('Content-length'),0); unless ($buffer=~/^(\-+\w+)\s+Content\-Disposition\:\s*form\-data/si) { my @pairs=split(/&/,$buffer);