-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SA-CORE-2024-004 by zengenuity, cilefen, kristiaanvandeneynde, mcdrui…
…d, larowlan
- Loading branch information
Showing
4 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,7 @@ function user_requirements($phase): array { | |
if ($phase !== 'runtime') { | ||
return []; | ||
} | ||
$return = []; | ||
|
||
$result = (bool) \Drupal::entityQuery('user') | ||
->accessCheck(FALSE) | ||
|
@@ -106,17 +107,32 @@ function user_requirements($phase): array { | |
->execute(); | ||
|
||
if ($result === FALSE) { | ||
return [ | ||
'anonymous user' => [ | ||
'title' => t('Anonymous user'), | ||
'description' => t('The anonymous user does not exist. See the <a href=":url">restore the anonymous (user ID 0) user record</a> for more information', [ | ||
':url' => 'https://www.drupal.org/node/1029506', | ||
]), | ||
'severity' => REQUIREMENT_WARNING, | ||
], | ||
$return['anonymous user'] = [ | ||
'title' => t('Anonymous user'), | ||
'description' => t('The anonymous user does not exist. See the <a href=":url">restore the anonymous (user ID 0) user record</a> for more information', [ | ||
':url' => 'https://www.drupal.org/node/1029506', | ||
]), | ||
'severity' => REQUIREMENT_WARNING, | ||
]; | ||
} | ||
|
||
$query = \Drupal::database()->select('users_field_data'); | ||
$query->addExpression('LOWER(mail)', 'lower_mail'); | ||
$query->groupBy('lower_mail'); | ||
$query->having('COUNT(uid) > :matches', [':matches' => 1]); | ||
$conflicts = $query->countQuery()->execute()->fetchField(); | ||
|
||
if ($conflicts > 0) { | ||
$return['conflicting emails'] = [ | ||
'title' => t('Conflicting user emails'), | ||
'description' => t('Some user accounts have email addresses that differ only by case. For example, one account might have [email protected] and another might have [email protected]. See <a href=":url">Conflicting User Emails</a> for more information.', [ | ||
':url' => 'https://www.drupal.org/node/3486109', | ||
]), | ||
'severity' => REQUIREMENT_WARNING, | ||
]; | ||
} | ||
return []; | ||
|
||
return $return; | ||
} | ||
|
||
/** | ||
|