Do not get user level for empty user.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-12-26 17:45:47 +00:00
parent d781edcc70
commit 880b1b2495
1 changed files with 4 additions and 4 deletions

View File

@ -124,12 +124,12 @@ default:
}
$redirect_to = 'wp-admin/';
}
$user = get_userdatabylogin($user_login);
if ( 0 == $user->user_level )
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
if ($user_login && $user_pass) {
$user = get_userdatabylogin($user_login);
if ( 0 == $user->user_level )
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
if ( wp_login($user_login, $user_pass, $using_cookie) ) {
if (! $using_cookie) {
$user_pass = md5(md5($user_pass)); // Double hash the password in the cookie.