diff --git src/wp-login.php src/wp-login.php
index a14c2dd..a092b3e 100644
|
|
|
|
| 11 | 11 | /** Make sure that the WordPress bootstrap has run before continuing. */ |
| 12 | 12 | require( dirname( __FILE__ ) . '/wp-load.php' ); |
| 13 | 13 | |
| 14 | | // Redirect to https login if forced to use SSL |
| | 14 | // Redirect to HTTPS login if forced to use SSL. |
| 15 | 15 | if ( force_ssl_admin() && ! is_ssl() ) { |
| 16 | 16 | if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { |
| 17 | 17 | wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); |
| … |
… |
if ( force_ssl_admin() && ! is_ssl() ) {
|
| 25 | 25 | /** |
| 26 | 26 | * Output the login page header. |
| 27 | 27 | * |
| | 28 | * @since 2.1.0 |
| | 29 | * |
| 28 | 30 | * @param string $title Optional. WordPress login Page title to display in the `<title>` element. |
| 29 | 31 | * Default 'Log In'. |
| 30 | 32 | * @param string $message Optional. Message to display in header. Default empty. |
| … |
… |
function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
|
| 89 | 91 | /* |
| 90 | 92 | * Remove all stored post data on logging out. |
| 91 | 93 | * This could be added by add_action('login_head'...) like wp_shake_js(), |
| 92 | | * but maybe better if it's not removable by plugins |
| | 94 | * but maybe better if it's not removable by plugins. |
| 93 | 95 | */ |
| 94 | 96 | if ( 'loggedout' == $wp_error->get_error_code() ) { |
| 95 | 97 | ?> |
| … |
… |
function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
|
| 202 | 204 | echo $message . "\n"; |
| 203 | 205 | } |
| 204 | 206 | |
| 205 | | // In case a plugin uses $error rather than the $wp_errors object |
| | 207 | // In case a plugin uses $error rather than the $wp_errors object. |
| 206 | 208 | if ( ! empty( $error ) ) { |
| 207 | 209 | $wp_error->add( 'error', $error ); |
| 208 | 210 | unset( $error ); |
| … |
… |
function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
|
| 247 | 249 | /** |
| 248 | 250 | * Outputs the footer for the login page. |
| 249 | 251 | * |
| 250 | | * @param string $input_id Which input to auto-focus |
| | 252 | * @since 3.1.0 |
| | 253 | * |
| | 254 | * @param string $input_id Which input to auto-focus. |
| 251 | 255 | */ |
| 252 | 256 | function login_footer( $input_id = '' ) { |
| 253 | 257 | global $interim_login; |
| … |
… |
function login_footer( $input_id = '' ) {
|
| 288 | 292 | } |
| 289 | 293 | |
| 290 | 294 | /** |
| | 295 | * Outputs the Javascript to handle the form shaking. |
| | 296 | * |
| 291 | 297 | * @since 3.0.0 |
| 292 | 298 | */ |
| 293 | 299 | function wp_shake_js() { |
| … |
… |
addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.
|
| 303 | 309 | } |
| 304 | 310 | |
| 305 | 311 | /** |
| | 312 | * Outputs the viewport meta tag. |
| | 313 | * |
| 306 | 314 | * @since 3.7.0 |
| 307 | 315 | */ |
| 308 | 316 | function wp_login_viewport_meta() { |
| … |
… |
function wp_login_viewport_meta() {
|
| 314 | 322 | /** |
| 315 | 323 | * Handles sending password retrieval email to user. |
| 316 | 324 | * |
| | 325 | * @since 2.5.0 |
| | 326 | * |
| 317 | 327 | * @return bool|WP_Error True: when finish. WP_Error on error |
| 318 | 328 | */ |
| 319 | 329 | function retrieve_password() { |
| … |
… |
function retrieve_password() {
|
| 417 | 427 | } |
| 418 | 428 | |
| 419 | 429 | // |
| 420 | | // Main |
| | 430 | // Main. |
| 421 | 431 | // |
| 422 | 432 | |
| 423 | 433 | $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login'; |
| … |
… |
if ( isset( $_GET['key'] ) ) {
|
| 427 | 437 | $action = 'resetpass'; |
| 428 | 438 | } |
| 429 | 439 | |
| 430 | | // validate action so as to default to the login screen |
| | 440 | // Validate action so as to default to the login screen. |
| 431 | 441 | if ( ! in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login', 'confirmaction' ), true ) && false === has_filter( 'login_form_' . $action ) ) { |
| 432 | 442 | $action = 'login'; |
| 433 | 443 | } |
| … |
… |
switch ( $action ) {
|
| 890 | 900 | * After firing this action hook the page will redirect to wp-login a callback |
| 891 | 901 | * redirects or exits first. |
| 892 | 902 | * |
| | 903 | * @since 4.9.6 |
| | 904 | * |
| 893 | 905 | * @param int $request_id Request ID. |
| 894 | 906 | */ |
| 895 | 907 | do_action( 'user_request_action_confirmed', $request_id ); |
| … |
… |
switch ( $action ) {
|
| 908 | 920 | wp_enqueue_script( 'customize-base' ); |
| 909 | 921 | } |
| 910 | 922 | |
| 911 | | // If the user wants ssl but the session is not ssl, force a secure cookie. |
| | 923 | // If the user wants SSL but the session is not SSL, force a secure cookie. |
| 912 | 924 | if ( ! empty( $_POST['log'] ) && ! force_ssl_admin() ) { |
| 913 | 925 | $user_name = sanitize_user( $_POST['log'] ); |
| 914 | 926 | $user = get_user_by( 'login', $user_name ); |
| … |
… |
switch ( $action ) {
|
| 927 | 939 | |
| 928 | 940 | if ( isset( $_REQUEST['redirect_to'] ) ) { |
| 929 | 941 | $redirect_to = $_REQUEST['redirect_to']; |
| 930 | | // Redirect to https if user wants ssl |
| | 942 | // Redirect to HTTPS if user wants SSL. |
| 931 | 943 | if ( $secure_cookie && false !== strpos( $redirect_to, 'wp-admin' ) ) { |
| 932 | 944 | $redirect_to = preg_replace( '|^http://|', 'https://', $redirect_to ); |
| 933 | 945 | } |
| … |
… |
switch ( $action ) {
|
| 1022 | 1034 | $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' ); |
| 1023 | 1035 | } |
| 1024 | 1036 | } else { |
| 1025 | | // Some parts of this script use the main login form to display a message |
| | 1037 | // Some parts of this script use the main login form to display a message. |
| 1026 | 1038 | if ( isset( $_GET['loggedout'] ) && true == $_GET['loggedout'] ) { |
| 1027 | 1039 | $errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' ); |
| 1028 | 1040 | } elseif ( isset( $_GET['registration'] ) && 'disabled' == $_GET['registration'] ) { |
| … |
… |
switch ( $action ) {
|
| 1172 | 1184 | } |
| 1173 | 1185 | |
| 1174 | 1186 | break; |
| 1175 | | } // end action switch |
| | 1187 | } // End action switch. |