You are here

function ldap_user_user_entity_fields in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_user/ldap_user.install \ldap_user_user_entity_fields()

See http://api.drupal.org/api/drupal/modules%21field%21field.module/group/fi....

3 calls to ldap_user_user_entity_fields()
ldap_user_install in ldap_user/ldap_user.install
Implements hook_install().
ldap_user_uninstall in ldap_user/ldap_user.install
Implements hook_uninstall().
ldap_user_update_check_user_fields in ldap_user/ldap_user.install

File

ldap_user/ldap_user.install, line 111
Install, update and uninstall functions for the LDAP User module.

Code

function ldap_user_user_entity_fields() {
  $fields = [];
  $field_name = 'ldap_user_puid_sid';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'text',
    'entity_types' => [
      'user',
    ],
    'cardinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'text',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'LDAP Server ID that puid was derived from.  NULL if puid is independent of server configuration instance.',
    'description' => 'This field should not be edited.',
    'required' => 0,
    'default_value' => [],
    'settings' => [
      'text_processing' => 0,
    ],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  $field_name = 'ldap_user_puid';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'text',
    'entity_types' => [
      'user',
    ],
    'cardinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'text',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'Value of user\'s permanent unique id.  This should never change for a given ldap identified user.',
    'description' => 'This field should not be edited.',
    'required' => 0,
    'default_value' => [],
    'settings' => [
      'text_processing' => 0,
    ],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  $field_name = 'ldap_user_puid_property';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'text',
    'entity_types' => [
      'user',
    ],
    'cardinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'text',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'Property specified as user\'s puid.',
    'description' => 'This field should not be edited.',
    'required' => 0,
    'default_value' => [],
    'settings' => [
      'text_processing' => 0,
    ],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  $field_name = 'ldap_user_current_dn';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'text',
    'entity_types' => [
      'user',
    ],
    'cardinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'text',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'User LDAP DN',
    'description' => 'May change when user\'s DN changes. This field should not be edited.',
    'required' => 0,
    'default_value' => [],
    'settings' => [
      'text_processing' => 0,
    ],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  $field_name = 'ldap_user_prov_entries';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'text',
    'entity_types' => [
      'user',
    ],
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'text',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'LDAP Entries that have been provisioned from this Drupal user.',
    'description' => 'This field should not be edited.',
    'required' => 0,
    'default_value' => NULL,
    'settings' => [
      'text_processing' => 0,
    ],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  $field_name = 'ldap_user_last_checked';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'number_integer',
    'entity_types' => [
      'user',
    ],
    'cardinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'number',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'Unix timestamp of when Drupal user was compard to ldap entry.  This could be for purposes of synching, deleteing drupal account, etc.',
    'description' => 'This field should not be edited.',
    'required' => 0,
    'default_value' => NULL,
    'settings' => [],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  $field_name = 'ldap_user_ldap_exclude';
  $fields[$field_name]['field'] = [
    'field_name' => $field_name,
    'type' => 'number_integer',
    'entity_types' => [
      'user',
    ],
    'cardinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'number',
    'no_ui' => 1,
    'settings' => [],
  ];
  $fields[$field_name]['instance'] = [
    'field_name' => $field_name,
    'entity_type' => 'user',
    'bundle' => 'user',
    'label' => 'Whether to exclude the user from LDAP functionality',
    'description' => 'This field should not be edited.',
    'required' => 0,
    'default_value' => 0,
    'settings' => [],
    'widget' => [
      'type' => 'ldap_user_hidden',
      'settings' => [],
      'module' => 'ldap_user',
    ],
    'display' => [
      'default' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'full' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
      'teaser' => [
        'label' => 'hidden',
        'type' => 'hidden',
      ],
    ],
  ];
  return $fields;
}