]> git.mjollnir.org Git - moodle.git/commitdiff
Guest user now has Login link instead of Logout link, see http://moodle.org/mod/forum...
authorgustav_delius <gustav_delius>
Sun, 30 May 2004 00:55:48 +0000 (00:55 +0000)
committergustav_delius <gustav_delius>
Sun, 30 May 2004 00:55:48 +0000 (00:55 +0000)
lib/weblib.php

index 9fc2b5a89914f34ff600bb8fdf9373f4162b672e..c3bcb528c58c06b2c76c07e986faee3375b1857b 100644 (file)
@@ -1074,8 +1074,13 @@ function user_login_string($course, $user=NULL) {
     if (isset($user->id) and $user->id) {
         $fullname = fullname($user, true);
         $username = "<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=$course->id\">$fullname</a>";
-        $loggedinas = $realuserinfo.get_string("loggedinas", "moodle", "$username").
+        if (isguest($user->id)) {
+            $loggedinas = $realuserinfo.get_string("loggedinas", "moodle", "$username").
+                      " (<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</a>)";
+        } else {
+            $loggedinas = $realuserinfo.get_string("loggedinas", "moodle", "$username").
                       " (<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/login/logout.php\">".get_string("logout")."</a>)";
+        }
     } else {
         $loggedinas = get_string("loggedinnot", "moodle").
                       " (<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/login/index.php\">".get_string("login")."</a>)";