Don't redirect too early
authormartin <martin>
Wed, 25 Sep 2002 14:40:28 +0000 (14:40 +0000)
committermartin <martin>
Wed, 25 Sep 2002 14:40:28 +0000 (14:40 +0000)
course/view.php

index aa8d185..9cb0610 100644 (file)
         }
     }
 
-    if (! $course->category) {      // This course is not a real course.
-        redirect("$CFG->wwwroot");
-    }
-
     require_login($id);
 
     add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
     $SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
     save_session("SESSION");
 
+    if (! $course->category) {      // This course is not a real course.
+        redirect("$CFG->wwwroot/");
+    }
+
+
     $courseword = get_string("course");
 
     print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true,