]> git.mjollnir.org Git - moodle.git/commitdiff
Bad bug fixed. Non-teachers could hide/show whole sections.
authormoodler <moodler>
Sat, 24 May 2003 06:59:36 +0000 (06:59 +0000)
committermoodler <moodler>
Sat, 24 May 2003 06:59:36 +0000 (06:59 +0000)
course/view.php

index f5587322258701489a572ca87d83710d867b0d6c..46c06d02bdabb0938c94027756e5ee4d40a637b7 100644 (file)
 
     add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
 
-    if (isset($edit)) {
-        if (isteacher($course->id)) {
+    if (isteacher($course->id)) {
+        if (isset($edit)) {
             if ($edit == "on") {
                 $USER->editing = true;
             } else if ($edit == "off") {
                 $USER->editing = false;
             }
         }
-    }
-
-    if (isset($help)) {
-        if ($help == "on") {
-            $USER->help = true;
-        } else if ($help == "off") {
-            $USER->help = false;
-        } 
-    }
 
-    if (isset($hide)) {
-        set_section_visible($course->id, $hide, "0");
-    }
+        if (isset($hide)) {
+            set_section_visible($course->id, $hide, "0");
+        }
 
-    if (isset($show)) {
-        set_section_visible($course->id, $show, "1");
+        if (isset($show)) {
+            set_section_visible($course->id, $show, "1");
+        }
     }
 
     $SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";