intersynergy-login-plugin.php
/**
     * Resets the user's password if the password reset form was submitted.
     */
Resets the user's password if the password reset form was submitted.
Resets the user ' s password if the password reset form was submitted .
public function do_password_reset()
    {
        if ('POST' == $_SERVER['REQUEST_METHOD']) {
            $rp_key = $_REQUEST['rp_key'];
            $rp_login = $_REQUEST['rp_login'];
            $user = check_password_reset_key($rp_key, $rp_login);
            if (! $user || is_wp_error($user)) {
                if ($user && $user->get_error_code() === 'expired_key') {
                    wp_redirect(home_url($this->pageSlug['member-login'].'?login=expiredkey'));
                } else {
                    wp_redirect(home_url($this->pageSlug['member-login'].'?login=invalidkey'));
                }
                exit;
            }
            if (isset($_POST['pass1'])) {
                if ($_POST['pass1'] != $_POST['pass2']) {
                    $redirect_url = home_url($this->pageSlug['member-password-reset']);
                    $redirect_url = add_query_arg('key', $rp_key, $redirect_url);
                    $redirect_url = add_query_arg('login', $rp_login, $redirect_url);
                    $redirect_url = add_query_arg('error', 'password_reset_mismatch', $redirect_url);
                    wp_redirect($redirect_url);
                    exit;
                }
                if (empty($_POST['pass1'])) {
                    $redirect_url = home_url($this->pageSlug['member-password-reset']);
                    $redirect_url = add_query_arg('key', $rp_key, $redirect_url);
                    $redirect_url = add_query_arg('login', $rp_login, $redirect_url);
                    $redirect_url = add_query_arg('error', 'password_reset_empty', $redirect_url);
                    wp_redirect($redirect_url);
                    exit;
                }
                reset_password($user, $_POST['pass1']);
                wp_redirect(home_url('member-login?password=changed'));
            } else {
                echo 'Invalid request.';
            }
            exit;
        }
    }
public function do_password_reset ( ) { if ( 'POST' == $ _SERVER [ 'REQUEST_METHOD' ] ) { $ rp_key = $ _REQUEST [ 'rp_key' ] ; $ rp_login = $ _REQUEST [ 'rp_login' ] ; $ user = check_password_reset_key ( $ rp_key , $ rp_login ) ; if ( ! $ user || is_wp_error ( $ user ) ) { if ( $ user && $ user -> get_error_code ( ) === 'expired_key' ) { wp_redirect ( home_url ( $ this -> pageSlug [ 'member-login' ] . '?login=expiredkey' ) ) ; } else { wp_redirect ( home_url ( $ this -> pageSlug [ 'member-login' ] . '?login=invalidkey' ) ) ; } exit ; } if ( isset ( $ _POST [ 'pass1' ] ) ) { if ( $ _POST [ 'pass1' ] != $ _POST [ 'pass2' ] ) { $ redirect_url = home_url ( $ this -> pageSlug [ 'member-password-reset' ] ) ; $ redirect_url = add_query_arg ( 'key' , $ rp_key , $ redirect_url ) ; $ redirect_url = add_query_arg ( 'login' , $ rp_login , $ redirect_url ) ; $ redirect_url = add_query_arg ( 'error' , 'password_reset_mismatch' , $ redirect_url ) ; wp_redirect ( $ redirect_url ) ; exit ; } if ( empty ( $ _POST [ 'pass1' ] ) ) { $ redirect_url = home_url ( $ this -> pageSlug [ 'member-password-reset' ] ) ; $ redirect_url = add_query_arg ( 'key' , $ rp_key , $ redirect_url ) ; $ redirect_url = add_query_arg ( 'login' , $ rp_login , $ redirect_url ) ; $ redirect_url = add_query_arg ( 'error' , 'password_reset_empty' , $ redirect_url ) ; wp_redirect ( $ redirect_url ) ; exit ; } reset_password ( $ user , $ _POST [ 'pass1' ] ) ; wp_redirect ( home_url ( 'member-login?password=changed' ) ) ; } else { echo 'Invalid request.' ; } exit ; } }
Resets the user's password if the password reset form was submitted.
Resets the user ' s password if the password reset form was submitted .
// Passwords don't match // Password is empty // Parameter checks OK, reset password