Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
realname
Commits
a7b703f0
Commit
a7b703f0
authored
Nov 18, 2010
by
Dave Reid
Browse files
by Dave Reid: Prevent unnecessary regeneration of empty real names.
parent
ec5d43ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
realname.module
realname.module
+5
-2
No files found.
realname.module
View file @
a7b703f0
...
...
@@ -4,6 +4,7 @@
* @file
* Provides token-based name displays for users.
*
* @todo Add a 'view realname' permission enabled by default
* @todo Alter the username autocomplete
* @todo Allow users to login with their real name
* @todo Disable the username field
...
...
@@ -46,7 +47,9 @@ function realname_username_alter(&$name, stdClass $account) {
static
$in_username_alter
=
FALSE
;
if
(
isset
(
$account
->
realname
))
{
$name
=
$account
->
realname
;
if
(
drupal_strlen
(
$account
->
realname
))
{
$name
=
$account
->
realname
;
}
}
elseif
(
!
$in_username_alter
)
{
// Because realname tokens may execute format_username() we need to prevent
...
...
@@ -144,7 +147,7 @@ function realname_load_multiple(array $accounts) {
// For each account that was not present in the database, generate its
// real name.
foreach
(
$new_accounts
as
$uid
=>
$account
)
{
if
(
!
isset
(
$realnames
[
$uid
])
||
!
drupal_strlen
(
$realnames
[
$uid
])
)
{
if
(
!
isset
(
$realnames
[
$uid
]))
{
$realnames
[
$uid
]
=
realname_update
(
$account
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment