private function LdapUserTestForm::provisionEnabled in Lightweight Directory Access Protocol (LDAP) 8.4
Same name and namespace in other branches
- 8.3 ldap_user/src/Form/LdapUserTestForm.php \Drupal\ldap_user\Form\LdapUserTestForm::provisionEnabled()
Given a $prov_event determine if LDAP user configuration supports it.
This is overall, not a per field syncing configuration.
Parameters
string $direction: self::PROVISION_TO_DRUPAL or self::PROVISION_TO_LDAP.
string $provision_trigger: Provision trigger, see events above, such as 'sync', 'provision', 'delete_ldap_entry', 'delete_drupal_entry', 'cancel_drupal_entry'.
Return value
bool Provisioning enabled.
1 call to LdapUserTestForm::provisionEnabled()
- LdapUserTestForm::submitForm in ldap_user/
src/ Form/ LdapUserTestForm.php - Form submission handler.
File
- ldap_user/
src/ Form/ LdapUserTestForm.php, line 260
Class
- LdapUserTestForm
- A form to allow the administrator to query LDAP.
Namespace
Drupal\ldap_user\FormCode
private function provisionEnabled(string $direction, string $provision_trigger) : bool {
$result = FALSE;
$config = $this
->configFactory()
->get('ldap_user.settings');
if ($direction === self::PROVISION_TO_LDAP) {
$result = \in_array($provision_trigger, $config
->get('ldapEntryProvisionTriggers'), TRUE);
}
elseif ($direction === self::PROVISION_TO_DRUPAL) {
$result = \in_array($provision_trigger, $config
->get('drupalAcctProvisionTriggers'), TRUE);
}
return $result;
}