This topic has 5 replies, 2 voices, and was last updated 9 years by Adam.

  • Author
  • #19230
     Adam
    Participant

    We use Limit Login Attempts as a security measure and I’m wondering if anyone has modified the bad-password handling to notify users that their hammering on the ajax modal login has locked them out?

    We basically just want the same error message that appears on the /wp-login.php page after too many failed tries. Because we’re only using the AJAX login modal.

    I assume I’ll have to try and make this happen myself since it’s a 3rd-party plugin I’m asking about integrating with. But since it’s a fairly popular plugin I thought perhaps someone may have already done this.

    Attachments:
    You must be logged in to view attached files.
    #19447
     Abe
    Keymaster

    Hi, You should take a look at kleo_ajax_login function in functions.php and instead of the normal message, try echoing $user_signon variable

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21582
     Adam
    Participant

    Thanks @abe,

    I’ll post my modification in my own functions.php when I get it working

    #42165
     Adam
    Participant

    Hi Abe,

    The user_signon doesn’t ever contain information about being locked out. It’s always just a message about bad credentials, e.g.

    COPY CODE
    WP_Error Object
    (
        [errors:WP_Error:private] => Array
            (
                [incorrect_password] => Array
                    (
                        [0] => <strong>ERROR</strong>: The password you entered for the username <strong>ataylor</strong> is incorrect. <a href="http://local.meetmindful.com/wp-login.php?action=lostpassword">Lost your password</a>?
                    )
    
            )
    
        [error_data:WP_Error:private] => Array
            (
            )
    
    )
    
    #42166
     Adam
    Participant

    ugh, disregard that.

    Apparently Limit Login Attempts isn’t installed on my local install.. stand by!

    ps. your forum needs post-EDITING 😉

    #42167
     Adam
    Participant

    This works well enough, since I only want to display the first error message in the case of errors

    COPY CODE
        echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i>' . $user_signon->get_error_message() . '</span>' ));
    
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?