WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#9210 closed enhancement (duplicate)

random password generator [editing users page]

Reported by: jdingman Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Users Keywords:
Focuses: Cc:

Description

An enhancement to add a "random password generator" to the field below password and password again

to make it easier to create random passwords for users.

this goes one step beyond the password strength meter, to give admins the ability to create completely random passwords

Change History (5)

comment:1 Denis-de-Bernardy5 years ago

  • Component changed from General to Users
  • Owner anonymous deleted

comment:2 Denis-de-Bernardy5 years ago

  • Keywords needs-patch added; dev-feedback removed

comment:3 sivel4 years ago

Simply because I don't want to lose this code again, here is a javascript version of wp_generate_password:

var wp_generate_password = function(length, special_chars) {
        length = ( typeof length == 'undefined' ) ? 12 : length;
        special_chars = ( typeof special_chars == 'undefined' ) ? true : special_chars;
        chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
        if ( special_chars )
                chars = chars + '!@#$%^&*()';
 
        password = '';
        for ( i = 0; i < length; i++ ) {
                start = Math.floor(Math.random()*chars.length);
                password = password + chars.substring(start - 1, start);
        }
        return password;
}

I figure this could be of use for this ticket.

comment:4 solarissmoke3 years ago

  • Keywords needs-patch removed
  • Resolution set to duplicate
  • Status changed from new to closed

comment:5 nacin3 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.