Index: wp-login.php
===================================================================
--- wp-login.php	(revision 2983)
+++ wp-login.php	(working copy)
@@ -182,7 +182,7 @@
 	if ($user_login && $user_pass) {
 		$user = new WP_User($user_login);
 		// If the user can't edit posts, send them to their profile.
-		if ( ! $user->has_cap('edit_posts') )
+		if (!$user->has_cap('edit_posts') && (empty($_REQUEST['redirect_to']) || $_REQUEST['redirect_to'] == 'wp-admin/'))
 			$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
 
 		if ( wp_login($user_login, $user_pass, $using_cookie) ) {

