You are here

public function LdapUserConf::ldapContextToProvDirection in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_user/LdapUserConf.class.php \LdapUserConf::ldapContextToProvDirection()

converts the more general ldap_context string to its associated ldap user prov direction

File

ldap_user/LdapUserConf.class.php, line 373

Class

LdapUserConf

Code

public function ldapContextToProvDirection($ldap_context = NULL) {
  switch ($ldap_context) {
    case 'ldap_user_prov_to_drupal':
      $result = LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER;
      break;
    case 'ldap_user_prov_to_ldap':
    case 'ldap_user_delete_drupal_user':
      $result = LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY;
      break;

    // provisioning is can hapen in both directions in most contexts
    case 'ldap_user_insert_drupal_user':
    case 'ldap_user_update_drupal_user':
    case 'ldap_authentication_authenticate':
    case 'ldap_user_insert_drupal_user':
    case 'ldap_user_disable_drupal_user':
      $result = LDAP_USER_PROV_DIRECTION_ALL;
      break;
    default:
      $result = LDAP_USER_PROV_DIRECTION_ALL;
  }
  return $result;
}