You are here

function ldapauth_install in LDAP integration 5

Same name and namespace in other branches
  1. 5.2 ldapauth.install \ldapauth_install()
  2. 6 ldapauth.install \ldapauth_install()

Implementation of hook_install().

File

./ldapauth.install, line 5

Code

function ldapauth_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {ldapauth} (\n        sid int NOT NULL auto_increment,\n        name varchar(255) NOT NULL default '',\n        status int NOT NULL default '0',\n        server varchar(255) NOT NULL default '',\n        port int(10) NOT NULL default '389',\n        tls int NOT NULL default '0',\n        encrypted int NOT NULL default '0',\n        basedn text NOT NULL,\n        user_attr varchar(255) NOT NULL default '',\n        mail_attr VARCHAR(255) NOT NULL DEFAULT '',\n        binddn varchar(255) NOT NULL default '',\n        bindpw varchar(255) NOT NULL default '',\n        bindpw_clear varchar(255) NOT NULL default '',\n        PRIMARY KEY (name),\n        KEY sid (sid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {ldapauth} (\n        sid SERIAL,\n        name VARCHAR(255) NOT NULL DEFAULT '',\n        status INTEGER NOT NULL DEFAULT 0,\n        server VARCHAR(255) NOT NULL DEFAULT '',\n        port INTEGER NOT NULL DEFAULT 389,\n        tls INTEGER NOT NULL DEFAULT 0,\n        encrypted INTEGER NOT NULL DEFAULT 0,\n        basedn text NOT NULL,\n        user_attr VARCHAR(255) NOT NULL DEFAULT '',\n        mail_attr VARCHAR(255) NOT NULL DEFAULT '',\n        binddn VARCHAR(255) NOT NULL DEFAULT '',\n        bindpw VARCHAR(255) NOT NULL DEFAULT '',\n        bindpw_clear VARCHAR(255) NOT NULL DEFAULT '',\n        PRIMARY KEY (name)\n      )");
      db_query("CREATE INDEX {ldapauth}_sid_idx ON {ldapauth} (sid)");
      break;
  }
}