Skip to content

Commit

Permalink
Mark usernames with @.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtronics committed Feb 6, 2020
1 parent 73c2aa2 commit 7434234
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Entity/UserSystem/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ public function setPwResetExpires(DateTime $pw_reset_expires): self
public function getFullName(bool $including_username = false): string
{
if ($including_username) {
return sprintf('%s %s (%s)', $this->getFirstName(), $this->getLastName(), $this->getName());
return sprintf('%s %s (@%s)', $this->getFirstName(), $this->getLastName(), $this->getName());
}

return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
Expand Down
2 changes: 1 addition & 1 deletion templates/_navbar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% if app.user %}<i class="fa fa-user" aria-hidden="true"></i>{% else %}<i class="far fa-user" aria-hidden="true"></i>{% endif %} <span class="caret"></span></a>
<ul class="dropdown-menu dropdown-menu-right" id="login-menu">
{% if app.user %}
<a class="dropdown-item disabled" href="#" >{% trans %}user.loggedin.label{% endtrans %} {{ app.user.firstName }} {{app.user.lastName}} ({{app.user.name}})</a>
<a class="dropdown-item disabled" href="#" >{% trans %}user.loggedin.label{% endtrans %} <b>{{ app.user.firstName }} {{app.user.lastName}}</b> (@{{app.user.name}})</a>
<a class="dropdown-item" href="{{ path("user_settings") }}"><i class="fa fa-cogs fa-fw" aria-hidden="true"></i> {% trans %}user.settings.label{% endtrans %}</a>
<a class="dropdown-item" href="{{ path("user_info_self") }}"><i class="fa fa-info-circle fa-fw" aria-hidden="true"></i> {% trans %}user.info.label{% endtrans %}</a>
<li role="separator" class="dropdown-divider"></li>
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/UserSystem/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testGetFullName(): void
$user->setLastName('Doe');

$this->assertSame('John Doe', $user->getFullName(false));
$this->assertSame('John Doe (username)', $user->getFullName(true));
$this->assertSame('John Doe (@username)', $user->getFullName(true));
}

public function googleAuthenticatorEnabledDataProvider(): array
Expand Down

0 comments on commit 7434234

Please sign in to comment.