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

kaisler kaisler@source.lon-capa.org
Sun, 29 Mar 2009 20:05:06 -0000


kaisler		Sun Mar 29 20:05:06 2009 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  Add new function mynewmail to check if new mails are aviable(for the toplevel menu)
  
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.222 loncom/interface/lonmsg.pm:1.223
--- loncom/interface/lonmsg.pm:1.222	Thu Feb  5 00:45:29 2009
+++ loncom/interface/lonmsg.pm	Sun Mar 29 20:05:06 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.222 2009/02/05 00:45:29 raeburn Exp $
+# $Id: lonmsg.pm,v 1.223 2009/03/29 20:05:06 kaisler Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -560,11 +560,17 @@
     }
 }
 
+sub mynewmail{
+	&newmail();
+	return $env{'user.mailcheck.status'};
+}
+
 
 sub newmail {
     if ((time-$env{'user.mailcheck.time'})>300) {
         my %what=&Apache::lonnet::get('email_status',['recnewemail']);
         &Apache::lonnet::appenv({'user.mailcheck.time'=>time});
+		&Apache::lonnet::appenv({'user.mailcheck.status'=> $what{'recnewemail'}>0 ? 1 : 0});
         if ($what{'recnewemail'}>0) { return 1; }
     }
     return 0;