IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 326 | 326 | wp_die( 1 ); |
| 327 | 327 | } |
| 328 | 328 | |
| | 329 | /** |
| | 330 | * Ajax handler for profile password |
| | 331 | * |
| | 332 | * @since 4.3 |
| | 333 | */ |
| | 334 | function wp_ajax_new_password() { |
| | 335 | $return = array( |
| | 336 | 'newpassword' => wp_generate_password( 24 ) |
| | 337 | ); |
| | 338 | wp_send_json( $return ); |
| | 339 | } |
| | 340 | |
| 329 | 341 | // |
| 330 | 342 | // Ajax helpers. |
| 331 | 343 | // |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 45 | 45 | |
| 46 | 46 | $core_actions_get = array( |
| 47 | 47 | 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', |
| 48 | | 'autocomplete-user', 'dashboard-widgets', 'logged-in', |
| | 48 | 'autocomplete-user', 'dashboard-widgets', 'logged-in', 'new-password' |
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | 51 | $core_actions_post = array( |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 13 | 13 | pw_submitbtn_edit = $('#submit'), |
| 14 | 14 | pw_submitbtn_new = $( '#createusersub' ), |
| 15 | 15 | pw_checkbox = $('.pw-checkbox'), |
| 16 | | pw_weak = $('.pw-weak') |
| | 16 | pw_weak = $('.pw-weak'), |
| | 17 | pw_firsttime = true |
| 17 | 18 | ; |
| 18 | 19 | |
| 19 | 20 | var generatePassword = window.generatePassword = function() { |
| 20 | 21 | if ( typeof zxcvbn !== 'function' ) { |
| 21 | 22 | setTimeout( generatePassword, 50 ); |
| 22 | 23 | } else { |
| 23 | | pw_field.val( pw_field.data( 'pw' ) ); |
| 24 | | pw_field.trigger( 'propertychange' ); |
| 25 | | pw_field.attr( 'type', 'text' ).focus(); |
| 26 | | pw_field[0].setSelectionRange(100, 100); |
| 27 | | } |
| | 24 | |
| | 25 | if( !pw_firsttime ) { |
| | 26 | |
| | 27 | $.ajax({ |
| | 28 | url: ajaxurl, |
| | 29 | global: false, |
| | 30 | dataType: 'json', |
| | 31 | data: {'action': 'new-password'}, |
| | 32 | success: function(response) { |
| | 33 | pw_field.val( response.newpassword ); |
| | 34 | pw_field.trigger( 'propertychange' ); |
| | 35 | pw_field.attr( 'type', 'text' ).focus(); |
| | 36 | pw_field[0].setSelectionRange(100, 100); |
| | 37 | } |
| | 38 | }); |
| | 39 | |
| | 40 | } else { |
| | 41 | |
| | 42 | pw_field.val( pw_field.data( 'pw' ) ); |
| | 43 | pw_field.trigger( 'propertychange' ); |
| | 44 | pw_field.attr( 'type', 'text' ).focus(); |
| | 45 | pw_field[0].setSelectionRange(100, 100); |
| | 46 | pw_firsttime = false; |
| | 47 | |
| | 48 | } |
| | 49 | |
| | 50 | } |
| 28 | 51 | }; |
| 29 | 52 | |
| 30 | 53 | pw_2.hide(); |
| … |
… |
|
| 85 | 108 | } ); |
| 86 | 109 | |
| 87 | 110 | pw_new.on( 'click', 'button.wp-generate-pw', function(){ |
| 88 | | pw_generatebtn.hide(); |
| 89 | 111 | pw_line.show(); |
| 90 | 112 | generatePassword(); |
| 91 | 113 | }); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 462 | 462 | <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th> |
| 463 | 463 | <td> |
| 464 | 464 | <input class="hidden" value=" " /><!-- #24364 workaround --> |
| 465 | | <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate new password' ); ?></button> |
| 466 | 465 | <div class="wp-pwd hide-if-js"> |
| 467 | 466 | <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" /> |
| 468 | 467 | <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0"> |
| … |
… |
|
| 471 | 470 | </button> |
| 472 | 471 | <div style="display:none" id="pass-strength-result"></div> |
| 473 | 472 | </div> |
| | 473 | <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate new password' ); ?></button> |
| 474 | 474 | </td> |
| 475 | 475 | </tr> |
| 476 | 476 | <tr class="user-pass2-wrap hide-if-js"> |