Skip to content

Commit

Permalink
MDL-68334 user: Display name in footer as elsewhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Aug 8, 2020
1 parent 24c6876 commit 7abc2da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/outputrenderers.php
Expand Up @@ -1047,7 +1047,7 @@ public function login_info($withlinks = null) {
$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()."\"";
Expand All @@ -1068,7 +1068,7 @@ public function login_info($withlinks = null) {
} 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');
Expand Down
5 changes: 4 additions & 1 deletion user/tests/behat/full_name_display.feature
Expand Up @@ -53,14 +53,17 @@ 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
Given I log in as "admin"
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
Expand Down

0 comments on commit 7abc2da

Please sign in to comment.