function _ldapgroups_create_role in LDAP integration 5.2
Same name and namespace in other branches
- 5 ldapgroups.module \_ldapgroups_create_role()
- 6 ldapgroups.inc \_ldapgroups_create_role()
1 call to _ldapgroups_create_role()
File
- ./
ldapgroups.module, line 416
Code
function _ldapgroups_create_role($rolename) {
$result = db_query("SELECT * FROM {role} WHERE name = '{$rolename}'");
$role_exists = db_num_rows($result);
if (!$role_exists) {
db_query("INSERT INTO {role} (name) VALUES ('%s')", $rolename);
}
}