You are here

ldapgroups.install in LDAP integration 5

Same filename and directory in other branches
  1. 6 ldapgroups.install

File

ldapgroups.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function ldapgroups_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("ALTER TABLE {ldapauth} ADD (\n        ldap_groups_in_dn int NOT NULL default '0',\n        ldap_groups_in_dn_desc int NOT NULL default '0',\n        ldap_group_dn_attribute varchar(255) default '',\n        ldap_group_attr varchar(255) default '',\n        ldap_groups_in_attr int NOT NULL default '0',\n        ldap_groups_as_entries int NOT NULL default '0',\n        ldap_group_entries varchar(255) default '',\n        ldap_group_entries_attribute varchar(255) default ''\n      )");
      break;
    case 'pgsql':
      db_query("ALTER TABLE {ldapauth} ADD (\n        ldap_groups_in_dn INTEGER NOT NULL DEFAULT 0,\n        ldap_groups_in_dn_desc INTEGER NOT NULL DEFAULT 0,\n        ldap_group_dn_attribute VARCHAR(255) DEFAULT '',\n        ldap_group_attr VARCHAR(255) DEFAULT '',\n        ldap_groups_in_attr INTEGER NOT NULL DEFAULT 0,\n        ldap_groups_as_entries INTEGER NOT NULL DEFAULT 0,\n        ldap_group_entries VARCHAR(255) DEFAULT '',\n        ldap_group_entries_attribute VARCHAR(255) DEFAULT ''\n      )");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function ldapgroups_uninstall() {
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_groups_in_dn");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_groups_in_dn_desc");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_group_dn_attribute");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_group_attr");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_groups_in_attr");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_groups_as_entries");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_group_entries");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldap_group_entries_attribute");
}

Functions

Namesort descending Description
ldapgroups_install Implementation of hook_install().
ldapgroups_uninstall Implementation of hook_uninstall().