MDL-68334 user: Display name in footer as elsewhere.

This commit is contained in:
Luca Bösch
2020-08-08 10:30:04 +02:00
parent 24c68767e5
commit 7abc2da93b
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -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 = " [<a href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;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');
+4 -1
View File
@@ -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