Hi there,

I've been playing with Drupal for about a week now, and I'm loving it, but still getting a hang of the ropes. I'm wondering if there is a way to change the user registration process so that a mailout is not required, and either (1) the user chooses their own password or (2) drupal generates it and displays it on screen (as per the initial account creation)?

Thanks,
Jules

Comments

killes@www.drop.org’s picture

You'd need to hack the Drupal core for this to work.
--
If you have troubles with a particular contrib project, please consider to file a support request. Thanks.

Boris Mann’s picture

As killes says, not currently part of the code, but it could be added. Submit a feature request.

cuteseal’s picture

Thanks everyone. I'll raise a feature request. Then hack the code. :D

cuteseal’s picture

Ok, here is the hacked code:

Under modules/user.module (~line 982):

        if ($account->status) {
          // Create new user account, no administrator approval required.
          $subject = _user_mail_text('welcome_subject', $variables);
          $body = _user_mail_text('welcome_body', $variables);
          user_mail($edit['mail'], $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
          //return t('Your password and further instructions have been sent to your e-mail address.');
        }

Comment out the last line (return t) as above, and add after:

          $output .= "Welcome to Drupal. <p>Your password is <strong>$pass</strong>. You may change your password on the next page.</p><p>Please login below.</p>";
          $output .= form_hidden('destination', 'user/'. $account->uid);
          $output .= form_hidden('name', $account->name);
          $output .= form_hidden('pass', $pass);
          $output .= form_submit(t('Log in'));
          return form($output);

Enjoy!

media girl’s picture

This is great. I hope you submit it officially so it can be integrated into a future version -- with perhaps some admin code modifications so that the registration method could be toggled between email/onscreen.

Nice work!

--
mediagirl.org

nybble@coldhost.net’s picture

very nice, works like a charm!