-
-
@@ -2233,6 +2238,7 @@ sub no_redirect_back {
my $nofeed=&mt('Sorry, no feedback possible on this resource ...');
my %body_options = ('only_body' => 1,
+ 'bgcolor' => '#FFFFFF',
'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"});
if ($feedurl !~ m{^/adm/feedback}) {
@@ -2247,8 +2253,7 @@ sub no_redirect_back {
$feedurl=&Apache::lonenc::check_encrypt($feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
$r->print (<
-
+$start_page
$nofeed
@@ -2284,7 +2289,7 @@ sub screen_header {
'';
}
}
- if ($env{'request.course.id'}) {
+ if (($env{'request.course.id'}) && (!$env{'form.sendmessageonly'})) {
if (&discussion_open(undef,$symb) &&
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
@@ -2320,8 +2325,9 @@ sub resource_output {
}
sub clear_out_html {
- my ($message,$override)=@_;
- unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
+ my ($message,$override,$ignore_htmlarea)=@_;
+ if (!$ignore_htmlarea
+ && !&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
# Always allow the -tag
my %html=(M=>1);
# Check if more is allowed
@@ -2337,9 +2343,9 @@ sub clear_out_html {
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
}
# Do the substitution of everything that is not explicitly allowed
- $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
+ $message =~ s/\<(\/?\s*(\w*)[^\>\<]*)/
{($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge;
- $message =~ s/(\\s*(\w+)[^\<\>]*)\>/
+ $message =~ s/(\\s*(\w*)[^\<\>]*)\>/
{($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge;
return $message;
}
@@ -2608,7 +2614,7 @@ sub show_preview {
&newline_to_br(\$message);
$message=&Apache::lonspeller::markeduptext($message);
$message=&Apache::lontexconvert::msgtexconverted($message);
- my $subject=&clear_out_html($env{'form.subject'});
+ my $subject=&clear_out_html($env{'form.subject'},undef,1);
$subject=~s/\n/\ /g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
my $start_page=
@@ -2662,7 +2668,7 @@ ENDPREVIEW
sub modify_attachments {
my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;
my $orig_subject = &Apache::lonnet::unescape($env{'form.subject'});
- my $subject=&clear_out_html($orig_subject);
+ my $subject=&clear_out_html($orig_subject,undef,1);
$subject=~s/\n/\ /g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
my $timestamp=$env{'form.timestamp'};
@@ -2975,7 +2981,7 @@ sub handler {
# --------------------------- Get query string for limited number of parameters
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']);
+ ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly']);
if ($env{'form.editdisc'}) {
if (!(&editing_allowed())) {
my $symb=(split(/\:\:\:/,$env{'form.editdisc'}))[0];
@@ -3405,14 +3411,16 @@ ENDREDIR
my ($typestyle,%to) = &decide_receiver($feedurl);
# Actually send mail
- my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),$feedurl,$email,$citations,
+ my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'},
+ undef,1),
+ $feedurl,$email,$citations,
$attachmenturl,%to);
# Discussion? Store that.
my $numpost=0;
if ($env{'form.discuss'} || $env{'form.anondiscuss'}) {
- my $subject = &clear_out_html($env{'form.subject'});
+ my $subject = &clear_out_html($env{'form.subject'},undef,1);
my $anonmode=(defined($env{'form.anondiscuss'}));
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
$subject);
@@ -3423,7 +3431,7 @@ ENDREDIR
my $blog='';
if ($env{'form.blog'}) {
- my $subject = &clear_out_html($env{'form.subject'});
+ my $subject = &clear_out_html($env{'form.subject'},undef,1);
$status.=&Apache::lonrss::addentry($env{'user.name'},
$env{'user.domain'},
'CourseBlog_'.$env{'request.course.id'},