[resolved] Application: Modify the register action not to send Email (1 post)

  1. sjx19871109
    Posted 6 years ago #

    When we regsiter in the wordpress, the default method is to generate password automatically and send it to the user by Email. But if we are running wordpress in a test machine which is not connected to the internet, the registration would not be completed. In order to solve this problem, we could modify the registration page(wp-login.php) so that the system won't send a Email, instead, shows the password to the user then regsitration is completed.
    1. Open the file wp-login.php in the installation directory of your wordpress with a text editor.
    2. Find code 'wp_new_user_notification($user_id, $user_pass);' replace it with the following two lines:
    setcookie('u', $user_login);
    setcookie('user_pass', $user_pass);
    in this way the registration information was writen into the cookie.
    3. Find code $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
    replace it with
    $errors->add('registered', __('Registration complete. username: ' . $_COOKIE["u"] . ' password: ' . $_COOKIE["user_pass"]), 'message');
    4. save your file and restart the service, everything is OK!

    [moderated] Signatures are not permitted, see forum rules.

Topic Closed

This topic has been closed to new replies.

About this Topic