]> git.mjollnir.org Git - moodle.git/commitdiff
isguest() must be checked AFTER require_login() because the user may not be logged...
authorskodak <skodak>
Wed, 19 Apr 2006 19:42:47 +0000 (19:42 +0000)
committerskodak <skodak>
Wed, 19 Apr 2006 19:42:47 +0000 (19:42 +0000)
mod/data/rate.php

index 3dbdc165725fe2fd78eafb0d118b7e4bebefa6aa..306e6431a09d1fae218872d7600ab7376a226243 100755 (executable)
@@ -1,11 +1,7 @@
-<?php
+<?php  // $Id$
     require_once("../../config.php");
     require_once("lib.php");
 
-    if (isguest()) {
-        error("Guests are not allowed to rate posts.", $_SERVER["HTTP_REFERER"]);
-    }
-
     $id = required_param('id',PARAM_INT);  // The course these ratings are part of
 
     if (! $course = get_record("course", "id", $id)) {
 
     require_login($course->id);
 
+    if (isguest()) {
+        error("Guests are not allowed to rate posts.", $_SERVER["HTTP_REFERER"]);
+    }
+
     $CFG->debug = 0;    /// Temporarily
 
     $returntoview = false;