Make WordPress Core

Opened 15 years ago

Closed 13 years ago

Last modified 13 years ago

#9210 closed enhancement (duplicate)

random password generator [editing users page]

Reported by: jdingman's profile 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)

#1 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Users
  • Owner anonymous deleted

#2 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch added; dev-feedback removed

#3 @sivel
14 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.

#4 @solarissmoke
13 years ago

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

#5 @nacin
13 years ago

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