function registration_role_user in Registration role 6
Same name and namespace in other branches
- 5 registration_role.module \registration_role_user()
Implementation of hook_user().
Catch every registration and insert role
File
- ./
registration_role.module, line 69
Code
function registration_role_user($op, &$edit, &$user, $category = null) {
if ($op == "insert" && ($rid = variable_get('registration_role_roles', ''))) {
// get the role in question
$roles = user_roles(TRUE);
// add it to the user
$edit['roles'][$rid] = $roles[$rid];
}
}