function apply_for_role_install in Apply for role 5
Same name and namespace in other branches
- 6 apply_for_role.install \apply_for_role_install()
- 7.2 apply_for_role.install \apply_for_role_install()
- 7 apply_for_role.install \apply_for_role_install()
Implementation of hook_install().
File
- ./
apply_for_role.install, line 11 - Allows users to apply for roles.
Code
function apply_for_role_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {users_roles_apply} (\n uid int unsigned NOT NULL default '0',\n rid int unsigned NOT NULL default '0',\n approved int(1) unsigned NOT NULL default '0',\n apply_date int(11) unsigned NOT NULL default '0',\n approve_date int(11) unsigned NOT NULL default '0',\n PRIMARY KEY (uid, rid)\n )");
break;
case 'pgsql':
db_query("CREATE TABLE {users_roles_apply} (\n uid int unsigned NOT NULL default '0',\n rid int unsigned NOT NULL default '0',\n approved int(1) unsigned NOT NULL default '0',\n apply_date int(11) unsigned NOT NULL default '0',\n approve_date int(11) unsigned NOT NULL default '0',\n PRIMARY KEY (uid, rid)\n )");
break;
}
}