#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)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.