]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/network/site-users.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / network / site-users.php
index 57a189b7ae512701e837c76399370b11910c71d1..0ab1771088a8185e48e02f0f41e113d5e385ffd1 100644 (file)
@@ -49,6 +49,10 @@ if ( ! $id )
        wp_die( __('Invalid site ID.') );
 
 $details = get_blog_details( $id );
        wp_die( __('Invalid site ID.') );
 
 $details = get_blog_details( $id );
+if ( ! $details ) {
+       wp_die( __( 'The requested site does not exist.' ) );
+}
+
 if ( ! can_edit_network( $details->site_id ) )
        wp_die( __( 'You do not have permission to access this page.' ), 403 );
 
 if ( ! can_edit_network( $details->site_id ) )
        wp_die( __( 'You do not have permission to access this page.' ), 403 );
 
@@ -70,10 +74,10 @@ if ( $action ) {
                                $password = wp_generate_password( 12, false);
                                $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
 
                                $password = wp_generate_password( 12, false);
                                $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
 
-                               if ( false == $user_id ) {
+                               if ( false === $user_id ) {
                                        $update = 'err_new_dup';
                                } else {
                                        $update = 'err_new_dup';
                                } else {
-                                       wp_new_user_notification( $user_id, $password );
+                                       wp_new_user_notification( $user_id, 'both' );
                                        add_user_to_blog( $id, $user_id, $_POST['new_role'] );
                                        $update = 'newuser';
                                }
                                        add_user_to_blog( $id, $user_id, $_POST['new_role'] );
                                        $update = 'newuser';
                                }
@@ -157,9 +161,7 @@ if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
 
 add_screen_option( 'per_page' );
 
 
 add_screen_option( 'per_page' );
 
-$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
-$title_site_url_linked = sprintf( __( 'Edit Site: %s' ), '<a href="' . get_blogaddress_by_id( $id ) . '">' . $site_url_no_http . '</a>' );
-$title = sprintf( __( 'Edit Site: %s' ), $site_url_no_http );
+$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
 
 $parent_file = 'sites.php';
 $submenu_file = 'sites.php';
 
 $parent_file = 'sites.php';
 $submenu_file = 'sites.php';
@@ -182,7 +184,8 @@ var current_site_id = <?php echo $id; ?>;
 
 
 <div class="wrap">
 
 
 <div class="wrap">
-<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
+<h1 id="edit-site"><?php echo $title; ?></h1>
+<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
 <h3 class="nav-tab-wrapper">
 <?php
 $tabs = array(
 <h3 class="nav-tab-wrapper">
 <?php
 $tabs = array(
@@ -305,7 +308,7 @@ if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_use
                        </select></td>
                </tr>
                <tr class="form-field">
                        </select></td>
                </tr>
                <tr class="form-field">
-                       <td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
+                       <td colspan="2"><?php _e( 'A password reset link will be sent to the user via email.' ) ?></td>
                </tr>
        </table>
        <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?>
                </tr>
        </table>
        <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?>