'value'=>t('The encryption key is still the default value of earlier releases of Content Sync. Run the database updates (drush updb). If the key was re-imported from your configuration sync directory afterwards, export the configuration again (drush cex) so that the directory no longer contains a key value.'),
'value'=>t('The configuration sync directory contains a key value for key.key.cms_content_sync. Importing it would replace the site-specific encryption key with a value that is stored in configuration. Export the configuration again (drush cex).'),
'severity'=>REQUIREMENT_WARNING,
];
}
// Show error when the Content Sync user doesn't have the Content Sync role.
$users=Drupal::entityTypeManager()
->getStorage('user')
@@ -261,11 +374,24 @@ function cms_content_sync_requirements($phase) {
}
$auth=AuthenticationByUser::getInstance();
try{
$expected_password=$auth->getPassword();
}
catch(\Exception$e){
$expected_password=NULL;
$requirements['cms_content_sync_user_password']=[
'title'=>t('Content Sync: User password'),
'value'=>t('The stored credentials of the service user "@username" cannot be read: @message Set a new password for the service user, then re-register the site.',[
returnt('Generated a site-specific encryption key and re-encrypted the credentials of the Content Sync service user with it.');
}
if(!empty($encrypted)){
\Drupal::logger('cms_content_sync')->error('The stored credentials of the Content Sync service user could not be decrypted with the previous encryption key: @error',['@error'=>$error]);
returnt('Generated a site-specific encryption key, but the stored credentials of the Content Sync service user could not be decrypted with the previous key: @error Set a new password for the service user, then re-register the site.',['@error'=>$error]);
}
returnt('Generated a site-specific encryption key. No service user credentials were stored yet.');