Changeset 723729
- Timestamp:
- 06/06/2013 11:25:50 PM (13 years ago)
- Location:
- simple-user-password-generator/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
simple-user-password-generator.js (modified) (1 diff)
-
simple-user-password-generator.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-user-password-generator/trunk/readme.txt
r620757 r723729 4 4 Tags: users, password, security 5 5 Requires at least: 3.2 6 Tested up to: 3. 4.17 Stable tag: 2.0. 16 Tested up to: 3.6 7 Stable tag: 2.0.2 8 8 License: GPLv2 9 9 … … 33 33 == Changelog == 34 34 35 = 2.0.2 = 36 * Refactored / improved JavaScript (faster) 37 * Fixed improper PHP class variable name that collided with Simple Local Avatars plug-in 38 35 39 = 2.0.1 = 36 40 * French translation added -
simple-user-password-generator/trunk/simple-user-password-generator.js
r590527 r723729 1 var supg_pass1 = document.getElementById('pass1'); 2 var supg_send_password = document.getElementById('send_password'); 3 jQuery(supg_pass1).closest('td').append('<p style="clear:both;margin:0;"><input type="button" name="simple-user-generate-password" id="simple-user-generate-password" value="' + simple_user_password_generator_l10n.Generate + '" onclick="simple_user_generate_password();" class="button" style="width: auto;" /></p>'); 4 jQuery(supg_send_password).closest('td').append('<br /><label for="reset_password_notice"><input type="checkbox" id="reset_password_notice" name="reset_password_notice" /> ' + simple_user_password_generator_l10n.PassChange + '</label>') 5 6 jQuery(supg_pass1).on('keyup',function(){ 7 var passval = this.value; 8 if ( '' == passval ) jQuery(supg_send_password).attr('disabled','disabled'); 9 else jQuery(supg_send_password).removeAttr('disabled'); 10 }); 11 1 12 function simple_user_generate_password() { 2 13 jQuery.post( ajaxurl, { action: 'simple_user_generate_password' }, function(response){ 3 jQuery('#pass2').val(response); 4 jQuery('#pass1').val(response).trigger('keyup'); 5 jQuery('#send_password').attr('checked',true); 6 jQuery('#reset_password_notice').attr('checked',true); 14 document.getElementById('pass2').value = response; 15 supg_pass1.value = response; 16 jQuery(supg_pass1).trigger('keyup'); 17 jQuery(supg_send_password).attr('checked',true); 18 jQuery(document.getElementById('reset_password_notice')).attr('checked',true); 7 19 }); 8 20 } 9 10 jQuery(document).ready(function(){11 jQuery('#pass1').closest('td').append('<p style="clear:both;margin:0;"><input type="button" name="simple-user-generate-password" id="simple-user-generate-password" value="' + simple_user_password_generator_l10n.Generate + '" onclick="simple_user_generate_password();" class="button" style="width: auto;" /></p>');12 jQuery('#send_password').closest('td').append('<br /><label for="reset_password_notice"><input type="checkbox" id="reset_password_notice" name="reset_password_notice" /> ' + simple_user_password_generator_l10n.PassChange + '</label>')13 }); -
simple-user-password-generator/trunk/simple-user-password-generator.php
r620757 r723729 4 4 Plugin URI: http://10up.com/plugins/simple-user-password-generator-wordpress/ 5 5 Description: Allows administrators to generate a secure password when adding new users. 6 Version: 2.0. 17 Author: Jake Goldman (10up LLC)6 Version: 2.0.2 7 Author: Jake Goldman, 10up 8 8 Author URI: http://10up.com 9 10 Plugin: Copyright 2011 10up LLC (email : jake@10up.com) 11 12 This program is free software; you can redistribute it and/or modify 13 it under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2 of the License, or 15 (at your option) any later version. 16 17 This program is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 9 License: GPLv2 or later 25 10 */ 26 11 … … 46 31 47 32 public function enqueue_script() { 48 if ( ! apply_filters( 'show_password_fields', true ) || !current_user_can( 'edit_users' ) )33 if ( ! apply_filters( 'show_password_fields', true ) || ! current_user_can( 'edit_users' ) ) 49 34 return; 50 35 51 wp_enqueue_script( 'simple-user-password-generator', plugin_dir_url( __FILE__ ) . 'simple-user-password-generator.js', array( 'jquery' ), ' 1.0' );52 36 wp_enqueue_script( 'simple-user-password-generator', plugin_dir_url( __FILE__ ) . 'simple-user-password-generator.js', array( 'jquery' ), '2.0', true ); 37 53 38 $js_trans = array( 54 39 'Generate' => esc_attr( __( 'Generate Password', 'simple-user-password-generator' ) ), … … 63 48 64 49 public function user_register( $user_id ) { 65 if ( current_user_can( 'add_users' ) && ! empty( $_POST['reset_password_notice'] ) )50 if ( current_user_can( 'add_users' ) && ! empty( $_POST['reset_password_notice'] ) ) 66 51 update_user_option( $user_id, 'default_password_nag', true, true ); 67 52 } … … 76 61 </tr> 77 62 </table> 78 <script type="text/javascript">79 jQuery('#pass1').keyup(function(){80 var passval = jQuery(this).val();81 if ( passval == '' ) jQuery('#send_password').attr('disabled','disabled');82 else jQuery('#send_password').removeAttr('disabled');83 });84 </script>85 63 <?php 86 64 } 87 65 88 66 public function user_profile_update_errors( $errors, $update, $user ) { 89 if ( ! current_user_can( 'edit_users' ) || empty( $_POST['_simple_user_password_generator'] ) || !wp_verify_nonce( $_POST['_simple_user_password_generator'], 'simple-user-password-generator-reset' ) )67 if ( ! current_user_can( 'edit_users' ) || empty( $_POST['_simple_user_password_generator'] ) || ! wp_verify_nonce( $_POST['_simple_user_password_generator'], 'simple-user-password-generator-reset' ) ) 90 68 return; 91 69 92 70 $this->user_register( $user->ID ); 93 71 94 if ( ! $update || empty( $user->user_pass ) || empty( $_POST['send_password'] ) )72 if ( ! $update || empty( $user->user_pass ) || empty( $_POST['send_password'] ) ) 95 73 return; 96 74 … … 104 82 } 105 83 106 $simple_local_ avatars= new simple_user_password_generator;84 $simple_local_password_generator = new simple_user_password_generator;
Note: See TracChangeset
for help on using the changeset viewer.