-
+
add('error', $error);
unset($error);
@@ -123,19 +119,19 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
* @param string $input_id Which input to auto-focus
*/
function login_footer($input_id = '') {
- echo "
\n";
+ ?>
+
+
- if ( !empty($input_id) ) {
-?>
+
-
-
+
+
+
add('empty_username', __('
ERROR: Enter a username or e-mail address.'));
-
- if ( strpos($_POST['user_login'], '@') ) {
- $user_data = get_user_by_email(trim($_POST['user_login']));
- if ( empty($user_data) )
+ } else if ( strpos( $_POST['user_login'], '@' ) ) {
+ $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
+ if ( empty( $user_data ) )
$errors->add('invalid_email', __('
ERROR: There is no user registered with that email address.'));
} else {
$login = trim($_POST['user_login']);
- $user_data = get_userdatabylogin($login);
+ $user_data = get_user_by('login', $login);
}
do_action('lostpassword_post');
@@ -406,9 +401,9 @@ case 'retrievepassword' :
?>
-
-
-
- |
+
+
+ |
@@ -442,7 +437,7 @@ case 'rp' :
$errors = new WP_Error('password_reset_mismatch', __('The passwords do not match.'));
} elseif ( isset($_POST['pass1']) && !empty($_POST['pass1']) ) {
reset_password($user, $_POST['pass1']);
- login_header(__('Password Reset'), '
' . __('Your password has been reset.') . ' ' . __('Log in') . '
');
+ login_header( __( 'Password Reset' ), '
' . __( 'Your password has been reset.' ) . ' ' . __( 'Log in' ) . '
' );
login_footer();
exit;
}
@@ -453,15 +448,15 @@ case 'rp' :
login_header(__('Reset Password'), '
' . __('Enter your new password below.') . '
', $errors );
?>
-
-
-
- |
+
+
+ |
@@ -512,14 +507,14 @@ case 'register' :
login_header(__('Registration Form'), '
' . __('Register For This Site') . '
', $errors);
?>
-
- |
-
+ |
+
ID) ) {
$secure_cookie = true;
force_ssl_admin(true);
@@ -587,10 +582,10 @@ default:
if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
- if ( is_multisite() && !get_active_blog_for_user($user->id) )
+ if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) )
$redirect_to = user_admin_url();
elseif ( is_multisite() && !$user->has_cap('read') )
- $redirect_to = get_dashboard_url( $user->id );
+ $redirect_to = get_dashboard_url( $user->ID );
elseif ( !$user->has_cap('edit_posts') )
$redirect_to = admin_url('profile.php');
}
@@ -632,17 +627,17 @@ default:
$rememberme = ! empty( $_POST['rememberme'] );
?>
-