View source
<?php
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;
}
}
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");
}