• Resolved deanes02

    (@deanes02)


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter deanes02

    (@deanes02)

    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

    Thread Starter deanes02

    (@deanes02)

    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;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Simplify default passwords – how to?’ is closed to new replies.