3

I have two main users roles: authenticated and agent.

First role uses content profile fields on registration form.

Users with the agent role can only be created by admins but agent doesn't need content profile fields.

In user_add_form the content profile fields is added as well so the admin must fill them.

How can I disable those fields when an admin want to create user with the agent role?

2

You can use hook_form_alter to alter the form. This is how the profile fields is added and they can be removed this way as well.

You have to make sure that your custom module is run after the profile module, which may require that you alter the weight of the module. This is merely a value in the system table.

0

There is two checkboxes on 'Content profile' tab of the node type: "Use on Registration" and "Use on administrative user creation form" See image the below image

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.