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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 04 Nov 2005 21:36:57 -0000


albertel		Fri Nov  4 16:36:57 2005 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - err,
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.208 loncom/interface/londocs.pm:1.209
--- loncom/interface/londocs.pm:1.208	Fri Nov  4 15:52:35 2005
+++ loncom/interface/londocs.pm	Fri Nov  4 16:36:56 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.208 2005/11/04 20:52:35 albertel Exp $
+# $Id: londocs.pm,v 1.209 2005/11/04 21:36:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2077,19 +2077,20 @@
 # ================================================================ Main Handler
 sub handler {
     my $r = shift;
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     return OK if $r->header_only;
 
 # --------------------------------------------- Initialize help topics for this
-  foreach ('Adding_Course_Doc','Main_Course_Documents',
-           'Adding_External_Resource','Navigate_Content',
-           'Adding_Folders','Docs_Overview', 'Load_Map',
-           'Supplemental','Score_Upload_Form','Adding_Pages',
-           'Importing_LON-CAPA_Resource','Uploading_From_Harddrive',
-	   'Check_Resource_Versions','Verify_Content') {
-      $help{$_}=&Apache::loncommon::help_open_topic('Docs_'.$_);
-  }
+    foreach ('Adding_Course_Doc','Main_Course_Documents',
+	     'Adding_External_Resource','Navigate_Content',
+	     'Adding_Folders','Docs_Overview', 'Load_Map',
+	     'Supplemental','Score_Upload_Form','Adding_Pages',
+	     'Importing_LON-CAPA_Resource','Uploading_From_Harddrive',
+	     'Check_Resource_Versions','Verify_Content') {
+	$help{$_}=&Apache::loncommon::help_open_topic('Docs_'.$_);
+    }
     # Composite help files
     $help{'Syllabus'} = &Apache::loncommon::help_open_topic(
 		    'Docs_About_Syllabus,Docs_Editing_Templated_Pages');
@@ -2103,15 +2104,18 @@
 		  'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages');
     $help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
 
-  if ($env{'form.verify'}) {
+# does this user have privileges to modify docs
+    my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
+
+  if ($allowed && $env{'form.verify'}) {
       &verifycontent($r);
-  } elsif ($env{'form.listsymbs'}) {
+  } elsif ($allowed && $env{'form.listsymbs'}) {
       &list_symbs($r);
-  } elsif ($env{'form.versions'}) {
+  } elsif ($allowed && $env{'form.versions'}) {
       &checkversions($r);
-  } elsif ($env{'form.dumpcourse'}) {
+  } elsif ($allowed && $env{'form.dumpcourse'}) {
       &dumpcourse($r);
-  } elsif ($env{'form.exportcourse'}) {
+  } elsif ($allowed && $env{'form.exportcourse'}) {
       &exportcourse($r);
   } else {
 # is this a standard course?
@@ -2120,7 +2124,6 @@
     my $forcestandard = 0;
     my $forcesupplement;
     my $script='';
-    my $allowed;
     my $events='';
     my $showdoc=0;
     my $containertag;
@@ -2146,13 +2149,11 @@
     }
     unless ($showdoc) { # got called from remote
        if (($env{'form.folder'}=~/^default_/) || 
-          ($env{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) {
+          ($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) {
            $forcestandard = 1;
        } 
        $forcesupplement=($env{'form.folder'}=~/^supplemental_/);
 
-# does this user have privileges to post, etc?
-       $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
        if ($allowed) { 
          &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
          $script=&Apache::lonratedt::editscript('simple');