Skip to content

Commit

Permalink
Merge pull request #63 from HirotoKagotani/fullname-display
Browse files Browse the repository at this point in the history
Use the system-wide setting for fullname display
  • Loading branch information
michael-milette authored Jul 9, 2021
2 parents 656dd7a + a751513 commit 93408cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/local_contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct() {
if (isloggedin() && !isguestuser()) {
// If logged-in as non guest, use their registered fullname and email address.
global $USER;
$this->fromname = $USER->firstname . ' ' . $USER->lastname;
$this->fromname = get_string('fullnamedisplay', null, $USER);
$this->fromemail = $USER->email;
// Insert name and email address at first position in $_POST array.
if (!empty($_POST['email'])) {
Expand Down Expand Up @@ -373,7 +373,7 @@ public function sendmessage($email, $name, $sendconfirmationemail = false) {
private function moodleuserstatus($emailaddress) {
if (isloggedin() && !isguestuser()) {
global $USER;
$info = $USER->firstname . ' ' . $USER->lastname . ' / ' . $USER->email . ' (' . $USER->username .
$info = get_string('fullnamedisplay', null, $USER) . ' / ' . $USER->email . ' (' . $USER->username .
' / ' . get_string('eventuserloggedin', 'auth') . ')';
} else {
global $DB;
Expand All @@ -396,7 +396,7 @@ private function moodleuserstatus($emailaddress) {
$extrainfo .= ' / ' . get_string('notconfirmed', 'local_contact');
}

$info = $user->firstname . ' ' . $user->lastname . ' / ' . $user->email . ' (' . $user->username .
$info = get_string('fullnamedisplay', null, $user) . ' / ' . $user->email . ' (' . $user->username .
' / ' . get_string('eventuserloggedout') . $extrainfo . ')';
break;
default: // We found multiple users with this email address.
Expand Down

0 comments on commit 93408cc

Please sign in to comment.