Changeset 6303 for trunk/wp-admin/includes/user.php
- Timestamp:
- 11/01/2007 06:23:16 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/user.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/user.php
r6188 r6303 83 83 do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 )); 84 84 85 if (!$update ) { 86 if ( $pass1 == '' || $pass2 == '' ) 87 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' )); 88 } else { 89 if ((empty ( $pass1 ) && !empty ( $pass2 ) ) || (empty ( $pass2 ) && !empty ( $pass1 ) ) ) 90 $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' )); 85 if ( $update ) { 86 if ( empty($pass1) && !empty($pass2) ) 87 $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) ); 88 elseif ( !empty($pass1) && empty($pass2) ) 89 $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) ); 90 } else { 91 if ( empty($pass1) ) 92 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) ); 93 elseif ( empty($pass2) ) 94 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) ); 91 95 } 92 96 93 97 /* Check for "\" in password */ 94 98 if( strpos( " ".$pass1, "\\" ) ) 95 $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ) );99 $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); 96 100 97 101 /* checking the password has been typed twice the same */ 98 102 if ( $pass1 != $pass2 ) 99 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ) );103 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) ); 100 104 101 105 if (!empty ( $pass1 )) … … 110 114 /* checking e-mail address */ 111 115 if ( empty ( $user->user_email ) ) { 112 $errors->add( 'user_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ) );116 $errors->add( 'user_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) ); 113 117 } else 114 118 if (!is_email( $user->user_email ) ) { 115 $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ) );119 $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) ); 116 120 } 117 121
Note: See TracChangeset
for help on using the changeset viewer.