Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to disable registration ?

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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


    Simon Wheatley
    Member

    @simonwheatley

    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' );

    ?>


    Marcomail
    Member

    @marcomail

    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.

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


    r-a-y
    Participant

    @r-a-y

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

    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


    chrishajer
    Participant

    @chrishajer

    How about just sending all request for the bbPress registration over to WordPress:

    http://bbpress.org/forums/topic/wordpress-bbpress-register-plusgtgtgtgt#post-18352


    muriaticum
    Member

    @muriaticum

    Thanx Simon!!!

    Thanks Simon! You made my day.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.