Changeset 10801 for branches/2.5/src/bp-members/bp-members-functions.php
- Timestamp:
- 05/24/2016 02:45:08 PM (10 years ago)
- Location:
- branches/2.5
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/bp-members/bp-members-functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5
-
branches/2.5/src/bp-members/bp-members-functions.php
r10601 r10801 1792 1792 $user_login = preg_replace( '/\s+/', '', sanitize_user( $user_login, true ) ); 1793 1793 $user_email = sanitize_email( $user_email ); 1794 $activation_key = substr( md5( time() . rand() . $user_email ), 0, 16);1794 $activation_key = wp_generate_password( 32, false ); 1795 1795 1796 1796 /** … … 1814 1814 } 1815 1815 1816 $activation_key = wp_hash( $user_id );1817 1816 bp_update_user_meta( $user_id, 'activation_key', $activation_key ); 1818 1817 } … … 1938 1937 $user_id = username_exists( $signup->user_login ); 1939 1938 1940 // Create the user. 1939 // Create the user. This should only be necessary if BP_SIGNUPS_SKIP_USER_CREATION is true. 1941 1940 if ( ! $user_id ) { 1942 1941 $user_id = wp_create_user( $signup->user_login, $password, $signup->user_email ); 1943 1942 1944 // If a user ID is found, this may be a legacy signup, or one1945 // created locally for backward compatibility. Process it.1946 } elseif ( $key == wp_hash( $user_id ) ) { 1943 // Otherwise, update the existing user's status. 1944 } elseif ( $key === bp_get_user_meta( $user_id, 'activation_key', true ) || $key === wp_hash( $user_id ) ) { 1945 1947 1946 // Change the user's status so they become active. 1948 1947 if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) { … … 2104 2103 // Rebuild the activation key, if missing. 2105 2104 if ( empty( $signup->activation_key ) ) { 2106 $signup->activation_key = wp_ hash( $signup->ID);2105 $signup->activation_key = wp_generate_password( 32, false ); 2107 2106 } 2108 2107
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)