Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forwarding bbPress logins to WPMU login page.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Put this in your forum’s .htaccess for a simple way:

    Redirect 301 /forums/register.php http://yourdomain.com/wordpressmu/wp-login.php?action=register
    Redirect 301 /forums/bb-reset-password.php http://yourdomain.com/wordpressmu/wp-login.php?action=lostpassword

    I’m using it on my WP/BB and WPMU/BB/BuddyPress sites :)


    NoArtworkAvailable
    Member

    @noartworkavailable

    Thanks a lot! Talk about a quick response!

    Is there any way to have it so after login, it will direct you to the original page in which you were on? When I login, it just sends me to the main WordPress domain instead of redirecting me to the original forum page that I was on.

    Ideally this is what happens

    BB clicks Login/Register > Forward to WPMU Login/Register > Authenticated at WPMU > Redirected back to original page.

    At the same time, if someone does a login at the WMPU area, it would put them back to where they came from.

    Is this possible?

    Not if they register that way. The register link will always take them back to WPMU if you use the redirect, however if you have an inline login form (like they do on the top of this forum) then it’ll work fine.

    But yeah, registrations will kick you back to the main WPMU site, I think.

    I use this on my site to login via wpmu and get redirected to bbpress:

    add_action('bb_init', 'bp_redirect_registration');
    function bp_redirect_registration() {
    if (strpos($_SERVER['REQUEST_URI'], 'bb-login.php') !== false) {
    $ref = wp_get_referer();
    wp_redirect('http://ryuuko.cl/wp-login.php?redirect_to=' . urlencode($ref));
    }

    if (strpos($_SERVER['REQUEST_URI'], 'register.php') !== false)
    wp_redirect('http://ryuuko.cl/register');

    if (strpos($_SERVER['REQUEST_URI'], 'profile.php') !== false) {
    if (bb_is_user_logged_in() && isset($_GET['id']) && isset($_GET['tab'])) {
    $user = bb_get_current_user();
    if ($_GET['tab'] == 'edit' && $_GET['id'] == $user->ID)
    wp_redirect('http://ryuuko.cl/members/' . $user->user_login . '/profile/edit');
    //TODO: see how to handle moderators editing user profiles

    }

    }
    }

    of course, it’s not complete yet (check out the TODO). But it works OK.

    @Ipstenu

    I’m trying to have a central signon at my site, where users must sign onto WP first and access bbPress via a page link. The logic you’ve provided looks like it can be incorporated to include the bbPress login page, is this correct?

    Also, I’m waiting for the revised Admin SSL plugin to be published for WP. This should allow be to secure the WP site and hopefully the bbPress. Are there any other backdoors or pages users can directly access from the outside that may need redirection?

    I’m trying to have a central signon at my site, where users must sign onto WP first and access bbPress via a page link. The logic you’ve provided looks like it can be incorporated to include the bbPress login page, is this correct?

    I think kind of — I’m not 100% sure what you’re describing so let me try a different way.

    If you force all registration to go through WPMU, then you can use the in-line login form, native to bbPress, to permit users to log in via bbPress, and they will still be logged in on WPMU. That’s the basic plus of integration :) Login on WPMU, you’re in on bbPress, and vice versa.

    In my template, make my login-form.php file look like this:

    <form class="login" method="post" action="<?php bb_uri('bb-login.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_USER_FORMS); ?>">
    <p>
    <label><input name="user_login" type="text" id="quick_user_login" size="20" maxlength="40" value="<?php if (!is_bool($user_login)) echo $user_login; ?>" tabindex="1" /> <?php _e('User Name'); ?></label>
    <br /><label><input name="password" type="password" id="quick_password" size="20" maxlength="40" tabindex="2" /> <?php _e('Password'); ?></label>
    <br /><input name="re" type="hidden" value="<?php echo $re; ?>" /> <?php wp_referer_field(); ?> <input type="submit" name="Submit" class="submit" value="<?php echo attribute_escape( __('Log In') ); ?>" tabindex="4" /> <label><input name="remember" type="checkbox" id="quick_remember" value="1" tabindex="3"<?php echo $remember_checked; ?> /><?php _e('Remember me'); ?></label>
    <br /><a href="http://yourdomain.com/wordpressmu/wp-register.php">Register</a> | <a href="http://yourdomain.com/wordpressmu/wp-login.php?action=lostpassword">Forgot password?</a><br />
    </p>
    </form>

    What this does is, if someone clicks on the registration or forgot password links, is take them right to the WP side. Now from there, it’ll log them back in to the WP main page, IIRC, but the login form itself, being inline, will keep the user on the same page as they logged in from, so they don’t appear to go anywhere.

    Does that make sense?

    Are there any other backdoors or pages users can directly access from the outside that may need redirection?

    Since the bbAdmin pages are locked to admins, I don’t think you need to worry about that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar