[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 09 Feb 2007 15:30:48 -0000


www		Fri Feb  9 10:30:48 2007 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  Got quite a lot of ISEs because of incomplete feedback address in course
  environment - crash in line 573. That line should not be reached if there
  is no valid recipient.
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.195 loncom/interface/lonmsg.pm:1.196
--- loncom/interface/lonmsg.pm:1.195	Thu Dec 28 14:43:24 2006
+++ loncom/interface/lonmsg.pm	Fri Feb  9 10:30:48 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.195 2006/12/28 19:43:24 raeburn Exp $
+# $Id: lonmsg.pm,v 1.196 2007/02/09 15:30:48 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -553,9 +553,9 @@
        unless (($env{'request.course.id'}) && 
                (($env{'form.sendmode'} eq 'group')  || 
                (($env{'form.critmsg'}) || ($env{'form.sendbck'})) &&
-               (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
-		|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
-					    '/'.$env{'request.course.sec'})))) {
+		(&Apache::lonnet::allowed('srm',$env{'request.course.id'})
+		 || &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
+					     '/'.$env{'request.course.sec'})))) {
            (undef,my $packed_message_no_citation) =
                &packagemsg($subject,$message,undef,$baseurl,$attachmenturl,
                            $user,$domain,$currid,undef,$crsmsgid,$symb,$error);
@@ -563,31 +563,30 @@
                &store_sent_mail($msgid,$packed_message_no_citation);
            }
        }
-    } else {
-       $status='no_host';
-    }
-    if (defined($newid)) {
-        $$newid = $msgid;
-    }
-    if (defined($sentmessage)) {
-        $$sentmessage = $packed_message;
-    }
-
+       if (defined($newid)) {
+	   $$newid = $msgid;
+       }
+       if (defined($sentmessage)) {
+	   $$sentmessage = $packed_message;
+       }
 # Notifications
-    my %userenv = &Apache::lonnet::get('environment',['notification',
-                                                      'permanentemail'],
-                                       $domain,$user);
-    if ($userenv{'notification'}) {
-	&sendnotification($userenv{'notification'},$user,$domain,$subject,0,
-			  $text,$msgid);
-    }
-    if ($toperm && $userenv{'permanentemail'}) {
-	&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0,
-			  $text,$msgid);
-    }
-    &Apache::lonnet::log($env{'user.domain'},$env{'user.name'},
-                         $env{'user.home'},
-      'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status);
+       my %userenv = &Apache::lonnet::get('environment',['notification',
+							 'permanentemail'],
+					  $domain,$user);
+       if ($userenv{'notification'}) {
+	   &sendnotification($userenv{'notification'},$user,$domain,$subject,0,
+			     $text,$msgid);
+       }
+       if ($toperm && $userenv{'permanentemail'}) {
+	   &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0,
+			     $text,$msgid);
+       }
+       &Apache::lonnet::log($env{'user.domain'},$env{'user.name'},
+			    $env{'user.home'},
+			    'Sending '.$msgid.' to '.$user.' at '.$domain.' with status: '.$status);
+   } else {
+       $status='no_host';
+   }
     return $status;
 }