You are here

public static function LdapQuery::fields in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_query/LdapQuery.class.php \LdapQuery::fields()
  2. 7.2 ldap_query/LdapQuery.class.php \LdapQuery::fields()
7 calls to LdapQuery::fields()
LdapQuery::__construct in ldap_query/LdapQuery.class.php
Constructor Method
LdapQueryAdmin::drupalForm in ldap_query/LdapQueryAdmin.class.php
LdapQueryAdmin::populateFromDrupalForm in ldap_query/LdapQueryAdmin.class.php
LdapQueryAdmin::save in ldap_query/LdapQueryAdmin.class.php
ldap_query_fields in ldap_query/ldap_query.module

... See full list

File

ldap_query/LdapQuery.class.php, line 211
Defines server classes and related functions.

Class

LdapQuery
LDAP Server Class

Code

public static function fields() {
  $fields = array(
    'query_numeric_id' => array(
      'property_name' => 'query_numeric_id',
      'schema' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table.  Only used internally.',
        'no export' => TRUE,
      ),
    ),
    'qid' => array(
      'property_name' => 'qid',
      'schema' => array(
        'type' => 'varchar',
        'length' => 20,
        'description' => 'Machine name for query.',
        'not null' => TRUE,
      ),
      'form' => array(
        'field_group' => 'basic',
        '#type' => 'textfield',
        '#title' => t('Machine name for this query configuration.'),
        '#size' => 20,
        '#maxlength' => 20,
        '#description' => t('May only contain alphanumeric characters (a-z, A-Z, 0-9, and _)'),
        '#required' => TRUE,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'name' => array(
      'property_name' => 'name',
      'schema' => array(
        'type' => 'varchar',
        'length' => '60',
        'not null' => TRUE,
      ),
      'form' => array(
        'field_group' => 'basic',
        '#type' => 'textfield',
        '#title' => t('Name'),
        '#description' => t('Choose a name for this query configuration.'),
        '#size' => 50,
        '#maxlength' => 255,
        '#required' => TRUE,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'sid' => array(
      'property_name' => 'sid',
      'schema' => array(
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
      ),
      'form' => array(
        'field_group' => 'basic',
        '#type' => 'radios',
        '#title' => t('LDAP Server used for query.'),
        '#required' => 1,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'status' => array(
      'property_name' => 'status',
      'schema' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'form' => array(
        'field_group' => 'basic',
        '#type' => 'checkbox',
        '#title' => t('Enabled'),
        '#description' => t('Disable in order to keep configuration without having it active.'),
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'base_dn_str' => array(
      'property_name' => 'base_dn_str',
      'schema' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'form' => array(
        'field_group' => 'query',
        '#type' => 'textarea',
        '#title' => t('Base DNs to search in query.'),
        '#description' => t('Each Base DN will be queried and results merged. e.g. <code>ou=campus accounts,dc=ad,dc=uiuc,dc=edu</code>') . t('Enter one per line in case if you need more than one.'),
        '#cols' => 50,
        '#rows' => 6,
        '#required' => TRUE,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'baseDn' => array(
      'property_name' => 'baseDn',
      'exportable' => FALSE,
    ),
    'filter' => array(
      'property_name' => 'filter',
      'schema' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'form' => array(
        'field_group' => 'query',
        '#type' => 'textarea',
        '#title' => t('Filter'),
        '#description' => t('LDAP query filter such as <code>(objectClass=group)</code> or <code>(&(objectClass=user)(homePhone=*))
</code>'),
        '#cols' => 50,
        '#rows' => 1,
        '#required' => TRUE,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'attributes_str' => array(
      'property_name' => 'attributes_str',
      'schema' => array(
        'type' => 'text',
        'not null' => FALSE,
      ),
      'form' => array(
        'field_group' => 'query',
        '#type' => 'textarea',
        '#title' => t('Attributes to return.'),
        '#description' => t('Enter as comma separated list. DN is automatically returned. Leave empty to return all attributes. e.g. <code>objectclass,name,cn,samaccountname</code>'),
        '#cols' => 50,
        '#rows' => 6,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'attributes' => array(
      'property_name' => 'attributes',
      'exportable' => FALSE,
    ),
    'sizelimit' => array(
      'property_name' => 'sizelimit',
      'schema' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'form' => array(
        'field_group' => 'query_advanced',
        '#type' => 'textfield',
        '#title' => t('Size Limit of returned data'),
        '#description' => t('This limit may be already set by the ldap server.  0 signifies no limit'),
        '#size' => 7,
        '#maxlength' => 5,
        '#required' => TRUE,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'timelimit' => array(
      'property_name' => 'timelimit',
      'schema' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'form' => array(
        'field_group' => 'query_advanced',
        '#type' => 'textfield',
        '#title' => t('Time Limit in Seconds'),
        '#description' => t('The time limitset on this query.  This may be already set by the ldap server.  0 signifies no limit'),
        '#size' => 7,
        '#maxlength' => 5,
        '#required' => TRUE,
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'deref' => array(
      'property_name' => 'deref',
      'schema' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => LDAP_DEREF_NEVER,
      ),
      'form' => array(
        'field_group' => 'query_advanced',
        '#type' => 'radios',
        '#title' => t('How aliases should be handled during the search.'),
        '#required' => 1,
        '#options' => array(
          LDAP_DEREF_NEVER => t('(default) aliases are never dereferenced.'),
          LDAP_DEREF_SEARCHING => t('aliases should be dereferenced during the search but not when locating the base object of the search.'),
          LDAP_DEREF_FINDING => t('aliases should be dereferenced when locating the base object but not during the search.'),
          LDAP_DEREF_ALWAYS => t('aliases should be dereferenced always.'),
        ),
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
    'scope' => array(
      'property_name' => 'scope',
      'schema' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => LDAP_SCOPE_SUBTREE,
      ),
      'form' => array(
        'field_group' => 'query_advanced',
        '#type' => 'radios',
        '#title' => t('Scope of search.'),
        '#required' => 1,
        '#options' => array(
          LDAP_SCOPE_BASE => t('BASE. This value is used to indicate searching only the entry at the base DN, resulting in only that entry being returned (keeping in mind that it also has to meet the search filter criteria!).'),
          LDAP_SCOPE_ONELEVEL => t('ONELEVEL. This value is used to indicate searching all entries one level under the base DN - but not including the base DN and not including any entries under that one level under the base DN.'),
          LDAP_SCOPE_SUBTREE => t('SUBTREE. (default) This value is used to indicate searching of all entries at all levels under and including the specified base DN.'),
        ),
      ),
      'form_to_prop_functions' => array(
        'trim',
      ),
    ),
  );
  return $fields;
}