Changeset 58999
- Timestamp:
- 09/09/2024 10:15:24 AM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/user-new.php
r57274 r58999 35 35 $user_details = null; 36 36 $user_email = wp_unslash( $_REQUEST['email'] ); 37 37 38 if ( str_contains( $user_email, '@' ) ) { 38 39 $user_details = get_user_by( 'email', $user_email ); … … 64 65 $username = $user_details->user_login; 65 66 $user_id = $user_details->ID; 66 if ( null != $username && array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) { 67 68 if ( array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) { 67 69 $redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' ); 68 70 } else { … … 179 181 } 180 182 } 183 181 184 wp_redirect( $redirect ); 182 185 die(); … … 203 206 $redirect = add_query_arg( 'update', 'add', 'user-new.php' ); 204 207 } 208 205 209 wp_redirect( $redirect ); 206 210 die(); … … 210 214 $new_user_email = wp_unslash( $_REQUEST['email'] ); 211 215 $user_details = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email ); 216 212 217 if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) { 213 218 $add_user_errors = $user_details['errors']; … … 215 220 /** This filter is documented in wp-includes/user.php */ 216 221 $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) ); 222 217 223 if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { 218 224 add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email. 219 225 add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email. 220 226 } 227 221 228 wpmu_signup_user( 222 229 $new_user_login, … … 227 234 ) 228 235 ); 236 229 237 if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { 230 238 $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) ); … … 246 254 $redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' ); 247 255 } 256 248 257 wp_redirect( $redirect ); 249 258 die();
Note: See TracChangeset
for help on using the changeset viewer.