Ticket #20221: user-new.diff
File user-new.diff, 3.1 KB (added by , 13 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( 'manage_options' ) ) { 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( 'manage_options' ) ) { 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 { … … 115 115 $add_user_errors = $user_details[ 'errors' ]; 116 116 } else { 117 117 $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); 118 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {118 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_options' ) ) { 119 119 add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email 120 120 } 121 121 wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) ); 122 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {122 if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_options' ) ) { 123 123 $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' ] ) ); 124 124 wpmu_activate_signup( $key ); 125 125 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); … … 281 281 </select> 282 282 </td> 283 283 </tr> 284 <?php if ( is_super_admin() ) { ?>284 <?php if ( current_user_can( 'manage_options' ) ) { ?> 285 285 <tr> 286 286 <th scope="row"><label for="adduser-noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 287 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> … … 365 365 </select> 366 366 </td> 367 367 </tr> 368 <?php if ( is_multisite() && is_super_admin() ) { ?>368 <?php if ( is_multisite() && current_user_can( 'manage_options' ) ) { ?> 369 369 <tr> 370 370 <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 371 371 <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>