You are here

function _ldapgroups_create_role in LDAP integration 5.2

Same name and namespace in other branches
  1. 5 ldapgroups.module \_ldapgroups_create_role()
  2. 6 ldapgroups.inc \_ldapgroups_create_role()
1 call to _ldapgroups_create_role()
ldapgroups_user_login in ./ldapgroups.module

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);
  }
}