WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Simplify default passwords - how to? (3 posts)

  1. deanes02
    Member
    Posted 3 years ago #

    Hello, When a user registers for my site they get sent an unbelievably complicated password, which no one can remember.

    I know they can copy and paste, log in and then change their password, but they don't and I get loads of enquiries.

    Is there any way, maybe via a plugin, or some hacky code that I can tell wordpress to send my users something a bit easier (and yes, i know, insecure) to remember?

    Please help, I can't be the first to want to do this, but i have searched and searched with no joy :)

    Thanks!

  2. deanes02
    Member
    Posted 3 years ago #

    actually, can i change that to a hack way please! I'm using bbpress as well and it also generates these super complicated passwords.

    Thanks

  3. deanes02
    Member
    Posted 3 years ago #

    here's the answer --

    in wp-includes/pluggable.php - turn off special chars, reduce the length and reduce the amount of chars it can randonly select from...

    function wp_generate_password($length = 5, $special_chars = false) {
    	$chars = 'ABCDEFGH23456789';
    	if ( $special_chars )
    		$chars .= '!@#$%^&*()';
    
    	$password = '';
    	for ( $i = 0; $i < $length; $i++ )
    		$password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
    	return $password;
    }

    for bbPress you do a similar thing in \forums\bb-includes\functions.bb-pluggable.php

    function bb_generate_password( $length = 5, $special_chars = false ) {
    	//return WP_Pass::generate_password( $length, $special_chars );
    		$chars = 'abcd23456789';
      	if ( $special_chars )
      		$chars .= '!@#$%^&*()';
    
      	$password = '';
      	for ( $i = 0; $i < $length; $i++ )
      		$password .= substr($chars, rand(0, strlen($chars) - 1), 1);
      	return $password;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic