isguest() must be checked AFTER require_login() because the user may not be logged in yet ;-)

This commit is contained in:
skodak
2006-04-19 19:42:47 +00:00
parent d133007141
commit 7282d18cf0
+5 -5
View File
@@ -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;