i'm using the module webform so that user can ask for the credentials to login to the site. I need to add a button to the the "view" of each submission so that the user that it's viewing that submission can create a user.

Do i have to modify the code of the module to achive this or should i write my own module? If i write my own module what hooks should i implement to add the button, the logic for the button to be present only if i didn't create a user, and the custom action for that button?


I am also looking for a similar solution and would like to reuse an existing one. To assign a role on registration I would try some of existing modules.

Let me summarize what is available:

To allow a user to choose a role on registration

To provide a role using a key during registration

Sold Memberships

Join role with a password

Apply for role

Webform register

See also integration Webform and registration module.


Btw I've not used D7 in anger, so YMMV.

This is not a direct answer to the question :) but you know Drupal has a built-in mechanism for people to create accounts and then administrators approve (or not) them? I would've thought it would make more sense to try and customise that functionality, rather than trying to recreate it with webform.

A direct answer to your question is to check out webform_hooks.php and specifically hook_webform_submission_actions which lets you create custom actions to be performed on submissions (such as the built-in Print and Resend e-mails).

  • The problem is that there are two types of registered users: thise who register normally and "verified" users that request a verified account with more privileges. So i need a contact form to request the username so that the moderator can verify that the user is who he pretends to be. – Nicola Peluchetti Jul 8 '11 at 8:40
  • @Nicola Peluchetti I don't know D7 well as I say, but I understand you can add fields to the user account pages. Perhaps a way to go would be to add the fields to the account, and then have a custom submit button (or just a checkbox) that can signal that this particular user wants to be verified. Validation at this point can ensure sufficient fields are filled out. (If you still want to use webform I believe the links above are pertinent.) – Andy Jul 8 '11 at 9:49

It doesn't seem like a Webform submission necessarily needs to create a new user completely. It sounds to me like you just need to have a separate "verified" role for users whose accounts have been separately verified. Poviding verification with a role will allow you to control access permissions based on user levels and is the appropriate way of handling such a task. This can be done with existing, well tested modules via a webform as suggested along with the help of Rules and Webform Rules. Simply create a Webform with your desired fields for allowing a user to apply for th "verified" role and upon submit you can invoke Rules actions to accomplish whatever is necessary - like sending an email to the site administrator or adding the "verified" role to the submitting user's account.

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.