drupal-6permissionsrolescreation

Drupal 6 customizing dual module conflict


I am using the auto assign role module to assign the role of editor to anyone registering via the "create new account" link. This works just fine.

However, users of the editor role can create other users of different role types. To do this I am using the uCreate module.

The problem is when an editor creates a user, that user also gets the editor role.

I have looked into a number of hooks to programmatically remove the unwanted role but without success. How might I resolve this issue?


Solution

  • When the "editor role" users creates the users by "uCreate module", the hook_user is being called reside in "auto assign role module", This is the problem.

    The user_save function from "ucreate module line:299" call the hook_user with "insert" parameter in "auto assign role.module file", line no 155.

    case 'insert': // If this is an administrator creating the account only use auto_assign if // allowed by auto_admin_active if (arg(0) == 'admin' && _autoassignrole_get_settings('auto_admin_active') == 0) { return; }

    Here the code check whether it is admin user, If it is not admin then it will assign editor role to that user.

    Instead you can create a custom module and implement hook_user and change the role when a user are inserted.For more info please refer user_save in drupal 6