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