X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be15bd505d66a91e2c80062190b13e315a04a9..245e789b234afa4525862e7a6e5e3c2e7a52ef20:/wp-admin/user-new.php diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index 33b81964..b5c9c0bc 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( dirname( __FILE__ ) . '/admin.php' ); if ( is_multisite() ) { if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) @@ -85,7 +85,7 @@ You\'ve been invited to join \'%1$s\' at Please click the following link to confirm the invite: %4$s' ); - wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), get_option( 'blogname' ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) ); + wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) ); $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' ); } } @@ -111,12 +111,19 @@ Please click the following link to confirm the invite: die(); } } else { - // Adding a new user to this blog + // Adding a new user to this site $user_details = wpmu_validate_user_signup( $_REQUEST[ 'user_login' ], $_REQUEST[ 'email' ] ); if ( is_wp_error( $user_details[ 'errors' ] ) && !empty( $user_details[ 'errors' ]->errors ) ) { $add_user_errors = $user_details[ 'errors' ]; } else { - $new_user_login = apply_filters('pre_user_login', sanitize_user(wp_unslash($_REQUEST['user_login']), true)); + /** + * Filter the user_login, also known as the username, before it is added to the site. + * + * @since 2.0.3 + * + * @param string $user_login The sanitized username. + */ + $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) ); if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email } @@ -175,19 +182,26 @@ get_current_screen()->add_help_tab( array( get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Documentation on Adding New Users') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Support Forums') . '

' ); wp_enqueue_script('wp-ajax-response'); wp_enqueue_script('user-profile'); +/** + * Filter whether to enable user auto-complete for non-super admins in Multisite. + * + * @since 3.4.0 + * + * @param bool $enable Whether to enable auto-complete for non-super admins. Default false. + */ if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) && ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) ) ) { wp_enqueue_script( 'user-suggest' ); } -require_once( 'admin-header.php' ); +require_once( ABSPATH . 'wp-admin/admin-header.php' ); if ( isset($_GET['update']) ) { $messages = array(); @@ -219,7 +233,6 @@ if ( isset($_GET['update']) ) { } ?>
-

-
> + +> @@ -289,6 +309,20 @@ if ( is_multisite() ) { + 'addusersub' ) ); ?>
' . __( 'Add New User' ) . '

'; ?> -

-
> +

+ +> - + 'login', 'first_name' => 'firstname', 'last_name' => 'lastname', @@ -338,7 +373,15 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam - + @@ -352,12 +395,12 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam
-

+

- + @@ -380,10 +423,15 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam + + 'createusersub' ) ); ?>