isguest() must be checked AFTER require_login() because the user may not be logged in yet ;-)
This commit is contained in:
+5
-5
@@ -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)) {
|
||||
@@ -14,6 +10,10 @@
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
if (isguest()) {
|
||||
error("Guests are not allowed to rate posts.", $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
|
||||
$CFG->debug = 0; /// Temporarily
|
||||
|
||||
$returntoview = false;
|
||||
|
||||
Reference in New Issue
Block a user