You are here

private function LdapUserAdminForm::provisionEventConfigurable in Lightweight Directory Access Protocol (LDAP) 8.3

Is a particular sync method viable for a given mapping?

That is, can it be enabled in the UI by admins?

Parameters

int $prov_event: Event to check.

array $mapping: Array of mapping configuration.

Return value

bool Whether configurable or not.

1 call to LdapUserAdminForm::provisionEventConfigurable()
LdapUserAdminForm::getSyncFormRow in ldap_user/src/Form/LdapUserAdminForm.php
Get mapping form row to LDAP user provisioning mapping admin form table.

File

ldap_user/src/Form/LdapUserAdminForm.php, line 1013

Class

LdapUserAdminForm
Provides the form to configure user configuration and field mapping.

Namespace

Drupal\ldap_user\Form

Code

private function provisionEventConfigurable($prov_event, array $mapping = NULL) {
  $configurable = FALSE;
  if ($mapping) {
    if ($prov_event == self::EVENT_CREATE_LDAP_ENTRY || $prov_event == self::EVENT_SYNC_TO_LDAP_ENTRY) {
      $configurable = (bool) (!isset($mapping['configurable_to_ldap']) || $mapping['configurable_to_ldap']);
    }
    elseif ($prov_event == self::EVENT_CREATE_DRUPAL_USER || $prov_event == self::EVENT_SYNC_TO_DRUPAL_USER) {
      $configurable = (bool) (!isset($mapping['configurable_to_drupal']) || $mapping['configurable_to_drupal']);
    }
  }
  else {
    $configurable = TRUE;
  }
  return $configurable;
}