You are here

public function SimpleLdapServerSchema::getDefaultAttributeSettings in Simple LDAP 8

Return default attribute mappings from LDAP to Drupal based on Server-type.

Return value

array

File

src/SimpleLdapServerSchema.php, line 357
Contains \Drupal\simple_ldap\SimpleLdapServerSchema

Class

SimpleLdapServerSchema

Namespace

Drupal\simple_ldap

Code

public function getDefaultAttributeSettings() {
  if ($this->server
    ->getServerType() == 'Active Directory') {
    return array(
      'object_class' => array(
        'user',
      ),
      'name_attribute' => 'samaccountname',
      'mail_attribute' => 'mail',
    );
  }
  else {
    return array(
      'object_class' => array(
        'inetorgperson',
      ),
      'name_attribute' => 'cn',
      'mail_attribute' => 'mail',
    );
  }
}