• Resolved addict2design

    (@luigi26)


    Hi Pär I hope you well. In my site I’m having troubles with force brute attack, last time someone used a known username but Simple History didn’t record the password. I found this snipet in your site to record passwords. But it doesn’t work with 2.33.2 plugin versión and WP 5.3.2.

    add_action( ‘login_form_postpass’, function() {
    $postPass = isset($_POST[‘post_password’]) ? $_POST[‘post_password’] : null;

    if (!$postPass) {
    return;
    }

    $urlPath = parse_url(wp_get_referer(), PHP_URL_PATH);
    $pageByPath = get_page_by_path($urlPath);

    if (!$pageByPath) {
    return;
    }

    $correctPasswordEntered = ($pageByPath->post_password === $postPass);

    if ($correctPasswordEntered) {
    apply_filters(
    ‘simple_history_log’,
    ‘A user correctly entered the password for page “{page_name}”‘,
    array(‘page_name’ => $pageByPath->post_title)
    );
    } else {
    apply_filters(
    ‘simple_history_log’,
    ‘A user entered the wrong password for page “{page_name}”‘,
    array(‘page_name’ => $pageByPath->post_title)
    );
    }
    });

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Pär Thernström

    (@eskapism)

    There is a filter that you can use to store the password a user enters when they try to login. Add this to your functions.php-file:

    
    add_filter('simple_history/comments_logger/log_failed_password', '__return_true');
    
Viewing 1 replies (of 1 total)

The topic ‘Record Password from Login’ is closed to new replies.