Forums

Join
bbPress Support ForumsTroubleshootinghow to disable registration ?

Info

how to disable registration ?

  1. hello there!
    I was wondering, how can you disable registration in bbpress; I have added the Admin add user plug-in. and want to restrict registration so it is done manually. I already checked http://bbpress.org/forums/topic/is-there-an-approve-registration-plugin?replies=14 (Trent's reply on shutting it off) BUT would removing register.php file disallow me (as admin) registering users?
    thanks!

  2. I don't think so as the plugin adds them direct to the database (you can quickly test that). Without register.php there are no registrations going to happen for sure!

    Trent

  3. Rather than editing or removing core files, I wrote this simple plugin:

    <?php
    /*
    Plugin Name: Disable Registrations
    Description: This plugin disables access to registration.php and blocks any registrations.
    Plugin URI:  http://simonwheatley.co.uk/bbpress/disable-registrations
    Author: Simon Wheatley
    Author URI: http://simonwheatley.co.uk/
    Version: 0.1
    */
    
    // Fires every time bbPress inits, a bit ick but it's super quick string ops
    // (which is what PHP is good at).
    function da_disable_registrations()
    {
    	// Shame there isn't a hook to grab before the new user is registered on register.php
    	// In the absence of that, we will check whether we're on register.php
    	if ( ! da_str_ends_with( strtolower( $_SERVER[ 'PHP_SELF' ] ), 'register.php' ) ) return;
    	// We are on register.php? Stop executing (with a message).
    	bb_die( "Registration is not allowed on this website. Please contact the site administrators." );
    	exit; // Never reached, unless bb_die fails for some freaky reason
    }
    
    // Checks whether string a ends with string b
    function da_str_ends_with(& $str, $end)
    {
    	return ( substr( $str, - strlen( $end ), strlen( $end ) ) == $end );
    }
    
    add_action( 'bb_init', 'da_disable_registrations' );
    
    ?>
  4. i've modified the file register.php in the root, changing the last line with this bb_load_template( '404.php', $_globals ); , now all the request to this page return a 404 error.

  5. Simon, thanks! That's perfect for me (since everyone signs up via WordPress on my sites).

  6. Thanks Simon and to Ipstenu for posting a link to this thread from the BuddyPress forums!

  7. What mods to this would you need to do, to instead of killing registration, diverting the registration to your integrated wordpress registration, I'm using bbp 1.0.2 and wp 2.8.5

  8. How about just sending all request for the bbPress registration over to WordPress:
    http://bbpress.org/forums/topic/wordpress-bbpress-register-plusgtgtgtgt#post-18352

  9. Thanx Simon!!!

  10. Thanks Simon! You made my day.

  11. You must log in to post.