Ticket #20221: user-new.2.patch
File user-new.2.patch, 3.1 KB (added by , 12 years ago) |
---|
-
user-new.php
42 42 if ( false !== strpos($_REQUEST[ 'email' ], '@') ) { 43 43 $user_details = get_user_by('email', $_REQUEST[ 'email' ]); 44 44 } else { 45 if ( is_super_admin() ) {45 if ( current_user_can( 'promote_users' ) ) { 46 46 $user_details = get_user_by('login', $_REQUEST[ 'email' ]); 47 47 } else { 48 48 wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) ); … … 66 66 if ( ( $username != null && !is_super_admin( $user_id ) ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) { 67 67 $redirect = add_query_arg( array('update' => 'addexisting'), 'user-new.php' ); 68 68 } else { 69 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {69 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'promote_users' ) ) { 70 70 add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) ); 71 71 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); 72 72 } else { … … 113 113 $add_user_errors = $user_details[ 'errors' ]; 114 114 } else { 115 115 $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); 116 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {116 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'promote_users' ) ) { 117 117 add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email 118 118 } 119 119 wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) ); 120 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {120 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'promote_users' ) ) { 121 121 $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' ] ) ); 122 122 wpmu_activate_signup( $key ); 123 123 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); … … 278 278 </select> 279 279 </td> 280 280 </tr> 281 <?php if ( is_super_admin() ) { ?>281 <?php if ( current_user_can( 'promote_users' ) ) { ?> 282 282 <tr> 283 283 <th scope="row"><label for="adduser-noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 284 284 <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> … … 362 362 </select> 363 363 </td> 364 364 </tr> 365 <?php if ( is_multisite() && is_super_admin() ) { ?>365 <?php if ( is_multisite() && current_user_can( 'promote_users' ) ) { ?> 366 366 <tr> 367 367 <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 368 368 <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>