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

version 1.21, 2001/08/15 16:05:04 version 1.23, 2001/10/01 19:24:49
Line 13 Line 13
 # 10/19,10/20,10/30,  # 10/19,10/20,10/30,
 # 02/06/01 Gerd Kortemeyer  # 02/06/01 Gerd Kortemeyer
 # 07/27 Guy Albertelli  # 07/27 Guy Albertelli
 # 07/27,07/28,07/30,08/03,08/06,08/08,08/09,08/10,8/13,8/15 Gerd Kortemeyer  # 07/27,07/28,07/30,08/03,08/06,08/08,08/09,08/10,8/13,8/15,
   # 10/1 Gerd Kortemeyer
   
 package Apache::lonmsg;  package Apache::lonmsg;
   
Line 313  sub comprep { Line 314  sub comprep {
 <form action="/adm/email" method=post>  <form action="/adm/email" method=post>
 <input type=hidden name=sendreply value="$msgid">  <input type=hidden name=sendreply value="$msgid">
 Subject: <input type=text size=50 name=subject value="$subject"><p>  Subject: <input type=text size=50 name=subject value="$subject"><p>
 <textarea name=message cols=60 rows=10>  <textarea name=message cols=64 rows=10 wrap=hard>
 $quotemsg  $quotemsg
 </textarea><p>  </textarea><p>
 $dispcrit  $dispcrit
Line 380  sub compout { Line 381  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 393  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>
 <tr><td>Subject:</td><td><input type=text size=50 name=subject value="$dissub">  <tr><td>Subject:</td><td><input type=text size=50 name=subject value="$dissub">
 </td></tr></table>  </td></tr></table>
 <textarea name=message cols=60 rows=10>$dismsg  <textarea name=message cols=60 rows=10 wrap=hard>$dismsg
 </textarea><p>  </textarea><p>
 $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 wrap=hard>$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 554  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.23


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.