Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alt_login
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
alt_login
Commits
8936cf01
Commit
8936cf01
authored
2 years ago
by
Matthew Slater
Browse files
Options
Downloads
Patches
Plain Diff
clarified that isnew users are not anon
parent
73b7b1b2
No related branches found
Branches containing commit
Tags
2.0.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alt_login.module
+2
-2
2 additions, 2 deletions
alt_login.module
with
2 additions
and
2 deletions
alt_login.module
+
2
−
2
View file @
8936cf01
...
@@ -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
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment