--- loncom/interface/lonmsgdisplay.pm 2015/02/12 21:22:07 1.180 +++ loncom/interface/lonmsgdisplay.pm 2021/11/30 16:16:14 1.195 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.180 2015/02/12 21:22:07 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.195 2021/11/30 16:16:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -102,6 +102,8 @@ use HTML::TokeParser(); use Apache::Constants qw(:common); use Apache::loncommon(); use Apache::lonhtmlcommon(); +use Apache::longroup; +use Apache::lonnavmaps; use Apache::lontexconvert(); use HTML::Entities(); use Apache::lonlocal; @@ -120,18 +122,23 @@ my $startdis=''; sub folderlist { my ($folder,$msgstatus) = @_; - my %lt = &Apache::lonlocal::texthash( + my %html_lt = &Apache::lonlocal::texthash( actn => 'Action', fold => 'Folder', show => 'Show', status => 'Message Status', go => 'Go', + + ); + &html_escape(\%html_lt); + my %js_lt = &Apache::lonlocal::texthash( nnff => 'New Name for Folder', newn => 'New Name', fmnb => 'Folder may not be renamed as it is a folder provided by the system.', asth => 'Requested name already in use for a system-provided or user-defined folder.', ); + &js_escape(\%js_lt); # set se lastvisit for the new mail check in the toplevel menu &Apache::lonnet::appenv({'user.mailcheck.lastvisit'=>time}); @@ -179,16 +186,16 @@ function folder_choice(targetform,caller if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') { for (var i=0; i'.&mt('Folder Actions').' - - - @@ -245,7 +252,7 @@ function folder_choice(targetform,caller '.&mt('New Folder').'
'."\n".' - @@ -768,22 +775,36 @@ sub groupmail_header { text=>"Groups", title=>$brtitle}); } - &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg", - text=>"Group: $description", - title=>"Go to group's home page"}, - {href=>"/adm/email?compose=group&group=". - "$env{'form.group'}&$refarg", - text=>"Send a Message in a Group", - title=>"Compose Group Message"},); + my $view_permission = + &Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); + my $navmap=Apache::lonnavmaps::navmap->new(); + my $grouppagelink = &Apache::longroup::get_group_link($cdom,$cnum,$group,$navmap,$view_permission,$refarg); + if ($grouppagelink) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>$grouppagelink, + text=>&mt('Group').": $description", + title=>&mt("Go to group's home page"), + no_mt=>1, + },); + } else { + &Apache::lonhtmlcommon::add_breadcrumb + ({text=>&mt('Group').": $description", + no_mt=>1,}); + } + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"/adm/email?compose=group&group=". + "$env{'form.group'}&$refarg", + text=>"Send a Message in a Group", + title=>"Compose Group Message"},); if ($action eq 'sending') { &Apache::lonhtmlcommon::add_breadcrumb ({text=>"Messages being sent.", title=>"E-mails sent"},); } my $groupheader = &Apache::loncommon::start_page('Group Message'); - $groupheader .= &Apache::lonhtmlcommon::breadcrumbs - ('Group - '.$env{'form.group'}.' Email'); + $groupheader .= &Apache::lonhtmlcommon::breadcrumbs( + &mt('Group messages - [_1]',$description), + undef,undef,undef,undef,1); return $groupheader; } @@ -844,7 +865,7 @@ sub discrit { .&Apache::lonhtmlcommon::row_closure(1); } $result .= &Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value') - .'
'.&Apache::lontexconvert::msgtexconverted($content{'message'}).'
' + .'
'.&Apache::lontexconvert::msgtexconverted($content{'message'}).'
' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value') .'
'; @@ -891,7 +912,7 @@ sub discrit { } sub sortedmessages { - my ($blocked,$startblock,$endblock,$numblocked,$folder,$msgstatus) = @_; + my ($blocked,$startblock,$endblock,$by_ip,$numblocked,$folder,$msgstatus) = @_; my $suffix=&Apache::lonmsg::foldersuffix($folder); my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix); #unpack the varibles and repack into temp for sorting @@ -923,7 +944,8 @@ sub sortedmessages { push(@temp1,$content{'recuser'},$content{'recdomain'}); } # Check whether message was sent during blocking period. - if ($sendtime >= $startblock && ($sendtime <= $endblock && $endblock > 0) ) { + if (($by_ip) || + (($sendtime >= $startblock) && ($sendtime <= $endblock && $endblock > 0))) { $$blocked{$msgid} = 'ON'; $$numblocked ++; } else { @@ -1050,12 +1072,15 @@ sub disfolder { my %blocked = (); my %setters = (); my $numblocked = 0; - my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com'); - my %lt = &Apache::lonlocal::texthash( + my $clientip = &Apache::lonnet::get_requestor_ip($r); + my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = + &Apache::loncommon::blockcheck(\%setters,'com',$clientip); + my %js_lt = &Apache::lonlocal::texthash( sede => 'Select a destination folder to which the messages will be moved.', nome => 'No messages have been selected to apply this action to.', chec => 'Check the checkbox for at least one message.', ); + &js_escape(\%js_lt); my $jscript = &Apache::loncommon::check_uncheck_jscript(); $r->print(< @@ -1066,7 +1091,7 @@ sub disfolder { document.disall.markedaction.value = document.disall.checkedaction.options[document.disall.checkedaction.selectedIndex].value; if (document.disall.checkedaction.options[document.disall.checkedaction.selectedIndex].value == 'markedmove') { if (document.disall.movetofolder.options[document.disall.movetofolder.selectedIndex].value == "") { - alert("$lt{'sede'}"); + alert("$js_lt{'sede'}"); return; } } @@ -1083,7 +1108,7 @@ sub disfolder { } } if (checktotal == 0) { - alert("$lt{'nome'}\\n$lt{'chec'}"); + alert("$js_lt{'nome'}\\n$js_lt{'chec'}"); return; } document.disall.submit(); @@ -1093,7 +1118,7 @@ sub disfolder { ENDDISHEADER my $fsqs='&folder='.$folder; - my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus); + my @temp=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus); my $totalnumber=$#temp+1; if ($totalnumber < 1) { $r->print('

'); @@ -1106,7 +1131,7 @@ ENDDISHEADER } $r->print('

'); if ($numblocked > 0) { - $r->print(&blocked_in_folder($numblocked,$startblock,$endblock, + $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom, \%setters)); } return; @@ -1296,20 +1321,26 @@ ENDDISHEADER $r->print(''); if ($numblocked > 0) { $r->print(&blocked_in_folder($numblocked,$startblock,$endblock, - \%setters)); + $by_ip,$clientip,$blockdom,\%setters)); } } sub blocked_in_folder { - my ($numblocked,$startblock,$endblock,$setters) = @_; - my $beginblock = &Apache::lonlocal::locallocaltime($startblock); - my $finishblock = &Apache::lonlocal::locallocaltime($endblock); - my $output = '

'. + my ($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom,$setters) = @_; + my $output; + if ($by_ip) { + $output = '

'. + &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages is blocked for your current IP address: [_2].',$numblocked,$clientip).'
'. + &mt('Note: communication is being blocked for certain IP address(es).'); + } else { + my $beginblock = &Apache::lonlocal::locallocaltime($startblock); + my $finishblock = &Apache::lonlocal::locallocaltime($endblock); + $output = '

'. &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock); + } #$output .= &Apache::loncommon::build_block_table($startblock,$endblock, # $setters); - - my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); + my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com",$clientip); $output .="

".$blocktext; return $output; @@ -1394,11 +1425,14 @@ sub compout { 'to' => 'To:', ); my %attachmax = ( - text => &mt('(128 KB max size)'), - num => 131072, + text => &mt('(1 MB max size)'), + num => 1048576, ); if (!$forwarding && !$multiforward) { - $attachrow = '
'; + $attachrow = ''; } if (&Apache::lonnet::allowed('srm',$env{'request.course.id'}) || &Apache::lonnet::allowed('srm',$env{'request.course.id'}. @@ -1953,7 +1987,7 @@ sub disfacetoface { &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('. $content{'sendername'}.':'. $content{'senderdomain'}.') '.$content{'time'}. - '
'.
+            '
'.
               &Apache::lontexconvert::msgtexconverted($content{'message'}).
 	      '
'; } @@ -2081,14 +2115,16 @@ sub displaymessage { my %setters = (); my $numblocked = 0; my $crstype = &Apache::loncommon::course_type(); + my $clientip = &Apache::lonnet::get_requestor_ip($r); # info to generate "next" and "previous" buttons and check if message is blocked - my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com'); - my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus); + my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = + &Apache::loncommon::blockcheck(\%setters,'com',$clientip); + my @messages=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus); if ( $blocked{$msgid} eq 'ON' ) { &printheader($r,'/adm/email',&mt('Display a Message')); #$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.')); - my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com"); + my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com",$clientip); $r->print("
".$blocktext); return; } @@ -2122,8 +2158,28 @@ sub displaymessage { my $number_of_messages = scalar(@messages); #subtract 1 for last index + my $head_extra; + +# if student's view of resource will be included +# get tag(s) for css file(s) in use, and pass to &header to include +# in call to loncommon::start_page() + + if (($env{'request.course.id'} eq $content{'courseid'}) && + (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { + my $symb; + if (defined($content{'symb'})) { + $symb = $content{'symb'}; + } elsif (defined($content{'baseurl'})) { + $symb=&Apache::lonnet::symbread($content{'baseurl'}); + } + if ($symb) { + $head_extra = &Apache::loncommon::css_links($symb); + } + } + # start output - &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'}); + &printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','', + $content{'baseurl'},$head_extra); # Prepare available functions my @functionlist; @@ -2168,7 +2224,8 @@ sub displaymessage { my @actionlist; if ($env{'user.adv'}) { - if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) { + if (($env{'request.course.id'}) && ($from_student) && + (&Apache::lonnet::allowed('vgr',$env{'request.course.id'}))) { push(@actionlist,&Apache::loncommon::track_student_link( 'View recent activity' ,$content{'sendername'} @@ -2471,7 +2528,7 @@ sub displaymessage { # Message $r->print(&Apache::lonhtmlcommon::row_title(&mt('Message')) - .'
'
+             .'
'
 	     .&Apache::lontexconvert::msgtexconverted($content{'message'},1)
 	     .'
' ); @@ -2631,6 +2688,13 @@ sub displayresource { } # Could not get a symb, give up unless ($symb) { return $content{'citation'}; } + if ($symb =~ /ext\.tool$/) { + return '

'.&mt('Current transactions for student (if applicable)').'

'. + &Apache::loncommon::get_previous_attempt($symb, + $content{'sendername'}, + $content{'senderdomain'}, + $content{'courseid'}); + } # Have a symb, can render return '

'.&mt('Current attempts of student (if applicable)').'

'. &Apache::loncommon::get_previous_attempt($symb, @@ -2656,11 +2720,16 @@ sub displayresource { # ================================================================== The Header sub header { - my ($r,$title,$baseurl)=@_; + my ($r,$title,$baseurl,$head_extra)=@_; my $extra = &Apache::loncommon::studentbrowser_javascript(); if ($baseurl) { $extra .= ""; } + $extra .= ''; + if ($head_extra) { + $extra .= "\n$head_extra"; + } $r->print(&Apache::loncommon::start_page('Messages', $extra)); $r->print(&Apache::lonhtmlcommon::breadcrumbs @@ -2670,11 +2739,11 @@ sub header { # ---------------------------------------------------------------- Print header sub printheader { - my ($r,$url,$desc,$title,$baseurl)=@_; + my ($r,$url,$desc,$title,$baseurl,$head_extra)=@_; &Apache::lonhtmlcommon::add_breadcrumb ({href=>$url, text=>$desc}); - &header($r,$title,$baseurl); + &header($r,$title,$baseurl,$head_extra); } # ------------------------------------------------------------ Store the comment @@ -2732,7 +2801,7 @@ sub sendoffmail { $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; } if ($env{'form.send'}) { - if (!$env{'form.multiforward'}) { + if (!$env{'form.multiforward'}) { if ($group eq '') { &printheader($r,'','Messages being sent.'); } else { @@ -2762,6 +2831,8 @@ sub sendoffmail { my $mode = $env{'form.sendmode'}; my (%toaddr,$tos,$cc,$bcc,$broadcast); + my (%willtrust,%trustchecked,%disallowed); + my $serverdefdom = &Apache::lonnet::default_login_domain(); if ($mode eq 'group') { if (defined($env{'form.courserecips'})) { @@ -2771,9 +2842,17 @@ sub sendoffmail { foreach my $dest (@to) { my ($user,$domain) = split(/:/, $dest); if (($user ne '') && ($domain ne '')) { - my $rec = $user.":".$domain; - $toaddr{$rec} = ''; - $broadcast->{$rec} = ''; + unless ($trustchecked{$domain}) { + $willtrust{$domain} = &Apache::lonnet::will_trust('msg',$serverdefdom,$domain); + $trustchecked{$domain} = 1; + } + if ($willtrust{$domain}) { + my $rec = $user.":".$domain; + $toaddr{$rec} = ''; + $broadcast->{$rec} = ''; + } else { + $disallowed{'to'}{$user.":".$domain} = 1; + } } } } @@ -2784,22 +2863,47 @@ sub sendoffmail { if ($txt) { $rec =~ s/^\s+//; $rec =~ s/\s+$//; - $toaddr{$rec}.=$txt."\n"; - $broadcast->{$rec} = ''; + my ($recuname,$recudom) = split(/:/,$rec); + unless ($trustchecked{$recudom}) { + $willtrust{$recudom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$recudom); + $trustchecked{$recudom} = 1; + } + if ($willtrust{$recudom}) { + $toaddr{$rec}.=$txt."\n"; + $broadcast->{$rec} = ''; + } else { + $disallowed{'to'}{$rec} = 1; + } } } } else { if (($env{'form.recuname'} ne '') && ($env{'form.recdomain'} ne '')) { - $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}=''; - $tos->{$env{'form.recuname'}.':'.$env{'form.recdomain'}}=''; + unless ($trustchecked{$env{'form.recdomain'}}) { + $willtrust{$env{'form.recdomain'}} = &Apache::lonnet::will_trust('msg',$serverdefdom,$env{'form.recdomain'}); + $trustchecked{$env{'form.recdomain'}} = 1; + } + if ($willtrust{$env{'form.recdomain'}}) { + $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}=''; + $tos->{$env{'form.recuname'}.':'.$env{'form.recdomain'}}=''; + } else { + $disallowed{'to'}{$env{'form.recuname'}.':'.$env{'form.recdomain'}}; + } } } if ($env{'form.additionalrec_to'}) { foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_to'})) { my ($auname,$audom)=split(/:/,$rec); if (($auname ne "") && ($audom ne "")) { - $toaddr{$auname.':'.$audom}=''; - $tos->{$auname.':'.$audom}=''; + unless ($trustchecked{$audom}) { + $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom); + $trustchecked{$audom} = 1; + } + if ($willtrust{$audom}) { + $toaddr{$auname.':'.$audom}=''; + $tos->{$auname.':'.$audom}=''; + } else { + $disallowed{'to'}{$auname.':'.$audom}; + } } } } @@ -2809,8 +2913,16 @@ sub sendoffmail { foreach my $rec (@toreplies) { my ($auname,$audom)=split(/:/,$rec); if (($auname ne "") && ($audom ne "")) { - $toaddr{$auname.':'.$audom}=''; - $tos->{$auname.':'.$audom}=''; + unless ($trustchecked{$audom}) { + $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom); + $trustchecked{$audom} = 1; + } + if ($willtrust{$audom}) { + $toaddr{$auname.':'.$audom}=''; + $tos->{$auname.':'.$audom}=''; + } else { + $disallowed{'to'}{$auname.':'.$audom}; + } } } } @@ -2818,9 +2930,17 @@ sub sendoffmail { foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_cc'})) { my ($auname,$audom)=split(/:/,$rec); if (($auname ne "") && ($audom ne "")) { - $toaddr{$auname.':'.$audom}=''; if (!defined($tos->{$auname.':'.$audom})) { - $cc->{$auname.':'.$audom}=''; + unless ($trustchecked{$audom}) { + $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom); + $trustchecked{$audom} = 1; + } + if ($willtrust{$audom}) { + $toaddr{$auname.':'.$audom}=''; + $cc->{$auname.':'.$audom}=''; + } else { + $disallowed{'cc'}{$auname.':'.$audom}; + } } } } @@ -2831,9 +2951,17 @@ sub sendoffmail { foreach my $rec (@ccreplies) { my ($auname,$audom)=split(/:/,$rec); if (($auname ne "") && ($audom ne "")) { - $toaddr{$auname.':'.$audom}=''; if (!defined($tos->{$auname.':'.$audom})) { - $cc->{$auname.':'.$audom}=''; + unless ($trustchecked{$audom}) { + $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom); + $trustchecked{$audom} = 1; + } + if ($willtrust{$audom}) { + $toaddr{$auname.':'.$audom}=''; + $cc->{$auname.':'.$audom}=''; + } else { + $disallowed{'cc'}{$auname.':'.$audom} = 1; + } } } } @@ -2844,9 +2972,17 @@ sub sendoffmail { foreach my $rec (@groupreplies) { my ($auname,$audom)=split(/:/,$rec); if (($auname ne "") && ($audom ne "")) { - $toaddr{$auname.':'.$audom}=''; if (!defined($tos->{$auname.':'.$audom})) { - $broadcast->{$auname.':'.$audom}=''; + unless ($trustchecked{$audom}) { + $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom); + $trustchecked{$audom} = 1; + } + if ($willtrust{$audom}) { + $toaddr{$auname.':'.$audom}=''; + $broadcast->{$auname.':'.$audom}=''; + } else { + $disallowed{'to'}{$auname.':'.$audom} = 1; + } } } } @@ -2855,10 +2991,18 @@ sub sendoffmail { foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_bcc'})) { my ($auname,$audom)=split(/:/,$rec); if (($auname ne "") && ($audom ne "")) { - $toaddr{$auname.':'.$audom}=''; - if ((!defined($tos->{$auname.':'.$audom})) && + if ((!defined($tos->{$auname.':'.$audom})) && (!defined($cc->{$auname.':'.$audom}))) { - $bcc->{$auname.':'.$audom}=''; + unless ($trustchecked{$audom}) { + $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom); + $trustchecked{$audom} = 1; + } + if ($willtrust{$audom}) { + $toaddr{$auname.':'.$audom}=''; + $bcc->{$auname.':'.$audom}=''; + } else { + $disallowed{'bcc'}{$auname.':'.$audom} = 1; + } } } } @@ -2878,42 +3022,42 @@ sub sendoffmail { } else { $savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'}); } - my %reciphash = ( - to => $tos, - cc => $cc, - bcc => $bcc, - ); - if ($mode eq 'group') { - if ($group eq '') { - $reciphash{'course_broadcast'} = $broadcast; - } else { - if ($env{'form.groupmail'} eq 'cc') { - $reciphash{'group_cc_broadcast'} = $broadcast; + my ($recipid, @recusers, @recudoms, %permresults); + if (keys(%toaddr) > 0) { + my %reciphash = ( + to => $tos, + cc => $cc, + bcc => $bcc, + ); + if ($mode eq 'group') { + if ($group eq '') { + $reciphash{'course_broadcast'} = $broadcast; } else { - $reciphash{'group_bcc_broadcast'} = $broadcast; + if ($env{'form.groupmail'} eq 'cc') { + $reciphash{'group_cc_broadcast'} = $broadcast; + } else { + $reciphash{'group_bcc_broadcast'} = $broadcast; + } } } - } - my ($recipid,$recipstatus) = - &Apache::lonmsg::store_recipients($msgsubj,$env{'user.name'}, - $env{'user.domain'},\%reciphash); - if ($recipstatus ne 'ok') { - &Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'}); - } - if ($env{'form.attachment'}) { - if (length($env{'form.attachment'})<131072) { - $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now); - } else { - $r->print('

'.&mt('Attachment not included - exceeded permitted length').'

'); - } - } elsif ($env{'form.multiforward'}) { - if ($env{'form.attachmenturl'} ne '') { - $attachmenturl = $env{'form.attachmenturl'}; + ($recipid,my $recipstatus) = + &Apache::lonmsg::store_recipients($msgsubj,$env{'user.name'}, + $env{'user.domain'},\%reciphash); + if ($recipstatus ne 'ok') { + &Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'}); + } + if ($env{'form.attachment'}) { + if (length($env{'form.attachment'}) <= 1048576) { + $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now); + } else { + $r->print('

'.&mt('Attachment not included - exceeded permitted length').'

'); + } + } elsif ($env{'form.multiforward'}) { + if ($env{'form.attachmenturl'} ne '') { + $attachmenturl = $env{'form.attachmenturl'}; + } } } - my @recusers; - my @recudoms; - my %permresults; foreach my $address (sort(keys(%toaddr))) { my ($recuname,$recdomain)=split(/\:/,$address); my $msgtxt = $savemsg; @@ -3051,6 +3195,23 @@ sub sendoffmail { $r->print($message); } } + if (keys(%disallowed)) { + if ((ref($disallowed{'to'}) eq 'HASH') && (keys(%{$disallowed{'to'}}) > 0)) { + $r->print(&mt("The following recipients were excluded because the user's domain does not accept messages from server's domain:").'
  • '. + join("
  • \n",sort(keys(%{$disallowed{'to'}}))). + '

    • '); + } + if (ref($disallowed{'cc'}) eq 'HASH') { + $r->print(&mt("The following CCs were excluded because the user's domain does not accept messages from server's domain:").'
      • '. + join("
      • \n",sort(keys(%{$disallowed{'cc'}}))). + '

        • '); + } + if (ref($disallowed{'bcc'}) eq 'HASH') { + $r->print(&mt("The following BCCs were excluded because the user's domain does not accept messages from server's domain:").'
          • '. + join("
          • \n",sort(keys(%{$disallowed{'bcc'}}))). + '

            • '); + } + } } else { &printheader($r,'','Messages cancelled.'); return 'cancelled';
'.$lt{'fold'}.'
'."\n". +
'.$html_lt{'fold'}.'
'."\n". &Apache::loncommon::select_form($folder,'folder',\%formhash).'
'.$lt{'show'}.'
'."\n". +
'.$html_lt{'show'}.'
'."\n". &Apache::loncommon::select_form($env{'form.interdis'},'interdis', \%show).'
'.$lt{'status'}.'
'."\n". +
'.$html_lt{'status'}.'
'."\n". &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
- '.$lt{'actn'}.'
'."\n".' + '.$html_lt{'actn'}.'
'."\n".' '. &Apache::loncommon::select_form('view','folderaction',\%actions). - '
'.$lt{'atta'}.' '.$attachmax{'text'}.':
'.$lt{'atta'}.' '.$attachmax{'text'} + .': ' + .'' + .'