From 49948179084937b1e8a2e848eceacecbc4558471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Sat, 4 Apr 2020 10:29:29 +0200 Subject: [PATCH] MDL-68334 user: Display name in footer as elsewhere. --- lib/outputrenderers.php | 4 ++-- user/tests/behat/full_name_display.feature | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 8802a9e90ec..299a0b15a16 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1053,7 +1053,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()."\""; @@ -1074,7 +1074,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