You are here

ldapdata.install in LDAP integration 5

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

File

ldapdata.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function ldapdata_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("ALTER TABLE {ldapauth} ADD (\n        ldapdata_binddn VARCHAR(255) NOT NULL default '',\n        ldapdata_bindpw VARCHAR(255) NOT NULL default '',\n        ldapdata_bindpw_clear VARCHAR(2) NOT NULL default '',\n        ldapdata_rwattrs LONGTEXT NOT NULL default '', \n      \tldapdata_roattrs LONGTEXT NOT NULL default '', \n        ldapdata_mappings LONGTEXT NOT NULL default ''\n      )");
      break;
    case 'pgsql':
      db_query("ALTER TABLE {ldapauth} ADD (\n        ldapdata_binddn VARCHAR(255) NOT NULL default '',\n        ldapdata_bindpw VARCHAR(255) NOT NULL default '',\n        ldapdata_bindpw_clear VARCHAR(2) NOT NULL default '',\n        ldapdata_rwattrs TEXT NOT NULL, \n        ldapdata_roattrs TEXT NOT NULL, \n        ldapdata_mappings TEXT NOT NULL\n      )");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function ldapdata_uninstall() {
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldapdata_binddn");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldapdata_bindpw");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldapdata_bindpw_clear");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldapdata_rwattrs");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldapdata_roattrs");
  db_query("ALTER TABLE {ldapauth} DROP COLUMN ldapdata_mappings");
}

Functions

Namesort descending Description
ldapdata_install Implementation of hook_install().
ldapdata_uninstall Implementation of hook_uninstall().