Diff for /loncom/interface/lonmsg.pm between versions 1.21 and 1.22

version 1.21, 2001/08/15 16:05:04 version 1.22, 2001/08/16 01:42:07
Line 380  sub compout { Line 380  sub compout {
    $content{'sendername'}.' at '.$content{'senderdomain'};     $content{'sendername'}.' at '.$content{'senderdomain'};
     }      }
     my $defdom=$ENV{'user.domain'};      my $defdom=$ENV{'user.domain'};
       $r->print('<form action="/adm/email"  name="compemail" method=post>'.        $r->print(
                   '<form action="/adm/email"  name="compemail" method=post'.
                   ' enctype="multipart/form-data">'.
                 '<input type=hidden name=sendmail value=on><table>');                  '<input type=hidden name=sendmail value=on><table>');
     unless ($broadcast eq 'group') {      unless (($broadcast eq 'group') || ($broadcast eq 'upload')) {
        $r->print(<<"ENDREC");         $r->print(<<"ENDREC");
 <table>  <table>
 <tr><td>Username:</td><td><input type=text size=12 name=recuname></td></tr>  <tr><td>Username:</td><td><input type=text size=12 name=recuname></td></tr>
Line 390  sub compout { Line 392  sub compout {
 <td><input type=text size=12 name=recdomain value="$defdom"></td></tr>  <td><input type=text size=12 name=recdomain value="$defdom"></td></tr>
 ENDREC  ENDREC
     }      }
     $r->print(<<"ENDCOMP");      unless ($broadcast eq 'upload') {
          $r->print(<<"ENDCOMP");
 <tr><td>Additional Recipients<br><tt>username\@domain,username\@domain, ...  <tr><td>Additional Recipients<br><tt>username\@domain,username\@domain, ...
 </tt></td><td>  </tt></td><td>
 <input type=text size=50 name=additionalrec></td></tr>  <input type=text size=50 name=additionalrec></td></tr>
Line 401  ENDREC Line 404  ENDREC
 $dispcrit  $dispcrit
 <input type=submit value="$func Mail">  <input type=submit value="$func Mail">
 ENDCOMP  ENDCOMP
       }
       if ($broadcast eq 'upload') {
    $r->print(<<ENDUPLOAD);
   <input type=hidden name=sendmode value=upload>
   <h3>Generate messages from a file</h3>
   Subject: <input type=text size=50 name=subject>
   <pre>
   username1\@domain1: text
   username2\@domain2: text
   username1\@domain1: text
   </pre>
   The messages will be assembled from all lines with the respective 
   <tt>username\@domain</tt>, and appended to the general message text.<p>
   <input type=file name=upfile size=20><p>
   General message text:<p>
   <textarea name=message cols=60 rows=10>$dismsg
   </textarea><p>
   $dispcrit
   <input type=submit value="Upload and send">
   ENDUPLOAD
       }
     if ($broadcast eq 'group') {      if ($broadcast eq 'group') {
        &discourse;         &discourse;
     }      }
Line 529  sub handler { Line 553  sub handler {
       if ($ENV{'form.sendmode'} eq 'group') {        if ($ENV{'form.sendmode'} eq 'group') {
           map {            map {
       if ($_=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) {        if ($_=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) {
   $toaddr{$1}=1;    $toaddr{$1}='';
               }                }
           } keys %ENV;            } keys %ENV;
         } elsif ($ENV{'form.sendmode'} eq 'upload') {
             map {
                 my ($rec,$txt)=split(/\s*\:\s*/,$_);
                 if ($txt) {
     $rec=~s/\@/\:/;
                     $toaddr{$rec}.=$txt."\n";
                 }
             } split(/[\n\r\f]+/,$ENV{'form.upfile'});
       } else {        } else {
   $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}=1;    $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}='';
       }        }
       if ($ENV{'form.additionalrec'}) {        if ($ENV{'form.additionalrec'}) {
   map {    map {
               my ($auname,$audom)=split(/\@/,$_);                my ($auname,$audom)=split(/\@/,$_);
               $toaddr{$auname.':'.$audom}=1;                $toaddr{$auname.':'.$audom}='';
           } split(/\,/,$ENV{'form.additionalrec'});            } split(/\,/,$ENV{'form.additionalrec'});
       }        }
     map {      map {
       my ($recuname,$recdomain)=split(/\:/,$_);        my ($recuname,$recdomain)=split(/\:/,$_);
         my $msgtxt=$ENV{'form.message'};
         if ($toaddr{$_}) { $msgtxt.='<hr>'.$toaddr{$_}; }    
       if (($ENV{'form.critmsg'}) &&         if (($ENV{'form.critmsg'}) && 
           (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {            (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
          $r->print('Sending critical: '.           $r->print('Sending critical: '.
                 &user_crit_msg($recuname,$recdomain,                  &user_crit_msg($recuname,$recdomain,
                                  $ENV{'form.subject'},                                   $ENV{'form.subject'},
                                  $ENV{'form.message'},                                   $msgtxt,
                                  $content{'citation'}));                                   $content{'citation'}));
       } else {        } else {
          $r->print('Sending: '.&user_normal_msg($recuname,$recdomain,           $r->print('Sending: '.&user_normal_msg($recuname,$recdomain,
                                  $ENV{'form.subject'},                                   $ENV{'form.subject'},
                                  $ENV{'form.message'},                                   $msgtxt,
                                  $content{'citation'}));                                   $content{'citation'}));
       }        }
       $r->print('<br>');        $r->print('<br>');

Removed from v.1.21  
changed lines
  Added in v.1.22


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