X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..97318cb132b41ce8416eeb8bc0bf2b82cbcc2572:/wp-login.php diff --git a/wp-login.php b/wp-login.php index ab9cff55..efd03736 100644 --- a/wp-login.php +++ b/wp-login.php @@ -42,8 +42,7 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { global $error, $is_iphone, $interim_login, $current_site; // Don't index any of these forms - add_filter( 'pre_option_blog_public', '__return_zero' ); - add_action( 'login_head', 'noindex' ); + add_action( 'login_head', 'wp_no_robots' ); if ( empty($wp_error) ) $wp_error = new WP_Error(); @@ -56,25 +55,22 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { add_action( 'login_head', 'wp_shake_js', 12 ); ?> - + > - <?php bloginfo('name'); ?> › <?php echo $title; ?> + <?php bloginfo('name'); ?> › <?php echo $title; ?> - - -

+

-

+

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'); @@ -368,7 +363,8 @@ if ( SITECOOKIEPATH != COOKIEPATH ) setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); // allow plugins to override the default actions, and to add extra actions if they want -do_action('login_form_' . $action); +do_action( 'login_init' ); +do_action( 'login_form_' . $action ); $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); switch ($action) { @@ -405,9 +401,9 @@ case 'retrievepassword' : ?> -
+

-

@@ -416,9 +412,9 @@ case 'retrievepassword' :
@@ -441,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; } @@ -452,15 +448,15 @@ case 'rp' : login_header(__('Reset Password'), '

' . __('Enter your new password below.') . '

', $errors ); ?> -
+

-

-

@@ -472,9 +468,9 @@ case 'rp' :
@@ -511,14 +507,14 @@ case 'register' : login_header(__('Registration Form'), '

' . __('Register For This Site') . '

', $errors); ?> -
+

-

- +

@@ -528,8 +524,8 @@ case 'register' :
ID) ) { $secure_cookie = true; force_ssl_admin(true); @@ -586,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'); } @@ -631,17 +627,17 @@ default: $rememberme = ! empty( $_POST['rememberme'] ); ?> -
+

-

-

-

+

@@ -657,16 +653,12 @@ default:

-
-

- -
- - - -