Skip to content
Snippets Groups Projects
Commit 8936cf01 authored by Matthew Slater's avatar Matthew Slater
Browse files

clarified that isnew users are not anon

parent 73b7b1b2
No related branches found
Tags 2.0.1
No related merge requests found
...@@ -26,7 +26,7 @@ function alt_login_help($route_name, $route_match) { ...@@ -26,7 +26,7 @@ function alt_login_help($route_name, $route_match) {
* @note there's no easy way to dedupe accounts' display names. * @note there's no easy way to dedupe accounts' display names.
*/ */
function alt_login_user_format_name_alter(&$name, AccountInterface $account) { function alt_login_user_format_name_alter(&$name, AccountInterface $account) {
if ($account->isAnonymous()) { // includes accounts tha if ($account->isAnonymous() and !$account->isNew()) { // includes accounts tha
// This will be the configured 'anonymous' value // This will be the configured 'anonymous' value
return; return;
} }
...@@ -34,7 +34,7 @@ function alt_login_user_format_name_alter(&$name, AccountInterface $account) { ...@@ -34,7 +34,7 @@ function alt_login_user_format_name_alter(&$name, AccountInterface $account) {
$uid = $account->id(); $uid = $account->id();
if (!isset($names[$uid])) { if (!isset($names[$uid])) {
// Anonymous users // Anonymous users
if (\Drupal::currentUser()->isAnonymous() and !$account->isNew()) { if (\Drupal::currentUser()->isAnonymous()) {
$anon = \Drupal::config('alt_login.settings')->get('display_anon'); $anon = \Drupal::config('alt_login.settings')->get('display_anon');
$names[$uid] = \Drupal::token() $names[$uid] = \Drupal::token()
->replace($anon, ['user' => $account], ['clear' => true]); ->replace($anon, ['user' => $account], ['clear' => true]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment