--- loncom/homework/daxesave.pm 2015/12/03 20:40:27 1.1 +++ loncom/homework/daxesave.pm 2015/12/10 16:26:43 1.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Convert and save a problem from Daxe. # -# $Id: daxesave.pm,v 1.1 2015/12/03 20:40:27 damieng Exp $ +# $Id: daxesave.pm,v 1.2 2015/12/10 16:26:43 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,6 +41,8 @@ use Apache::xml_to_loncapa; sub handler { my $request = shift; + $request->content_type('text/plain'); + my $path = $env{'form.path'}; # should be in the form "/daxeopen/priv/..." $path =~ s/^\/daxeopen//; @@ -56,8 +58,10 @@ sub handler { } } unless ($allowed) { - $request->log_reason("Unauthorized path: $path", $path); - return HTTP_NOT_ACCEPTABLE; + $request->log_reason("Unauthorized path: $path", $path); + $request->print("error\nUnauthorized path: $path"); + $request->status(403); + return OK; } my $newpath = &Apache::lonnet::filelocation('', $path);