Make WordPress Core

Opened 18 years ago

Closed 16 years ago

Last modified 16 years ago

#9210 closed enhancement (duplicate)

random password generator [editing users page]

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

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
18 years ago

  • Component General → Users
  • Owner anonymous removed

#2 @Denis-de-Bernardy
18 years ago

  • Keywords needs-patch added; dev-feedback removed

#3 @sivel
17 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
16 years ago

  • Keywords needs-patch removed
  • Resolution → duplicate
  • Status new → closed

#5 @nacin
16 years ago

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