Diff for /loncom/interface/lonmsg.pm between versions 1.131 and 1.132

version 1.131, 2005/01/30 23:32:29 version 1.132, 2005/01/31 11:27:14
Line 90  also has a student role in the course, A Line 90  also has a student role in the course, A
   
 Users can ask LON-CAPA to forward messages to conventional e-mail  Users can ask LON-CAPA to forward messages to conventional e-mail
 addresses on their B<PREF> screen, but generally, LON-CAPA messages  addresses on their B<PREF> screen, but generally, LON-CAPA messages
 are much more useful then traditional email can be made to be, even  are much more useful than traditional email can be made to be, even
 with HTML support.  with HTML support.
   
 Right now, this document will cover just how to send a message, since  Right now, this document will cover just how to send a message, since
Line 356  sub all_url_author_res_msg { Line 356  sub all_url_author_res_msg {
 # ================================================== Critical message to a user  # ================================================== Critical message to a user
   
 sub user_crit_msg_raw {  sub user_crit_msg_raw {
     my ($user,$domain,$subject,$message,$sendback)=@_;      my ($user,$domain,$subject,$message,$sendback,$toperm)=@_;
 # Check if allowed missing  # Check if allowed missing
     my $status='';      my $status='';
     my $msgid='undefined';      my $msgid='undefined';
Line 381  sub user_crit_msg_raw { Line 381  sub user_crit_msg_raw {
        $status='no_host';         $status='no_host';
     }      }
 # Notifications  # Notifications
     my %userenv = &Apache::lonnet::get('environment',['critnotification'],      my %userenv = &Apache::lonnet::get('environment',['critnotification',
                                                         'permanentemail'],
                                        $domain,$user);                                         $domain,$user);
     if ($userenv{'critnotification'}) {      if ($userenv{'critnotification'}) {
       &sendnotification($userenv{'critnotification'},$user,$domain,$subject,1,        &sendnotification($userenv{'critnotification'},$user,$domain,$subject,1,
  $text);   $text);
     }      }
       if ($toperm && $userenv{'permanentemail'}) {
         &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,1,
    $text);
       }
 # Log this  # Log this
     &Apache::lonnet::logthis(      &Apache::lonnet::logthis(
       'Sending critical email '.$msgid.        'Sending critical email '.$msgid.
Line 456  sub user_crit_received { Line 461  sub user_crit_received {
 # ======================================================== Normal communication  # ======================================================== Normal communication
   
 sub user_normal_msg_raw {  sub user_normal_msg_raw {
     my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl)=@_;      my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl,
    $toperm)=@_;
 # Check if allowed missing  # Check if allowed missing
     my $status='';      my $status='';
     my $msgid='undefined';      my $msgid='undefined';
Line 484  sub user_normal_msg_raw { Line 490  sub user_normal_msg_raw {
        $status='no_host';         $status='no_host';
     }      }
 # Notifications  # Notifications
     my %userenv = &Apache::lonnet::get('environment',['notification'],      my %userenv = &Apache::lonnet::get('environment',['notification',
                                                         'permanentemail'],
                                        $domain,$user);                                         $domain,$user);
     if ($userenv{'notification'}) {      if ($userenv{'notification'}) {
  &sendnotification($userenv{'notification'},$user,$domain,$subject,0,   &sendnotification($userenv{'notification'},$user,$domain,$subject,0,
   $text);    $text);
     }      }
       if ($toperm && $userenv{'permanentemail'}) {
         &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0,
    $text);
       }
     &Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'},      &Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'},
                          $ENV{'user.home'},                           $ENV{'user.home'},
       'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status);        'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status);
Line 507  sub user_normal_msg_raw { Line 518  sub user_normal_msg_raw {
 =cut  =cut
   
 sub user_normal_msg {  sub user_normal_msg {
     my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl)=@_;      my ($user,$domain,$subject,$message,$citation,$baseurl,$attachmenturl,
    $toperm)=@_;
     my $status='';      my $status='';
     my %userenv = &Apache::lonnet::get('environment',['msgforward'],      my %userenv = &Apache::lonnet::get('environment',['msgforward'],
                                        $domain,$user);                                         $domain,$user);
Line 517  sub user_normal_msg { Line 529  sub user_normal_msg {
  my ($forwuser,$forwdomain)=split(/\:/,$_);   my ($forwuser,$forwdomain)=split(/\:/,$_);
          $status.=           $status.=
   &user_normal_msg_raw($forwuser,$forwdomain,$subject,$message,    &user_normal_msg_raw($forwuser,$forwdomain,$subject,$message,
        $citation,$baseurl,$attachmenturl).' ';         $citation,$baseurl,$attachmenturl,$toperm).' ';
        }         }
     } else {       } else { 
  $status=&user_normal_msg_raw($user,$domain,$subject,$message,   $status=&user_normal_msg_raw($user,$domain,$subject,$message,
      $citation,$baseurl,$attachmenturl);       $citation,$baseurl,$attachmenturl,$toperm);
     }      }
     return $status;      return $status;
 }  }

Removed from v.1.131  
changed lines
  Added in v.1.132


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