Support » Plugin: New User Approve » Users gain access immediately after registration

  • Thank you for creating this plugin.

    I have Woocommerce installed on my site, so when the user registers from the Woocommerce registration form it immediately allows them access to the website.

    I still get user approvals and the users are held in the approve / deny queue, but on the front end they have access from the moment of registration.

Viewing 4 replies - 1 through 4 (of 4 total)
  • fix for this:

    l.63: Change
    add_filter( ‘registration_errors’, array( $this, ‘show_user_pending_message’ ) );
    To:
    add_filter( ‘woocommerce_registration_errors’, array( $this, ‘show_user_pending_message’ ) );

    HTH

    • This reply was modified 1 year, 6 months ago by  alian666.

    Ok it doesn’t help so much if don’t use login theme, the function is now called, but you’re still logged.
    So you can comment last filter (or don’t do the update I describe in my last post) and add this:

    add_action(‘woocommerce_created_customer’, ‘logout_if_not_approved’,10,1);
    function logout_if_not_approved($user_id) {
    $user_status = get_user_meta( $user_id, ‘pw_user_status’ );
    if ($user_status[0] == ‘pending’) {
    wp_logout();
    wp_redirect(get_permalink( get_option(‘woocommerce_myaccount_page_id’)) . ‘?msg=’. urlencode(“Account need validation”),302);
    exit(0);
    }
    }

    You must then catch $_GET[‘msg’] to display it after the redirect.

    Hi there,

    I have purchased your plugin.

    It appears as though I am having the same problem as Darryl.

    Can you please say which file the above code is supposed to go in? Can you please provide the file path?

    Many thanks,
    Eric

    Hi there,

    I have purchased your plugin.

    It appears as though I am having the same problem as Darryl.

    Can you please say which file the above code is supposed to go in? Can you please provide the file path?

    Many thanks,
    Eric

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Users gain access immediately after registration’ is closed to new replies.