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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 17 Nov 2004 16:42:39 -0000


albertel		Wed Nov 17 11:42:39 2004 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - encrypturl on discussions should be complet now
  	- attachements work and url stays encrypted
  - tested with both normal resources and bulletin boards
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.138 loncom/interface/lonfeedback.pm:1.139
--- loncom/interface/lonfeedback.pm:1.138	Mon Nov 15 18:02:45 2004
+++ loncom/interface/lonfeedback.pm	Wed Nov 17 11:42:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.138 2004/11/15 23:02:45 albertel Exp $
+# $Id: lonfeedback.pm,v 1.139 2004/11/17 16:42:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,7 +106,7 @@
     my $userpickkey = $ressymb.'_userpick';
     my $toggkey = $ressymb.'_readtoggle';
     my $readkey = $ressymb.'_read';
-
+    $ressymb=$encsymb;
     my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$markkey,$visitkey,$ondispkey,$userpickkey,$toggkey,$readkey],$ENV{'user.domain'},$ENV{'user.name'});
     my %discinfo = ();
     my $showonlyunread = 0;
@@ -979,7 +979,6 @@
                                     $$shown{$idx} = 1;
                                 } else {
                                     foreach my $role (@{$$roleinfo{$poster}}) {
-					&Apache::lonnet::logthis("\n rolematch $rolematch\nrole $role");
                                         if ($role =~ m/^$rolematch$/) {
                                             $$shown{$idx} = 1;
                                             last;
@@ -1678,6 +1677,7 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
+    &Apache::lonenc::check_encrypt(\$symb);
     my @sections = ();
     my $section_sel = '';
     my $numsections = 0;
@@ -1814,15 +1814,14 @@
 sub print_showposters {
     my ($r,$symb,$previous,$feedurl,$sortposts) = @_;
 
-# backward compatibility (bulletin boards used to be 'wrapped')
-    my $ressymb=&wrap_symb($symb);
+    &Apache::lonenc::check_encrypt(\$symb);
     my $crs='/'.$ENV{'request.course.id'};
     if ($ENV{'request.course.sec'}) {
         $crs.='_'.$ENV{'request.course.sec'};
     }
     $crs=~s/\_/\//g;
     my $seeid=&Apache::lonnet::allowed('rin',$crs);
-    my %contrib=&Apache::lonnet::restore($ressymb,$ENV{'request.course.id'},
+    my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
                           $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
                           $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
     my %namesort = ();
@@ -2444,6 +2443,7 @@
     if ($idx) {
         &extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold);
     }
+    &Apache::lonenc::check_encrypt(\$symb);
     $r->print(<<END);
 <html>
 <head>
@@ -3010,7 +3010,7 @@
           unless (length($ENV{'form.addnewattach'})>131072) {
               my $subdir = 'feedback/'.$ENV{'form.timestamp'};
               my $newattachment=&Apache::lonnet::userfileupload('addnewattach',undef,$subdir);
-              push @currnewattach, $newattachment;
+	      push @currnewattach, $newattachment;
           }
       }
       my $attachmenturls;