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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 22 Jun 2006 17:34:41 -0000


albertel		Thu Jun 22 13:34:41 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - use error detection 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.384 loncom/interface/loncommon.pm:1.385
--- loncom/interface/loncommon.pm:1.384	Thu Jun 22 09:02:22 2006
+++ loncom/interface/loncommon.pm	Thu Jun 22 13:34:40 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.384 2006/06/22 13:02:22 raeburn Exp $
+# $Id: loncommon.pm,v 1.385 2006/06/22 17:34:40 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3315,6 +3315,8 @@
 table.LC_mail_list tr.LC_mail_other:hover {
   background-color: $mail_other_hover;
 }
+
+
 END
 }
 
@@ -3999,8 +4001,11 @@
                   };
     if ($needroles) {
         $rolehash = {'all' => 'all'};
-        my %dumphash = &Apache::lonnet::dump('nohist_userroles',$cdom,$cnum);
-        foreach my $item (keys(%dumphash)) {
+        my %user_roles = &Apache::lonnet::dump('nohist_userroles',$cdom,$cnum);
+	if (&Apache::lonnet::error(%user_roles)) {
+	    undef(%user_roles);
+	}
+        foreach my $item (keys(%user_roles)) {
             my ($role)=split(/\:/,$item,2);
             if ($role eq 'cr') { next; }
             if ($role =~ /^cr/) {