Ticket #22277: 22277.2.patch
File 22277.2.patch, 2.7 KB (added by , 12 years ago) |
---|
-
wp-admin/user-new.php
68 68 if ( ( $username != null && !is_super_admin( $user_id ) ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) { 69 69 $redirect = add_query_arg( array('update' => 'addexisting'), 'user-new.php' ); 70 70 } else { 71 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin()) {71 if ( isset( $_POST[ 'noconfirmation' ] ) ) { 72 72 add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) ); 73 73 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); 74 74 } else { … … 117 117 $add_user_errors = $user_details[ 'errors' ]; 118 118 } else { 119 119 $new_user_login = apply_filters('pre_user_login', sanitize_user(wp_unslash($_REQUEST['user_login']), true)); 120 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin()) {120 if ( isset( $_POST[ 'noconfirmation' ] ) ) { 121 121 add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email 122 122 } 123 123 wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) ); 124 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin()) {124 if ( isset( $_POST[ 'noconfirmation' ] ) ) { 125 125 $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $_REQUEST[ 'email' ] ) ); 126 126 wpmu_activate_signup( $key ); 127 127 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); … … 282 282 </select> 283 283 </td> 284 284 </tr> 285 <?php if ( is_super_admin() ) { ?>286 285 <tr> 287 286 <th scope="row"><label for="adduser-noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 288 287 <td><label for="adduser-noconfirmation"><input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" /> <?php _e( 'Add the user without sending them a confirmation email.' ); ?></label></td> 289 288 </tr> 290 <?php } ?>291 289 </table> 292 290 <?php submit_button( __( 'Add Existing User '), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?> 293 291 </form> … … 366 364 </select> 367 365 </td> 368 366 </tr> 369 <?php if ( is_multisite() && is_super_admin()) { ?>367 <?php if ( is_multisite() ) { ?> 370 368 <tr> 371 369 <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 372 370 <td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> <?php _e( 'Add the user without sending them a confirmation email.' ); ?></label></td>