Index: wp-login.php
===================================================================
--- wp-login.php	(revision 21078)
+++ wp-login.php	(working copy)
@@ -630,7 +630,7 @@
 			elseif ( is_multisite() && !$user->has_cap('read') )
 				$redirect_to = get_dashboard_url( $user->ID );
 			elseif ( !$user->has_cap('edit_posts') )
-				$redirect_to = admin_url('profile.php');
+				$redirect_to = get_edit_user_link();
 		}
 		wp_safe_redirect($redirect_to);
 		exit();
Index: wp-includes/admin-bar.php
===================================================================
--- wp-includes/admin-bar.php	(revision 21078)
+++ wp-includes/admin-bar.php	(working copy)
@@ -470,6 +470,18 @@
 				'title' => $tax->labels->edit_item,
 				'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy )
 			) );
+		} elseif ( is_a( $current_object, 'WP_User' )
+			&& current_user_can( 'edit_user', $current_object->ID ) )
+		{
+			if ( get_current_user_id() == $current_object->ID )
+				$title = __( 'Edit My Profile' );
+			else
+				$title = __( 'Edit User' );
+			$wp_admin_bar->add_menu( array(
+				'id' => 'edit',
+				'title' => $title,
+				'href' => get_edit_user_link( $current_object->ID )
+			) );
 		}
 	}
 }
Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 21078)
+++ wp-includes/comment-template.php	(working copy)
@@ -1537,7 +1537,7 @@
 		'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
 		'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
 		'must_log_in'          => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
-		'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
+		'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
 		'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
 		'comment_notes_after'  => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
 		'id_form'              => 'commentform',
Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 21078)
+++ wp-includes/link-template.php	(working copy)
@@ -1054,6 +1054,34 @@
 	echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
 }
 
+/**
+ * Retrieve edit user link
+ *
+ * @since 3.5.0
+ *
+ * @param int $user_id Optional. User ID.
+ * @return string
+ */
+function get_edit_user_link( $user_id = null ) {
+	if ( ! $user_id )
+		$user_id = get_current_user_id();
+
+	if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) )
+		return;
+
+	$user = new WP_User( $user_id );
+
+	if( empty( $user ) )
+		return;
+
+	if ( get_current_user_id() == $user->ID )
+		$link = self_admin_url( 'profile.php' );
+	else
+		$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
+
+	return apply_filters( 'get_edit_user_link', $link, $user->ID );
+}
+
 // Navigation links
 
 /**
Index: wp-includes/theme-compat/comments.php
===================================================================
--- wp-includes/theme-compat/comments.php	(revision 21078)
+++ wp-includes/theme-compat/comments.php	(working copy)
@@ -69,7 +69,7 @@
 
 <?php if ( is_user_logged_in() ) : ?>
 
-<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php esc_attr_e('Log out of this account'); ?>"><?php _e('Log out &raquo;'); ?></a></p>
+<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_edit_user_link(), $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php esc_attr_e('Log out of this account'); ?>"><?php _e('Log out &raquo;'); ?></a></p>
 
 <?php else : ?>
 
Index: wp-includes/theme-compat/comments-popup.php
===================================================================
--- wp-includes/theme-compat/comments-popup.php	(revision 21078)
+++ wp-includes/theme-compat/comments-popup.php	(working copy)
@@ -68,7 +68,7 @@
 
 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
 <?php if ( $user_ID ) : ?>
-	<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out &raquo;</a>'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity, wp_logout_url(get_permalink())); ?></p>
+	<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out &raquo;</a>'), get_edit_user_link(), $user_identity, wp_logout_url(get_permalink())); ?></p>
 <?php else : ?>
 	<p>
 	  <input type="text" name="author" id="author" class="textarea" value="<?php echo esc_attr($comment_author); ?>" size="28" tabindex="1" />
Index: wp-admin/user-edit.php
===================================================================
--- wp-admin/user-edit.php	(revision 21078)
+++ wp-admin/user-edit.php	(working copy)
@@ -139,7 +139,7 @@
 }
 
 if ( !is_wp_error( $errors ) ) {
-	$redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true";
+	$redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) );
 	if ( $wp_http_referer )
 		$redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
 	wp_redirect($redirect);
