--- loncom/interface/lonchat.pm 2002/08/08 13:44:17 1.3 +++ loncom/interface/lonchat.pm 2005/04/07 06:56:22 1.10 @@ -1,7 +1,7 @@ # The LearningOnline Network # Chat # -# $Id: lonchat.pm,v 1.3 2002/08/08 13:44:17 www Exp $ +# $Id: lonchat.pm,v 1.10 2005/04/07 06:56:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -29,27 +29,37 @@ package Apache::lonchat; use strict; -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); +use Apache::loncommon; +use Apache::lonnet; sub handler { my $r = shift; - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; + if (! &Apache::lonnet::allowed('plc',$env{'request.course.id'}. + ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'') + )) { + return HTTP_NOT_ACCEPTABLE; + } - if ($ENV{'form.newentry'}) { - &Apache::lonnet::chatsend($ENV{'form.newchat'},$ENV{'form.anonymous'}); + if ($env{'form.newchat'}) { + &Apache::lonnet::chatsend(&Apache::lonfeedback::clear_out_html($env{'form.newchat'}),$env{'form.anonymous'}); } # --------------------------------------------------- Print login screen header + my $latexHelp = Apache::loncommon::helpLatexCheatsheet(); + my $html=&Apache::lonxml::xmlbegin(); $r->print(< +$html The LearningOnline Network with CAPA - -
+ + +$latexHelp - +