Index: wp-login.php
===================================================================
--- wp-login.php	(revision 15565)
+++ wp-login.php	(working copy)
@@ -547,7 +547,7 @@
 		}
 		// If the user can't edit posts, send them to their profile.
 		if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) )
-			$redirect_to = admin_url('profile.php');
+			$redirect_to = get_user_edit_link();
 		wp_safe_redirect($redirect_to);
 		exit();
 	}
Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 15565)
+++ wp-includes/comment-template.php	(working copy)
@@ -1531,7 +1531,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_user_edit_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 15565)
+++ wp-includes/link-template.php	(working copy)
@@ -958,6 +958,23 @@
 	echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
 }
 
+/**
+ * Retrieve edit user link
+ *
+ * @since 3.1.0
+ *
+ * @param int $user_id Optional. User ID.
+ * @return string
+ */
+function get_edit_user_link( $user_id = 0 ) {
+	if ( !$user_id || get_current_user_id() == $user_id )
+		$link = 'profile.php';
+	else
+		$link = 'user-edit.php?user_id=' . $user_id;
+
+	return apply_filters( 'get_edit_user_link', self_admin_url( $link ), $user_id );
+}
+
 // Navigation links
 
 /**
Index: wp-includes/theme-compat/comments.php
===================================================================
--- wp-includes/theme-compat/comments.php	(revision 15565)
+++ wp-includes/theme-compat/comments.php	(working copy)
@@ -70,7 +70,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 _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_user_edit_link(), $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _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 15565)
+++ 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_user_edit_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 15565)
+++ wp-admin/user-edit.php	(working copy)
@@ -143,7 +143,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) );
 	$redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
 	wp_redirect($redirect);
 	exit;
