• Resolved Brian Cruikshank

    (@brianbws)


    Hello, is there a way to prevent a Facebook login button from creating new accounts and just allow login to existing ones?

    Example scenario:
    1. Disabling the “Anyone can register” checkbox in WordPress Settings so registration is disabled, but people can still login to existing accounts.

    2. Still allowing creating accounts via a secret invite to a special page (in this case, using the Invite Anyone plugin).

    Thank you for any advice and help.

    https://www.ads-software.com/plugins/wp-facebook-login/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Damian

    (@timersys)

    On the new version if you have unchecked “Anyone can register”, users won’t be able to register.

    I also added a filter fbl/registration_disabled that will let users enable registration programmatically for the plugin

    Thread Starter Brian Cruikshank

    (@brianbws)

    Thank you! #1. Disabling registration works great!

    I’m so close to getting #2. I’ve added the login button to the bp registration screen which works fine, but I’m having trouble using the filter to enabling the registration on a disabled site. Do you have any idea why this wouldn’t work?

    /* add Facebook login button to registration screen */
    function bws_render_facebook_login_on_register_form() {
      do_action('facebook_login_button');
      add_filter( 'fbl/registration_disabled', '__return_false' );
    }
    add_action( 'bp_before_account_details_fields', 'bws_render_facebook_login_on_register_form' );
    Thread Starter Brian Cruikshank

    (@brianbws)

    Still not sure why the above didn’t work, but after fiddling lots, this seemed to work. Thank you.

    /* Allow regisration through Facebook Login on invite */
    function bws_allow_registration_on_invite() {
      global $bp;
      if (  bp_is_register_page() )
        return false; // enable registration
      else
        return true; // disable registration
    }
    add_filter( 'fbl/registration_disabled', 'bws_allow_registration_on_invite' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable creation of new accounts’ is closed to new replies.