You are here

public static function SyncMappingHelper::ldapContextToProvEvents in Lightweight Directory Access Protocol (LDAP) 8.3

Convert context for ldap_user event.

Converts the more general ldap_context string to its associated LDAP user event.

Parameters

string|null $ldapContext: Context.

Return value

array List of events.

1 call to SyncMappingHelper::ldapContextToProvEvents()
SyncMappingHelper::getLdapUserRequiredAttributes in ldap_user/src/Helper/SyncMappingHelper.php
Util to fetch attributes required for this user conf, not other modules.

File

ldap_user/src/Helper/SyncMappingHelper.php, line 258

Class

SyncMappingHelper
Helper class to process user field synchronisation mappings.

Namespace

Drupal\ldap_user\Helper

Code

public static function ldapContextToProvEvents($ldapContext = NULL) {
  switch ($ldapContext) {
    case 'ldap_user_prov_to_drupal':
      $result = [
        self::EVENT_SYNC_TO_DRUPAL_USER,
        self::EVENT_CREATE_DRUPAL_USER,
        self::EVENT_LDAP_ASSOCIATE_DRUPAL_USER,
      ];
      break;
    case 'ldap_user_prov_to_ldap':
      $result = [
        self::EVENT_SYNC_TO_LDAP_ENTRY,
        self::EVENT_CREATE_LDAP_ENTRY,
      ];
      break;
    default:
      $result = LdapConfiguration::getAllEvents();
      break;
  }
  return $result;
}