diff --git a/course/lib.php b/course/lib.php
index 7afdf121622..967d8d27db1 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -497,12 +497,12 @@ function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) {
echo "
\n\n";
}
-function print_admin_links () {
+function print_admin_links ($siteid) {
global $THEME, $CFG;
print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
$icon = "wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
- $moddata[]="wwwroot/course/log.php?id=$site->id\">".get_string("sitelogs")."";
+ $moddata[]="wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."";
$modicon[]=$icon;
$moddata[]="wwwroot/admin/site.php\">".get_string("sitesettings")."";
$modicon[]=$icon;
diff --git a/course/loggraph.php b/course/loggraph.php
index 6b375c28960..b47d980e4bd 100644
--- a/course/loggraph.php
+++ b/course/loggraph.php
@@ -7,7 +7,7 @@
require_variable($id); // Course ID
require_variable($type); // Graph Type
optional_variable($user); // Student ID
- optional_variable($date); // Midnight of a date
+ optional_variable($date); // A time of a day (in GMT)
if (! $course = get_record("course", "id", $id)) {
error("Course is misconfigured");
diff --git a/course/loginas.php b/course/loginas.php
index c011b19f0d8..be38c15ccac 100644
--- a/course/loginas.php
+++ b/course/loginas.php
@@ -16,7 +16,7 @@
error("Only teachers can use this page!");
}
- if (!isstudent($course->id, $user)) {
+ if ($course->category and !isstudent($course->id, $user)) {
error("This student is not in this course!");
}
diff --git a/course/user.php b/course/user.php
index 39995571d9c..0770c76b673 100644
--- a/course/user.php
+++ b/course/user.php
@@ -64,7 +64,7 @@
switch ($mode) {
case "todaylogs" :
echo "