You are here

function _ldapgroups_create_role in LDAP integration 6

Same name and namespace in other branches
  1. 5.2 ldapgroups.module \_ldapgroups_create_role()
  2. 5 ldapgroups.module \_ldapgroups_create_role()

Create a new role.

Parameters

$rolename: A name of the role.

1 call to _ldapgroups_create_role()
ldapgroups_user_login in ./ldapgroups.inc
Implements hook_user() login operation.

File

./ldapgroups.inc, line 229
ldapgroups include file.

Code

function _ldapgroups_create_role($rolename) {
  $result = db_query("SELECT * FROM {role} WHERE LOWER(name) = LOWER('%s')", $rolename);
  if (!($row = db_fetch_object($result))) {
    db_query("INSERT INTO {role} (name) VALUES ('%s')", $rolename);
  }
}