mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/base_site_config.git
synced 2026-03-10 18:27:41 -03:00
Adiciona mapeamento LDAP para field_user_mathscinetid
Inclui o campo mathSciNetId no ldap_user.settings e update hook 10001 para aplicar o mapeamento em instalações existentes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,3 +30,29 @@ function base_site_config_install() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds field_user_mathscinetid LDAP sync mapping.
|
||||
*/
|
||||
function base_site_config_update_10001() {
|
||||
$config = \Drupal::configFactory()->getEditable('ldap_user.settings');
|
||||
$mappings = $config->get('ldapUserSyncMappings');
|
||||
|
||||
if (!isset($mappings['drupal']['field-field_user_mathscinetid'])) {
|
||||
$mappings['drupal']['field-field_user_mathscinetid'] = [
|
||||
'ldap_attr' => '[mathSciNetId]',
|
||||
'user_attr' => '[field.field_user_mathscinetid]',
|
||||
'convert' => FALSE,
|
||||
'user_tokens' => '',
|
||||
'config_module' => 'ldap_user',
|
||||
'prov_module' => 'site_users',
|
||||
'prov_events' => [
|
||||
'create_drupal_user',
|
||||
'sync_to_drupal_user',
|
||||
],
|
||||
];
|
||||
$config->set('ldapUserSyncMappings', $mappings)->save();
|
||||
}
|
||||
|
||||
return t('LDAP sync mapping for field_user_mathscinetid added.');
|
||||
}
|
||||
|
||||
@@ -96,4 +96,14 @@ ldapUserSyncMappings:
|
||||
prov_events:
|
||||
- create_drupal_user
|
||||
- sync_to_drupal_user
|
||||
field-field_user_mathscinetid:
|
||||
ldap_attr: '[mathSciNetId]'
|
||||
user_attr: '[field.field_user_mathscinetid]'
|
||||
convert: false
|
||||
user_tokens: ''
|
||||
config_module: ldap_user
|
||||
prov_module: site_users
|
||||
prov_events:
|
||||
- create_drupal_user
|
||||
- sync_to_drupal_user
|
||||
ldap: { }
|
||||
|
||||
Reference in New Issue
Block a user