Diff for /loncom/interface/lonmsg.pm between versions 1.169 and 1.170

version 1.169, 2006/01/05 20:10:54 version 1.170, 2006/01/09 20:07:27
Line 558  sub user_normal_msg_raw { Line 558  sub user_normal_msg_raw {
        unless (($env{'request.course.id'}) &&          unless (($env{'request.course.id'}) && 
                (($env{'form.sendmode'} eq 'group')  ||                  (($env{'form.sendmode'} eq 'group')  || 
                (($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&                 (($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&
                (&Apache::lonnet::allowed('srm',$env{'request.course.id'})))) {                 (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
       '/'.$env{'request.course.sec'})))) {
            $status .= &store_sent_mail($msgid,$message);             $status .= &store_sent_mail($msgid,$message);
        }         }
     } else {      } else {
Line 1228  sub compout { Line 1230  sub compout {
        'ca' => 'Cancel',         'ca' => 'Cancel',
        'ma' => 'Mail');         'ma' => 'Mail');
   
     if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})) {      if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
       '/'.$env{'request.course.sec'})) {
  my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");   my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
          $dispcrit=           $dispcrit=
  '<p><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'</label> ' . $crithelp .    '<p><label><input type="checkbox" name="critmsg" /> '.&mt('Send as critical message').'</label> ' . $crithelp . 
Line 1354  $dispcrit Line 1358  $dispcrit
 ENDUPLOAD  ENDUPLOAD
     }      }
     if ($broadcast eq 'group') {      if ($broadcast eq 'group') {
        &discourse;         &discourse($r);
     }      }
     $r->print('</form>'.      $r->print('</form>'.
       &Apache::lonfeedback::generate_preview_button('compemail','message').        &Apache::lonfeedback::generate_preview_button('compemail','message').
Line 1367  sub retrieve_instructor_comments { Line 1371  sub retrieve_instructor_comments {
     my ($user,$domain)=@_;      my ($user,$domain)=@_;
     my $target=$env{'form.grade_target'};      my $target=$env{'form.grade_target'};
     if (! $env{'request.course.id'}) { return; }      if (! $env{'request.course.id'}) { return; }
     if (! &Apache::lonnet::allowed('srm',$env{'request.course.id'})) {      if (! &Apache::lonnet::allowed('srm',$env{'request.course.id'})
    && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
         '/'.$env{'request.course.sec'})) {
  return;   return;
     }      }
     my %records=&Apache::lonnet::dump('nohist_email',      my %records=&Apache::lonnet::dump('nohist_email',
Line 1392  sub disfacetoface { Line 1398  sub disfacetoface {
     my ($r,$user,$domain)=@_;      my ($r,$user,$domain)=@_;
     my $target=$env{'form.grade_target'};      my $target=$env{'form.grade_target'};
     unless ($env{'request.course.id'}) { return; }      unless ($env{'request.course.id'}) { return; }
     unless (&Apache::lonnet::allowed('srm',$env{'request.course.id'})) {      if  (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
          '/'.$env{'request.course.sec'})) {
    $r->print('Not allowed');
  return;   return;
     }      }
     my %records=&Apache::lonnet::dump('nohist_email',      my %records=&Apache::lonnet::dump('nohist_email',
Line 1446  $content{'sendername'}.'@'. Line 1455  $content{'sendername'}.'@'.
   
 sub facetoface {  sub facetoface {
     my ($r,$stage)=@_;      my ($r,$stage)=@_;
     unless (&Apache::lonnet::allowed('srm',$env{'request.course.id'})) {      if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
         '/'.$env{'request.course.sec'})) {
    $r->print('Not allowed');
  return;   return;
     }      }
     &printheader($r,      &printheader($r,
Line 1521  ENDBFORM Line 1533  ENDBFORM
 sub examblock {  sub examblock {
     my ($r,$action) = @_;      my ($r,$action) = @_;
     unless ($env{'request.course.id'}) { return;}      unless ($env{'request.course.id'}) { return;}
     unless (&Apache::lonnet::allowed('srm',$env{'request.course.id'})) { $r->print('Not allowed'); }      if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    && ! &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
         '/'.$env{'request.course.sec'})) {
    $r->print('Not allowed');
    return;
       }
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
             'comb' => 'Communication Blocking',              'comb' => 'Communication Blocking',
             'cbds' => 'Communication blocking during scheduled exams',              'cbds' => 'Communication blocking during scheduled exams',
Line 2137  sub sendoffmail { Line 2154  sub sendoffmail {
         my $msgtype;          my $msgtype;
         my %sentmessage;          my %sentmessage;
         if ((($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&          if ((($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&
             (&Apache::lonnet::allowed('srm',$env{'request.course.id'}))) {              (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
        || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
    '/'.$env{'request.course.sec'})
        )) {
             $savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'},1);              $savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'},1);
             $msgtype = 'critical';              $msgtype = 'critical';
         } else {          } else {
Line 2150  sub sendoffmail { Line 2170  sub sendoffmail {
     if ($toaddr{$_}) { $msgtxt.='<hr />'.$toaddr{$_}; }      if ($toaddr{$_}) { $msgtxt.='<hr />'.$toaddr{$_}; }
     my $thismsg;      my $thismsg;
     if ((($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&       if ((($env{'form.critmsg'}) || ($env{'form.sendbck'})) && 
  (&Apache::lonnet::allowed('srm',$env{'request.course.id'}))) {   (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
        '/'.$env{'request.course.sec'}))) {
  $r->print(&mt('Sending critical message').' '.$recuname.'@'.$recdomain.': ');   $r->print(&mt('Sending critical message').' '.$recuname.'@'.$recdomain.': ');
  $thismsg=&user_crit_msg($recuname,$recdomain,   $thismsg=&user_crit_msg($recuname,$recdomain,
  &Apache::lonfeedback::clear_out_html($env{'form.subject'}),   &Apache::lonfeedback::clear_out_html($env{'form.subject'}),

Removed from v.1.169  
changed lines
  Added in v.1.170


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