Changeset 2985
- Timestamp:
- 11/05/2005 10:17:34 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-login.php
r2876 r2985 170 170 $rememberme = $_POST['rememberme']; 171 171 } elseif ( !empty($_COOKIE) ) { 172 if ( !empty($_COOKIE[USER_COOKIE]) )172 if ( !empty($_COOKIE[USER_COOKIE]) ) 173 173 $user_login = $_COOKIE[USER_COOKIE]; 174 if ( !empty($_COOKIE[PASS_COOKIE]) ) {174 if ( !empty($_COOKIE[PASS_COOKIE]) ) { 175 175 $user_pass = $_COOKIE[PASS_COOKIE]; 176 176 $using_cookie = true; … … 182 182 if ($user_login && $user_pass) { 183 183 $user = new WP_User($user_login); 184 184 185 // If the user can't edit posts, send them to their profile. 185 if ( ! $user->has_cap('edit_posts') )186 $redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';186 if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) ) 187 $redirect_to = get_settings('siteurl') . '/wp-admin/profile.php'; 187 188 188 189 if ( wp_login($user_login, $user_pass, $using_cookie) ) { 189 if ( !$using_cookie ) {190 if ( !$using_cookie ) 190 191 wp_setcookie($user_login, $user_pass, false, '', '', $rememberme); 191 }192 192 do_action('wp_login', $user_login); 193 193 wp_redirect($redirect_to); 194 exit ();194 exit; 195 195 } else { 196 if ( $using_cookie)196 if ( $using_cookie ) 197 197 $error = __('Your session has expired.'); 198 198 }
Note: See TracChangeset
for help on using the changeset viewer.