Changeset 7031
- Timestamp:
- 12/13/2019 09:25:05 PM (6 years ago)
- Location:
- branches/2.6/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/users/functions.php
r6866 r7031 229 229 230 230 // Update the option 231 $key = $user_id . '_new_email';232 $hash = md5( $_POST['email'] . time() . mt_rand() );233 231 $option = array( 234 'hash' => $hash,235 'newemail' => $_POST['email'] 232 'hash' => md5( $_POST['email'] . time() . wp_rand() ), 233 'newemail' => $_POST['email'], 236 234 ); 237 update_ option( $key, $option );235 update_user_meta( $user_id, '_new_email', $option ); 238 236 239 237 // Attempt to notify the user of email address change … … 315 313 // Get the displayed user ID & option key 316 314 $user_id = bbp_get_displayed_user_id(); 317 $key = $user_id .'_new_email';315 $key = '_new_email'; 318 316 $redirect_to = bbp_get_user_profile_edit_url( $user_id ); 319 317 … … 322 320 323 321 // Check for email address change option 324 $new_email = get_ option( $key);322 $new_email = get_user_meta( $user_id, $key, true ); 325 323 326 324 // Redirect if *no* email address change exists … … 331 329 // Cleanup & redirect if *invalid* email address change exists 332 330 if ( empty( $new_email['hash'] ) || empty( $new_email['newemail'] ) ) { 333 delete_ option($key );331 delete_user_meta( $user_id, $key ); 334 332 335 333 bbp_redirect( $redirect_to ); … … 341 339 // Does another user have this email address already? 342 340 if ( email_exists( $new_email['newemail'] ) ) { 343 delete_ option($key );341 delete_user_meta( $user_id, $key ); 344 342 345 343 bbp_add_error( 'bbp_user_email_taken', __( '<strong>ERROR</strong>: That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) ); … … 370 368 } 371 369 372 delete_ option($key );370 delete_user_meta( $user_id, $key ); 373 371 374 372 bbp_redirect( add_query_arg( array( 'updated' => 'true' ), $redirect_to ) ); … … 378 376 379 377 // Delete new email address from user options 380 } elseif ( ! empty( $_GET['dismiss'] ) && ( $key=== $_GET['dismiss'] ) ) {381 if ( ! bbp_verify_nonce_request( "dismiss-{$ key}" ) ) {378 } elseif ( ! empty( $_GET['dismiss'] ) && ( "{$user_id}{$key}" === $_GET['dismiss'] ) ) { 379 if ( ! bbp_verify_nonce_request( "dismiss-{$user_id}{$key}" ) ) { 382 380 bbp_add_error( 'bbp_dismiss_new_email_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 383 381 return; 384 382 } 385 383 386 delete_ option($key );384 delete_user_meta( $user_id, $key ); 387 385 bbp_redirect( $redirect_to ); 388 386 } -
branches/2.6/src/includes/users/template.php
r6966 r7031 1388 1388 // Check for pending email address change 1389 1389 $user_id = bbp_get_displayed_user_id(); 1390 $key = $user_id .'_new_email';1391 $new_email = get_ option( $key);1390 $key = '_new_email'; 1391 $new_email = get_user_meta( $user_id, $key, true ); 1392 1392 1393 1393 // Bail if no pending email address change … … 1398 1398 // Build the nonced URL to dismiss the pending change 1399 1399 $user_url = bbp_get_user_profile_edit_url( $user_id ); 1400 $nonce = "dismiss-{$ key}";1400 $nonce = "dismiss-{$user_id}{$key}"; 1401 1401 $args = array( 1402 1402 'action' => 'bbp-update-user-email', 1403 'dismiss' => $key1403 'dismiss' => "{$user_id}{$key}" 1404 1404 ); 1405 1405 -
branches/2.6/src/templates/default/css/bbpress.css
r7000 r7031 1126 1126 } 1127 1127 1128 #bbpress-forums div.bbp-template-notice code { 1129 font-size: 11px; 1130 padding: 2px 4px; 1131 background: rgba(200,200,200,0.3); 1132 border-radius: 3px; 1133 } 1134 1128 1135 /* =Stickies 1129 1136 -------------------------------------------------------------- */
Note: See TracChangeset
for help on using the changeset viewer.