Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.181.2.9.2.3 and 1.202

version 1.181.2.9.2.3, 2023/10/07 01:47:21 version 1.202, 2025/01/29 09:11:10
Line 229  function folder_choice(targetform,caller Line 229  function folder_choice(targetform,caller
 <form method="post" action="/adm/email" name="folderlist">  <form method="post" action="/adm/email" name="folderlist">
    <div class="LC_columnSection"><fieldset>     <div class="LC_columnSection"><fieldset>
    <legend>'.&mt('Folder Actions').'</legend>     <legend>'.&mt('Folder Actions').'</legend>
    <table border="0" cellspacing="2" cellpadding="8">     <div class="LC_columnSection">
     <tr>       <div class="LC_mail_actions"><label><b>'.$html_lt{'fold'}.'</b><br />'."\n".
      <td><b>'.$html_lt{'fold'}.'</b><br />'."\n".           &Apache::loncommon::select_form($folder,'folder',\%formhash).'</label>
          &Apache::loncommon::select_form($folder,'folder',\%formhash).'       </div>
      </td>       <div class="LC_mail_actions"><label><b>'.$html_lt{'show'}.'</b><br />'."\n".
      <td><b>'.$html_lt{'show'}.'</b><br />'."\n".  
          &Apache::loncommon::select_form($env{'form.interdis'},'interdis',           &Apache::loncommon::select_form($env{'form.interdis'},'interdis',
  \%show).'   \%show).'</label>
      </td>       </div>
      <td><b>'.$html_lt{'status'}.'</b><br />'."\n".       <div class="LC_mail_actions"><label><b>'.$html_lt{'status'}.'</b><br />'."\n".
        &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'         &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'</label>
      </td>       </div>
      <td style="padding-right: 40px;">       <div class="LC_mail_actions" style="padding-right: 1em">
          <b>'.$html_lt{'actn'}.'</b><br />'."\n".'           <label><b>'.$html_lt{'actn'}.'</b><br />'."\n".'
          <span class="LC_nobreak">'.           <span class="LC_nobreak">'.
          &Apache::loncommon::select_form('view','folderaction',\%actions).           &Apache::loncommon::select_form('view','folderaction',\%actions).'</label>'.
          ' <input type="button" value="'.$html_lt{'go'}.           ' <input type="button" value="'.$html_lt{'go'}.
          '" onclick="javascript:folder_choice(this.form,'."'change'".');" />           '" onclick="javascript:folder_choice(this.form,'."'change'".');" />
          </span>           </span>
      </td>       </div>
      <td style="border-left: 1px solid;padding-left: 40px;">       <div class="LC_vertical_line" style="padding: 0; height: 4em; margin: 0">
          <b>'.&mt('New Folder').'</b><br />'."\n".'       </div>
        <div class="LC_mail_actions" style="padding-left: 3em">
          <span class="LC_nobreak">           <span class="LC_nobreak">
          <input type="text" size="15" name="newfolder" value="" />           <label><b>'.&mt('New Folder').'</b><br />'."\n".'
            <input type="text" size="15" name="newfolder" value="" /></label>
          <input type="button" value="'.$html_lt{'go'}.           <input type="button" value="'.$html_lt{'go'}.
          '" onclick="javascript:folder_choice(this.form,'."'new'".');" />           '" onclick="javascript:folder_choice(this.form,'."'new'".');" />
          </span>           </span>
      </td>       </div>
     </tr>  
    </table>  
    </fieldset></div>     </fieldset></div>
 '."\n".  '."\n".
     '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.      '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.
     '<input type="hidden" name="renamed" value="" />'.      '<input type="hidden" name="renamed" value="" />';
         ($folder=~/^critical/?'</form>':'');  
     return $output;      return $output;
 }  }
   
Line 792  sub groupmail_header { Line 790  sub groupmail_header {
             ({text=>&mt('Group').": $description",              ({text=>&mt('Group').": $description",
               no_mt=>1,});                no_mt=>1,});
     }      }
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb   
          ({href=>"/adm/email?compose=group&amp;group=".            ({href=>"/adm/email?compose=group&amp;group=".
                  "$env{'form.group'}&amp;$refarg",                       "$env{'form.group'}&amp;$refarg",
            text=>"Send a Message in a Group",                 text=>"Send a Message in a Group",
            title=>"Compose Group Message"},);                 title=>"Compose Group Message"},);
     if ($action eq 'sending') {      if ($action eq 'sending') {
             &Apache::lonhtmlcommon::add_breadcrumb              &Apache::lonhtmlcommon::add_breadcrumb
                          ({text=>"Messages being sent.",                           ({text=>"Messages being sent.",
Line 1135  ENDDISHEADER Line 1133  ENDDISHEADER
             $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom,              $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom,
                                          \%setters));                                           \%setters));
         }          }
           $r->print('</form>');
         return;          return;
     }      }
     my $interdis = $env{'form.interdis'};      my $interdis = $env{'form.interdis'};
Line 1152  ENDDISHEADER Line 1151  ENDDISHEADER
     $r->print('<form method="post" name="disall" action="/adm/email">'.      $r->print('<form method="post" name="disall" action="/adm/email">'.
       &Apache::loncommon::start_data_table().        &Apache::loncommon::start_data_table().
           &Apache::loncommon::start_data_table_row().            &Apache::loncommon::start_data_table_row().
           '<th colspan="1">&nbsp;</th><th>');            '<th colspan="1">#</th><th>');
     if ($env{'form.sortedby'} eq "revdate") {      if ($env{'form.sortedby'} eq "revdate") {
  $r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');
     } else {      } else {
Line 1231  ENDDISHEADER Line 1230  ENDDISHEADER
  }   }
     }      }
             my $localsenttime = &Apache::lonlocal::locallocaltime($sendtime);              my $localsenttime = &Apache::lonlocal::locallocaltime($sendtime);
     $r->print('<td align="right"><span class="LC_nobreak">'.(($status eq 'new')?'<b>':'').      $r->print('<td align="right"><span class="LC_nobreak"><label>'.(($status eq 'new')?'<b>':'').
                       $count.'.'.(($status eq 'new')?'</b>':'').'&nbsp;'.                        $count.'.'.(($status eq 'new')?'</b>':'').'&nbsp;'.
                       '<input type="checkbox" name="delmark"'.                         '<input type="checkbox" name="delmark"'. 
                       ' value="'.$origID.'" /></span></td>');                        ' value="'.$origID.'" /></label></span></td>');
             foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {              foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {
                 $r->print('<td>'.(($status eq 'new')?'<b>':'').                  $r->print('<td>'.(($status eq 'new')?'<b>':'').
                           '<a href="/adm/email?display='.$origID.$sqs.'">'.                            '<a href="/adm/email?display='.$origID.$sqs.'">'.
Line 1272  ENDDISHEADER Line 1271  ENDDISHEADER
     $r->print('      $r->print('
 <div class="LC_columnSection"><fieldset>  <div class="LC_columnSection"><fieldset>
 <legend>'.&mt('Message Actions').'</legend>  <legend>'.&mt('Message Actions').'</legend>
 <table border="0" cellspacing="2" cellpadding="8">  <div class="LC_mail_actions">
  <tr>     <b>'.&mt('Select Messages').'</b><br />
   <td><b>'.&mt('Select Messages').'</b><br />  
    <span class="LC_nobreak">     <span class="LC_nobreak">
    <input type="button" onclick="javascript:checkAll(document.disall.delmark)" value="'.&mt('Check All').'" />'."\n".     <input type="button" onclick="javascript:checkAll(document.disall.delmark)" value="'.&mt('Check All').'" />'."\n".
   ' <input type="button" onclick="javascript:uncheckAll(document.disall.delmark)" value="'.&mt('Uncheck All').'" />'."\n".    ' <input type="button" onclick="javascript:uncheckAll(document.disall.delmark)" value="'.&mt('Uncheck All').'" />'."\n".
   '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />    '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />
   </span>    </span>
   </td>'."\n".    </div>'."\n".
   '<td><b>'.&mt('Action').'</b><br />'."\n".    '<div class="LC_mail_actions"><label><b>'.&mt('Action').'</b><br />'."\n".
   '  <select name="checkedaction">'."\n");    '  <select name="checkedaction">'."\n");
   
     if ($folder ne 'trash') {      if ($folder ne 'trash') {
Line 1300  ENDDISHEADER Line 1298  ENDDISHEADER
         $r->print('   <option value="markedmove">'.&mt('Move to Folder ->').          $r->print('   <option value="markedmove">'.&mt('Move to Folder ->').
                   '</option>');                    '</option>');
     }      }
     $r->print("\n".'</select></td>'."\n");      $r->print("\n".'</select></label></div>'."\n");
   
     if (keys(%gotfolders) > 0) {      if (keys(%gotfolders) > 0) {
         $r->print('<td><b>'.&mt('Destination folder').'</b><br />');          $r->print('<td><b>'.&mt('Destination folder').'</b><br />');
Line 1312  ENDDISHEADER Line 1310  ENDDISHEADER
         $r->print(&Apache::loncommon::select_form('','movetofolder',\%userfolders).          $r->print(&Apache::loncommon::select_form('','movetofolder',\%userfolders).
                   '</td>');                    '</td>');
     }      }
     $r->print('<td style="vertical-align:bottom;">'.      $r->print('<div class="LC_mail_actions">'.
               '<input type="button" name="go" value="'.&mt('Go').                '<br /><input type="button" name="go" value="'.&mt('Go').
               '" onclick="javascript:validate_checkedaction()"/></td>'."\n".                '" onclick="javascript:validate_checkedaction()"/></div>'."\n".
               '</tr></table>'."\n".  
               '</fieldset></div>'."\n"                '</fieldset></div>'."\n"
     );      );
     my $postedstartdis=$startdis+1;      my $postedstartdis=$startdis+1;
Line 1451  sub compout { Line 1448  sub compout {
                     );                      );
     if (!$forwarding && !$multiforward) {      if (!$forwarding && !$multiforward) {
         $attachrow = '<tr><td colspan="3"><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'}          $attachrow = '<tr><td colspan="3"><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'}
             .': <input type="file" name="attachment" class="LC_flUpload" />'              .': <input type="file" name="attachment" class="LC_flUpload" multiple />'
             .'<input type="hidden" id="LC_free_space" value="'.$attachmax{'num'}.'" />'              .'<input type="hidden" id="LC_free_space" value="'.$attachmax{'num'}.'" />'
             .'</td></tr>';              .'</td></tr>';
     }      }
Line 2139  sub displaymessage { Line 2136  sub displaymessage {
     my $clientip = &Apache::lonnet::get_requestor_ip($r);      my $clientip = &Apache::lonnet::get_requestor_ip($r);
   
 # info to generate "next" and "previous" buttons and check if message is blocked  # info to generate "next" and "previous" buttons and check if message is blocked
     my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =       my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
         &Apache::loncommon::blockcheck(\%setters,'com',$clientip);          &Apache::loncommon::blockcheck(\%setters,'com',$clientip);
     my @messages=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus);      my @messages=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus);
     if ( $blocked{$msgid} eq 'ON' ) {      if ( $blocked{$msgid} eq 'ON' ) {
Line 2714  sub displayresource { Line 2711  sub displayresource {
         }          }
 # Could not get a symb, give up  # Could not get a symb, give up
  unless ($symb) { return $content{'citation'}; }   unless ($symb) { return $content{'citation'}; }
           if ($symb =~ /ext\.tool$/) {
               return '<h2>'.&mt('Current transactions for student (if applicable)').'</h2>'.
               &Apache::loncommon::get_previous_attempt($symb,
                                                        $content{'sendername'},
                                                        $content{'senderdomain'},
                                                        $content{'courseid'});
           }
 # Have a symb, can render  # Have a symb, can render
  return '<h2>'.&mt('Current attempts of student (if applicable)').'</h2>'.   return '<h2>'.&mt('Current attempts of student (if applicable)').'</h2>'.
     &Apache::loncommon::get_previous_attempt($symb,      &Apache::loncommon::get_previous_attempt($symb,
Line 2827  sub sendoffmail { Line 2831  sub sendoffmail {
         &printheader($r,'','Sending messages blocked from your location.');          &printheader($r,'','Sending messages blocked from your location.');
         return 'blocked';          return 'blocked';
     } elsif ($env{'form.send'}) {      } elsif ($env{'form.send'}) {
         if (!$env{'form.multiforward'}) {           if (!$env{'form.multiforward'}) {
             if ($group eq '') {              if ($group eq '') {
         &printheader($r,'','Messages being sent.');          &printheader($r,'','Messages being sent.');
             } else {              } else {
Line 2857  sub sendoffmail { Line 2861  sub sendoffmail {
   
  my $mode = $env{'form.sendmode'};   my $mode = $env{'form.sendmode'};
  my (%toaddr,$tos,$cc,$bcc,$broadcast);   my (%toaddr,$tos,$cc,$bcc,$broadcast);
           my (%willtrust,%trustchecked,%disallowed);
           my $serverdefdom = &Apache::lonnet::default_login_domain();
   
  if ($mode eq 'group') {   if ($mode eq 'group') {
             if (defined($env{'form.courserecips'})) {              if (defined($env{'form.courserecips'})) {
Line 2866  sub sendoffmail { Line 2872  sub sendoffmail {
                 foreach my $dest (@to) {                  foreach my $dest (@to) {
                     my ($user,$domain) = split(/:/, $dest);                      my ($user,$domain) = split(/:/, $dest);
                     if (($user ne '') && ($domain ne '')) {                      if (($user ne '') && ($domain ne '')) {
                         my $rec = $user.":".$domain;                          unless ($trustchecked{$domain}) {
                         $toaddr{$rec} = '';                              $willtrust{$domain} = &Apache::lonnet::will_trust('msg',$serverdefdom,$domain);
                         $broadcast->{$rec} = '';                              $trustchecked{$domain} = 1;
                           }
                           if ($willtrust{$domain}) {
                               my $rec = $user.":".$domain;
                               $toaddr{$rec} = '';
                               $broadcast->{$rec} = '';
                           } else {
                               $disallowed{'to'}{$user.":".$domain} = 1; 
                           }
                     }                      }
                 }                  }
             }              }
Line 2879  sub sendoffmail { Line 2893  sub sendoffmail {
  if ($txt) {   if ($txt) {
                     $rec =~ s/^\s+//;                      $rec =~ s/^\s+//;
                     $rec =~ s/\s+$//;                      $rec =~ s/\s+$//;
     $toaddr{$rec}.=$txt."\n";                      my ($recuname,$recudom) = split(/:/,$rec);
                     $broadcast->{$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 {   } else {
     if (($env{'form.recuname'} ne '') && ($env{'form.recdomain'} ne '')) {      if (($env{'form.recuname'} ne '') && ($env{'form.recdomain'} ne '')) {
  $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';                  unless ($trustchecked{$env{'form.recdomain'}}) {
                 $tos->{$env{'form.recuname'}.':'.$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'}) {          if ($env{'form.additionalrec_to'}) {
             foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_to'})) {              foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_to'})) {
                 my ($auname,$audom)=split(/:/,$rec);                  my ($auname,$audom)=split(/:/,$rec);
                 if (($auname ne "") && ($audom ne "")) {                  if (($auname ne "") && ($audom ne "")) {
                     $toaddr{$auname.':'.$audom}='';                      unless ($trustchecked{$audom}) {
                     $tos->{$auname.':'.$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};
                       }
                 }                  }
             }              }
         }          }
Line 2904  sub sendoffmail { Line 2943  sub sendoffmail {
             foreach my $rec (@toreplies) {              foreach my $rec (@toreplies) {
                 my ($auname,$audom)=split(/:/,$rec);                  my ($auname,$audom)=split(/:/,$rec);
                 if (($auname ne "") && ($audom ne "")) {                  if (($auname ne "") && ($audom ne "")) {
                     $toaddr{$auname.':'.$audom}='';                      unless ($trustchecked{$audom}) {
                     $tos->{$auname.':'.$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};
                       } 
                 }                  }
             }              }
         }          }
Line 2913  sub sendoffmail { Line 2960  sub sendoffmail {
     foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_cc'})) {      foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_cc'})) {
  my ($auname,$audom)=split(/:/,$rec);   my ($auname,$audom)=split(/:/,$rec);
  if (($auname ne "") && ($audom ne "")) {   if (($auname ne "") && ($audom ne "")) {
                     $toaddr{$auname.':'.$audom}='';  
                     if (!defined($tos->{$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};
                           }
                     }                      }
  }   }
     }      }
Line 2926  sub sendoffmail { Line 2981  sub sendoffmail {
             foreach my $rec (@ccreplies) {              foreach my $rec (@ccreplies) {
                 my ($auname,$audom)=split(/:/,$rec);                  my ($auname,$audom)=split(/:/,$rec);
                 if (($auname ne "") && ($audom ne "")) {                  if (($auname ne "") && ($audom ne "")) {
                     $toaddr{$auname.':'.$audom}='';  
                     if (!defined($tos->{$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;
                           }
                     }                      }
                 }                  }
             }              }
Line 2939  sub sendoffmail { Line 3002  sub sendoffmail {
             foreach my $rec (@groupreplies) {              foreach my $rec (@groupreplies) {
                 my ($auname,$audom)=split(/:/,$rec);                  my ($auname,$audom)=split(/:/,$rec);
                 if (($auname ne "") && ($audom ne "")) {                  if (($auname ne "") && ($audom ne "")) {
                     $toaddr{$auname.':'.$audom}='';  
                     if (!defined($tos->{$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;
                           }
                     }                      }
                 }                  }
             }              }
Line 2950  sub sendoffmail { Line 3021  sub sendoffmail {
             foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_bcc'})) {              foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_bcc'})) {
                 my ($auname,$audom)=split(/:/,$rec);                  my ($auname,$audom)=split(/:/,$rec);
                 if (($auname ne "") && ($audom ne "")) {                  if (($auname ne "") && ($audom ne "")) {
                     $toaddr{$auname.':'.$audom}='';                      if ((!defined($tos->{$auname.':'.$audom})) &&
                     if ((!defined($tos->{$auname.':'.$audom})) &&   
                         (!defined($cc->{$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;
                           }
                     }                      }
                 }                  }
             }              }
Line 2973  sub sendoffmail { Line 3052  sub sendoffmail {
         } else {          } else {
             $savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'});              $savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'});
         }          }
         my %reciphash = (          my ($recipid, @recusers, @recudoms, %permresults);
                            to => $tos,          if (keys(%toaddr) > 0) {
                            cc => $cc,              my %reciphash = (
                            bcc => $bcc,                                 to => $tos,
                         );                                 cc => $cc,
         if ($mode eq 'group') {                                 bcc => $bcc,
             if ($group eq '') {                              );
                 $reciphash{'course_broadcast'} = $broadcast;              if ($mode eq 'group') {
             } else {                  if ($group eq '') {
                 if ($env{'form.groupmail'} eq 'cc') {                      $reciphash{'course_broadcast'} = $broadcast;
                     $reciphash{'group_cc_broadcast'} = $broadcast;  
                 } else {                  } else {
                     $reciphash{'group_bcc_broadcast'} = $broadcast;                      if ($env{'form.groupmail'} eq 'cc') {
                           $reciphash{'group_cc_broadcast'} = $broadcast;
                       } else {
                           $reciphash{'group_bcc_broadcast'} = $broadcast;
                       }
                 }                  }
             }              }
         }              ($recipid,my $recipstatus) = 
         my ($recipid,$recipstatus) =                   &Apache::lonmsg::store_recipients($msgsubj,$env{'user.name'},
             &Apache::lonmsg::store_recipients($msgsubj,$env{'user.name'},                                                    $env{'user.domain'},\%reciphash);
                                        $env{'user.domain'},\%reciphash);              if ($recipstatus ne 'ok') {
         if ($recipstatus ne 'ok') {                  &Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'});
             &Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'});              }
         }              if ($env{'form.attachment'}) {
         if ($env{'form.attachment'}) {                  if (length($env{'form.attachment'}) <= 1048576) {
             if (length($env{'form.attachment'}) <= 1048576) {                      $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now);
                 $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now);                  } else {
             } else {                      $r->print('<p><span class="LC_warning">'.&mt('Attachment not included - exceeded permitted length').'</span><br /></p>');
                 $r->print('<p><span class="LC_warning">'.&mt('Attachment not included - exceeded permitted length').'</span><br /></p>');                  }
             }              } elsif ($env{'form.multiforward'}) {
         } elsif ($env{'form.multiforward'}) {                  if ($env{'form.attachmenturl'} ne '') {
             if ($env{'form.attachmenturl'} ne '') {                      $attachmenturl = $env{'form.attachmenturl'};
                 $attachmenturl = $env{'form.attachmenturl'};                  }
             }              }
         }          }
         my @recusers;  
         my @recudoms;  
         my %permresults;  
  foreach my $address (sort(keys(%toaddr))) {   foreach my $address (sort(keys(%toaddr))) {
     my ($recuname,$recdomain)=split(/\:/,$address);      my ($recuname,$recdomain)=split(/\:/,$address);
             my $msgtxt = $savemsg;              my $msgtxt = $savemsg;
Line 3146  sub sendoffmail { Line 3225  sub sendoffmail {
                 $r->print($message);                  $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:").'<ul><li>'.
                             join("</li><li>\n",sort(keys(%{$disallowed{'to'}}))).
                             '</li><ul><br />');
               }
               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:").'<ul><li>'.
                             join("</li><li>\n",sort(keys(%{$disallowed{'cc'}}))).
                             '</li><ul><br />');
               }
               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:").'<ul><li>'.
                             join("</li><li>\n",sort(keys(%{$disallowed{'bcc'}}))).
                             '</li><ul><br />');
               }
           }
     } else {      } else {
         &printheader($r,'','Messages cancelled.');          &printheader($r,'','Messages cancelled.');
         return 'cancelled';          return 'cancelled';

Removed from v.1.181.2.9.2.3  
changed lines
  Added in v.1.202


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>