function hook_ldap_entry_pre_provision_alter in Lightweight Directory Access Protocol (LDAP) 8.4
Same name and namespace in other branches
- 8.2 ldap_servers/ldap_servers.api.php \hook_ldap_entry_pre_provision_alter()
- 8.3 ldap_servers/ldap_servers.api.php \hook_ldap_entry_pre_provision_alter()
- 7.2 ldap_servers/ldap_servers.api.php \hook_ldap_entry_pre_provision_alter()
Alter LDAP entry before entities are provisioned.
This should be invoked before provisioning LDAP entries.
Parameters
array $ldap_entries: LDAP entries as array keyed on lowercase DN of entry with value of array in format used in ldap_add or ldap_modify function, e.g.: ['cn=jkool,ou=guest accounts,dc=ad,dc=myuniversity,dc=edu' => [ "attribute1" => array("value"), "attribute2" => array("value1", "value2"), ];.
\Drupal\ldap_servers\Entity\Server $ldap_server: Server entity that is performing provisioning.
array $context: Context ith the following key/values: 'action' => add|modify|delete 'corresponding_drupal_data' => if LDAP entries have corresponding drupal objects, such as LDAP user entries and Drupal user objects; LDAP groups and Drupal roles; etc this will be array keyed on lowercase DN with values of objects, e.g.: ['corresponding_drupal_data'] => [ 'cn=jkool,ou=guest accounts,dc=ad,dc=myuniversity,dc=edu' => $userA, 'cn=jfun,ou=guest accounts,dc=ad,dc=myuniversity,dc=edu' => $userB, ] 'corresponding_drupal_data_type' => 'user', 'role', etc. If it is 'user', then $context has the account in the 'account' key.
3 invocations of hook_ldap_entry_pre_provision_alter()
- LdapEntryProvisionSubscriber::provisionLdapEntry in ldap_user/
src/ EventSubscriber/ LdapEntryProvisionSubscriber.php - Provision an LDAP entry if none exists.
- LdapEntryProvisionSubscriber::syncToLdapEntry in ldap_user/
src/ EventSubscriber/ LdapEntryProvisionSubscriber.php - Given a Drupal account, sync to related LDAP entry.
- LdapGroupManager::groupAddGroup in ldap_servers/
src/ LdapGroupManager.php - Add a group entry.
File
- ldap_servers/
ldap_servers.api.php, line 70
Code
function hook_ldap_entry_pre_provision_alter(array &$ldap_entries, Server $ldap_server, array $context) {
}