You are here

function registration_role_user in Registration role 5

Same name and namespace in other branches
  1. 6 registration_role.module \registration_role_user()

Implementation of hook_user().

Catch every registration and insert role

File

./registration_role.module, line 71

Code

function registration_role_user($op, &$edit, &$user, $category = null) {
  if ($op == "insert" && ($rid = variable_get('registration_role_roles', ''))) {

    // below does not seem safe!  or necessary for insert. Commented out
    // clear first
    // db_query( 'DELETE FROM {users_roles} WHERE uid = %d', $user->uid );
    $edit['roles'][$rid] = array();
  }
}