You are here

function ldap_servers_update_7108 in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_servers/ldap_servers.install \ldap_servers_update_7108()

add group related fields to ldap_servers table

File

ldap_servers/ldap_servers.install, line 293
Install, update and uninstall functions for the LDAP API module.

Code

function ldap_servers_update_7108() {
  foreach (array(
    'groupFunctionalityUnused',
    'groupNested',
    'groupSearchAll',
    'groupUserMembershipsAttrExists',
    'groupDeriveFromDn',
    'groupUserMembershipsAttrExists',
  ) as $tinyint_field_name) {
    if (!db_field_exists('ldap_servers', $tinyint_field_name)) {
      db_add_field('ldap_servers', $tinyint_field_name, array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => FALSE,
        'default' => 0,
      ));
      $msg = t('"!name" field added to ldap_servers table', array(
        '!name' => $tinyint_field_name,
      ));
    }
  }
  foreach (array(
    'groupUserMembershipsAttr',
    'groupMembershipsAttr',
    'groupTestGroupDn',
    'groupUserMembershipsAttr',
    'groupMembershipsAttrMatchingUserAttr',
  ) as $varchar255field_name) {
    if (!db_field_exists('ldap_servers', $varchar255field_name)) {
      db_add_field('ldap_servers', $varchar255field_name, array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ));
      $msg = t('"!name" field added to ldap_servers table', array(
        '!name' => $varchar255field_name,
      ));
    }
  }
}