These fields need to changed so they are not visible and editable to the user when ldap modules are disabled.

Comments

johnbarclay’s picture

The ldap_user.install creates the fields as configured below. The widget of type "ldap_user_hidden" is used to hide the fields. Once LDAP user is disabled, the fields use the default text field format and are visible and editable. I see 2 ways out of this:

1) Create a custom field so it "goes away" completely when the ldap module is disabled.
2) Figure out a way to use a built in widget that is not visible or at least not editable.

I think 2 is an easier solution to maintain and develop. Any insight into how to do this would be appreciated.

  $field_name = 'ldap_user_puid_sid';
  $fields[$field_name]['field'] = array(
    'field_name' => $field_name,
    'type' => 'text',
    'entity_types' => array('user'),
    'cadinality' => 1,
    'translatable' => 0,
    'locked' => 1,
    'module' => 'text',
    'no_ui' => 1,
    'settings' => array(),
    );

  $fields[$field_name]['instance'] = array(
      '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_function' => 'ldap_user_provisioned_sid_default',
      'settings' => array(
        'text_processing' => 0,
      ),
      'widget' => array(
        'type' => 'ldap_user_hidden',
        'settings' => array(),
        'module' => 'ldap_user',
      ),
      'display' => array(
        'default' => array(
          'label' => 'hidden',
          'type' => 'hidden',
        ),
      'full' => array(
          'label' => 'hidden',
          'type' => 'hidden',
        ),
      'teaser' => array(
          'label' => 'hidden',
          'type' => 'hidden',
        ),
      ));
johnbarclay’s picture

Priority: Major » Normal
Status: Active » Closed (duplicate)