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!
how to disable registration ?
(9 posts) (9 voices)-
Posted 2 years ago #
-
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
Posted 2 years ago # -
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' ); ?>Posted 8 months ago # -
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.
Posted 8 months ago # -
Simon, thanks! That's perfect for me (since everyone signs up via WordPress on my sites).
Posted 8 months ago # -
Thanks Simon and to Ipstenu for posting a link to this thread from the BuddyPress forums!
Posted 7 months ago # -
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
Posted 4 months ago # -
How about just sending all request for the bbPress registration over to WordPress:
http://bbpress.org/forums/topic/wordpress-bbpress-register-plusgtgtgtgt#post-18352Posted 4 months ago # -
Thanx Simon!!!
Posted 3 months ago #
Reply
You must log in to post.