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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Mon, 06 Aug 2007 19:55:52 -0000


albertel		Mon Aug  6 15:55:52 2007 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - BUG#5350
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.247 loncom/interface/lonfeedback.pm:1.248
--- loncom/interface/lonfeedback.pm:1.247	Tue May  1 21:33:49 2007
+++ loncom/interface/lonfeedback.pm	Mon Aug  6 15:55:51 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.247 2007/05/02 01:33:49 albertel Exp $
+# $Id: lonfeedback.pm,v 1.248 2007/08/06 19:55:51 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -48,7 +48,7 @@
 
 sub discussion_open {
     my ($status,$symb)=@_;
-    if ($env{'request.role.adv'}) { return 1; }
+    if ($env{'request.role.adv'}) { return 0; }
     if (defined($status) &&
 	!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
 	  || $status eq 'OPEN')) {
@@ -901,6 +901,9 @@
 			  $env{'course.'.$env{'request.course.id'}.'.domain'},
 			  $env{'course.'.$env{'request.course.id'}.'.num'});
 
+    my $see_anonymous = 
+	&Apache::lonnet::allowed('rin',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''));
+
     if ((@{$grouppick} == 0) || (grep(/^all$/,@{$grouppick}))) {
         $skip_group_check = 1;
     }
@@ -1001,7 +1004,7 @@
                                @{$$subjectsort{$subject}} = ("$idx");
                             }
                         }
-		        if ((!$contrib{$idx.':anonymous'}) || (&Apache::lonnet::allowed('rin',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')))) {
+		        if (!$contrib{$idx.':anonymous'} || $see_anonymous) {
 			    $sender=&Apache::loncommon::aboutmewrapper(
 					 $plainname,
 					 $contrib{$idx.':sendername'},
@@ -1012,7 +1015,9 @@
 			        $sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '.
 				    $screenname;
 			    }
-                            $sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'});
+			    if ($see_anonymous) {
+				$sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'});
+			    }
 # Set up for sorting by domain, then username
                             unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) {
                                 %{$$usernamesort{$contrib{$idx.':senderdomain'}}} = ();