]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/user-new.php
WordPress 3.4
[autoinstalls/wordpress.git] / wp-admin / user-new.php
index 43c37033e0ec42dba47c09a99efa2d9fd28a7da5..3119eb5720edcc316aea37279a38bea940ac1214 100644 (file)
@@ -26,7 +26,7 @@ If you do not want to join this site please ignore
 this email. This invitation will expire in a few days.
 
 Please click the following link to activate your user account:
 this email. This invitation will expire in a few days.
 
 Please click the following link to activate your user account:
-%%s' ), get_bloginfo('name'), site_url(), esc_html( $_REQUEST[ 'role' ] ) );
+%%s' ), get_bloginfo('name'), home_url(), esc_html( $_REQUEST[ 'role' ] ) );
        }
        add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );
 
        }
        add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );
 
@@ -80,7 +80,7 @@ You\'ve been invited to join \'%1$s\' at
 
 Please click the following link to confirm the invite:
 %4$s' );
 
 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'), site_url(), $_REQUEST[ 'role' ], site_url("/newbloguser/$newuser_key/")));
+                       wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), get_option( 'blogname' ) ), sprintf($message, get_option('blogname'), home_url(), $_REQUEST[ 'role' ], home_url("/newbloguser/$newuser_key/")));
                        $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' );
                }
        }
                        $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' );
                }
        }
@@ -92,18 +92,16 @@ Please click the following link to confirm the invite:
        if ( ! current_user_can('create_users') )
                wp_die(__('Cheatin’ uh?'));
 
        if ( ! current_user_can('create_users') )
                wp_die(__('Cheatin’ uh?'));
 
-       if ( !is_multisite() ) {
-               $user_id = add_user();
+       if ( ! is_multisite() ) {
+               $user_id = edit_user();
 
                if ( is_wp_error( $user_id ) ) {
                        $add_user_errors = $user_id;
                } else {
 
                if ( is_wp_error( $user_id ) ) {
                        $add_user_errors = $user_id;
                } else {
-                       if ( current_user_can('edit_users') ) {
-                               $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true));
-                               $redirect = 'users.php?usersearch='. urlencode($new_user_login) . '&update=add' . '#user-' . $user_id;
-                       } else {
+                       if ( current_user_can( 'list_users' ) )
+                               $redirect = 'users.php?update=add&id=' . $user_id;
+                       else
                                $redirect = add_query_arg( 'update', 'add', 'user-new.php' );
                                $redirect = add_query_arg( 'update', 'add', 'user-new.php' );
-                       }
                        wp_redirect( $redirect );
                        die();
                }
                        wp_redirect( $redirect );
                        die();
                }
@@ -143,7 +141,7 @@ $help = '<p>' . __('To add a new user to your site, fill in the form on this scr
 
 if ( is_multisite() ) {
        $help .= '<p>' . __('Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user&#8217;s name to Edit the user profile under Network Admin > All Users.') . '</p>' .
 
 if ( is_multisite() ) {
        $help .= '<p>' . __('Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user&#8217;s name to Edit the user profile under Network Admin > All Users.') . '</p>' .
-       '<p>' . __('New users will receive an email letting them know they&#8217;ve been added as a user for your site. This email will also contain their password. Check the box if you don&#8217;t want the user to recieve a welcome email.') . '</p>';
+       '<p>' . __('New users will receive an email letting them know they&#8217;ve been added as a user for your site. This email will also contain their password. Check the box if you don&#8217;t want the user to receive a welcome email.') . '</p>';
 } else {
        $help .= '<p>' . __('You must assign a password to the new user, which they can change after logging in. The username, however, cannot be changed.') . '</p>' .
        '<p>' . __('New users will receive an email letting them know they&#8217;ve been added as a user for your site. By default, this email will also contain their password. Uncheck the box if you don&#8217;t want the password to be included in the welcome email.') . '</p>';
 } else {
        $help .= '<p>' . __('You must assign a password to the new user, which they can change after logging in. The username, however, cannot be changed.') . '</p>' .
        '<p>' . __('New users will receive an email letting them know they&#8217;ve been added as a user for your site. By default, this email will also contain their password. Uncheck the box if you don&#8217;t want the password to be included in the welcome email.') . '</p>';
@@ -163,7 +161,7 @@ get_current_screen()->add_help_tab( array(
 'content' => '<p>' . __('Here is a basic overview of the different user roles and the permissions associated with each one:') . '</p>' .
                                '<ul>' .
                                '<li>' . __('Administrators have access to all the administration features.') . '</li>' .
 'content' => '<p>' . __('Here is a basic overview of the different user roles and the permissions associated with each one:') . '</p>' .
                                '<ul>' .
                                '<li>' . __('Administrators have access to all the administration features.') . '</li>' .
-                               '<li>' . __('Editors can publish posts, manage posts as well as manage other people&#8217;s posts, etc.')  . '</li>' .
+                               '<li>' . __('Editors can publish posts, manage posts as well as manage other people&#8217;s posts, etc.') . '</li>' .
                                '<li>' . __('Authors can publish and manage their own posts, and are able to upload files.') . '</li>' .
                                '<li>' . __('Contributors can write and manage their posts but not publish posts or upload media files.') . '</li>' .
                                '<li>' . __('Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.') . '</li>' .
                                '<li>' . __('Authors can publish and manage their own posts, and are able to upload files.') . '</li>' .
                                '<li>' . __('Contributors can write and manage their posts but not publish posts or upload media files.') . '</li>' .
                                '<li>' . __('Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.') . '</li>' .
@@ -179,7 +177,13 @@ get_current_screen()->set_help_sidebar(
 wp_enqueue_script('wp-ajax-response');
 wp_enqueue_script('user-profile');
 
 wp_enqueue_script('wp-ajax-response');
 wp_enqueue_script('user-profile');
 
-require_once ('admin-header.php');
+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' );
 
 if ( isset($_GET['update']) ) {
        $messages = array();
 
 if ( isset($_GET['update']) ) {
        $messages = array();
@@ -251,10 +255,10 @@ if ( is_multisite() ) {
        if ( $do_both )
                echo '<h3 id="add-existing-user">' . __('Add Existing User') . '</h3>';
        if ( !is_super_admin() ) {
        if ( $do_both )
                echo '<h3 id="add-existing-user">' . __('Add Existing User') . '</h3>';
        if ( !is_super_admin() ) {
-               _e( 'Enter the email address of an existing user on this network to invite them to this site.  That person will be sent an email asking them to confirm the invite.' );
+               _e( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
                $label = __('E-mail');
        } else {
                $label = __('E-mail');
        } else {
-               _e( 'Enter the email address or username of an existing user on this network to invite them to this site.  That person will be sent an email asking them to confirm the invite.' );
+               _e( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
                $label = __('E-mail or Username');
        }
 ?>
                $label = __('E-mail or Username');
        }
 ?>
@@ -265,7 +269,7 @@ if ( is_multisite() ) {
 <table class="form-table">
        <tr class="form-field form-required">
                <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
 <table class="form-table">
        <tr class="form-field form-required">
                <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
-               <td><input name="email" type="text" id="adduser-email" value="" /></td>
+               <td><input name="email" type="text" id="adduser-email" class="wp-suggest-user" value="" /></td>
        </tr>
        <tr class="form-field">
                <th scope="row"><label for="adduser-role"><?php _e('Role'); ?></label></th>
        </tr>
        <tr class="form-field">
                <th scope="row"><label for="adduser-role"><?php _e('Role'); ?></label></th>
@@ -361,7 +365,7 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam
        <?php if ( is_multisite() && is_super_admin() ) { ?>
        <tr>
                <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
        <?php if ( is_multisite() && is_super_admin() ) { ?>
        <tr>
                <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
-               <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>
+               <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>
        </tr>
        <?php } ?>
 </table>
        </tr>
        <?php } ?>
 </table>
@@ -373,4 +377,3 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam
 </div>
 <?php
 include('./admin-footer.php');
 </div>
 <?php
 include('./admin-footer.php');
-?>