From: martin Date: Sun, 11 Aug 2002 05:07:15 +0000 (+0000) Subject: Moved code from footer.html into print_footer() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3ce2f1e08a73a4493d03aa9c2a959f62287455b0;p=moodle.git Moved code from footer.html into print_footer() Don't update user on login check if it isn't a real user. --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 37ecfa5f3c..b3915812eb 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -47,6 +47,19 @@ function print_footer ($course=NULL) { } else { $homelink = "wwwroot\">Home"; } + if ($USER->realuser) { + if ($realuser = get_record("user", "id", $USER->realuser)) { + $realuserinfo = " [$realuser->firstname $realuser->lastname] "; + } + } + if ($USER->id) { + $loggedinas = $realuserinfo.get_string("loggedinas", "moodle", "$USER->firstname $USER->lastname"). + " (wwwroot/login/logout.php\">".get_string("logout").")"; + } else { + $loggedinas = get_string("loggedinnot", "moodle"). + " (wwwroot/login/\">".get_string("login").")"; + } + include ("$CFG->dirroot/theme/$CFG->theme/footer.html"); } @@ -921,7 +934,9 @@ function require_login($courseid=0) { // Next, check if the user can be in a particular course if ($courseid) { if ($USER->student[$courseid] || $USER->teacher[$courseid] || $USER->admin) { - update_user_in_db(); + if (!isset($USER->realuser)) { // Don't log if this isn't a realuser + update_user_in_db(); + } return; // user is a member of this course. } if (! $course = get_record("course", "id", $courseid)) {