Ticket #22277: 22277.3.diff
File 22277.3.diff, 2.7 KB (added by , 11 years ago) |
---|
-
src/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> … … 372 370 </select> 373 371 </td> 374 372 </tr> 375 <?php if ( is_multisite() && is_super_admin()) { ?>373 <?php if ( is_multisite() ) { ?> 376 374 <tr> 377 375 <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 378 376 <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>