--- loncom/interface/lonmsg.pm 2004/03/31 05:24:00 1.96 +++ loncom/interface/lonmsg.pm 2004/05/10 22:39:51 1.100 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.96 2004/03/31 05:24:00 albertel Exp $ +# $Id: lonmsg.pm,v 1.100 2004/05/10 22:39:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -172,13 +172,15 @@ sub unpackagemsg { } } if ($content{'attachmenturl'}) { - my ($fname,$ft)=($content{'attachmenturl'}=~/\/(\w+)\.(\w+)$/); + my ($fname)=($content{'attachmenturl'}=~m|/([^/]+)$|); if ($notoken) { - $content{'message'}.='

'.&mt('Attachment').': '.$fname.'.'.$ft.''; + $content{'message'}.='

'.&mt('Attachment').': '.$fname.''; } else { - $content{'message'}.='

'.&mt('Attachment').': '.$fname.'.'.$ft.''; + &Apache::lonnet::allowuploaded('/adm/msg', + $content{'attachmenturl'}); + $content{'message'}.='

'.&mt('Attachment'). + ': '. + $fname.''; } } return %content; @@ -205,7 +207,7 @@ sub sendemail { my $msg = new Mail::Send; $msg->to($to); $msg->subject('[LON-CAPA] '.$subject); - if (my $fh = $msg->open('smtp',Server => 'localhost')) { + if (my $fh = $msg->open()) { print $fh $body; $fh->close; } @@ -911,6 +913,7 @@ ENDUPLOAD sub disfacetoface { my ($r,$user,$domain)=@_; + my $target=$ENV{'form.grade_target'}; unless ($ENV{'request.course.id'}) { return; } unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { return; @@ -944,7 +947,11 @@ $content{'sendername'}.'@'. } # Check to see if there were any messages. if ($result eq '') { - $r->print("

".&mt("No notes, face-to-face discussion records, or critical messages in this course.")."

"); + if ($target ne 'tex') { + $r->print("

".&mt("No notes, face-to-face discussion records, or critical messages in this course.")."

"); + } else { + $r->print('\textbf{'.&mt("No notes, face-to-face discussion records, or critical messages in this course.").'}\\\\'); + } } else { $r->print($result); }