收录日期:2020/10/23 10:34:58 时间:2010-10-21 15:16:24 标签:php,drupal,registration

In PHP I can have a very nice registration system in less than a day with ajax username availability checking, custom fields, custom validation and everything to think of. In drupal, drupal just stands in the way of everything good.

I'm trying to customize the registration page as follows

  • add extra fields in the registration form
  • change registration so user can choose their own password. Is this too much to ask?
  • user will not receive an email containing their password (I can't believe drupal sends passwords in the clear like this, this is very bad security practice). So the user will received just a link to verify their account

I keep hearing about Content Profile module but I don't get it. It only helps me add custom fields to the registration page (and takes a while just to set up before it's usable). So is it really worth it?

I think it's easier to write a custom module to change the registration form as needed. I'm thinking to use hook_Form_alter to add new fields to the registration form.

  • Now how and where do I save those fields. One of those fields is the password.
  • How do I tell drupal to not send the password in email and to send an email just containing a link to verify

Are there any modules that do this? I can't believe how such essential and simple feature is so crappy in drupal.

In admin/user/settings, you find settings for the Drupal's user management.

admin/user/settigs

If you uncheck the require e-mail verification and let users create an account without admin privileges, they can select their own password.

Down below you can edit the email body that's sent and remove the password if you so desire, it's a bit more tricky to stop the mail being sent altogether.

For the hook_form_alter you need to add your own validate/submit handler. You only need to handle validation and submit (saving of data) for your own form fields, Drupal will handle the default ones.