diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 6287e564110..5a80f156938 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1047,7 +1047,7 @@ class core_renderer extends renderer_base { $course = $this->page->course; if (\core\session\manager::is_loggedinas()) { $realuser = \core\session\manager::get_realuser(); - $fullname = fullname($realuser, true); + $fullname = fullname($realuser); if ($withlinks) { $loginastitle = get_string('loginas'); $realuserinfo = " [wwwroot/course/loginas.php?id=$course->id&sesskey=".sesskey()."\""; @@ -1068,7 +1068,7 @@ class core_renderer extends renderer_base { } else if (isloggedin()) { $context = context_course::instance($course->id); - $fullname = fullname($USER, true); + $fullname = fullname($USER); // Since Moodle 2.0 this link always goes to the public profile page (not the course profile page) if ($withlinks) { $linktitle = get_string('viewprofile'); diff --git a/user/tests/behat/full_name_display.feature b/user/tests/behat/full_name_display.feature index 83b1cd70be9..f056317ebb1 100644 --- a/user/tests/behat/full_name_display.feature +++ b/user/tests/behat/full_name_display.feature @@ -53,6 +53,7 @@ Feature: Users' names are displayed across the site according to the user policy When I follow "Profile" in the user menu Then I should see "Gronya,Beecham" in the ".usermenu" "css_element" And I should see "Gronya,Beecham" in the ".page-context-header" "css_element" + And I should see "You are logged in as Gronya,Beecham" in the "page-footer" "region" And I log out Scenario: As an admin, 'fullnamedisplay' should be used when using the 'log in as' function @@ -60,7 +61,9 @@ Feature: Users' names are displayed across the site according to the user policy When I navigate to "Users > Accounts > Browse list of users" in site administration And I follow "Jane, Nina, Niamh, Cholmondely" And I follow "Log in as" - Then I should see "You are logged in as Nee,Chumlee" + Then I should see "You are logged in as Nee,Chumlee" in the ".usermenu" "css_element" + And I should see "You are logged in as Jane, Nina, Niamh, Cholmondely" in the "region-main" "region" + And I should see "You are logged in as Nee,Chumlee" in the "page-footer" "region" And I log out Scenario: As an admin, 'fullnamedisplay' should be used when viewing another user's site profile