Forums

Join
bbPress Support ForumsInstallationForwarding bbPress logins to WPMU login page.

Info

Forwarding bbPress logins to WPMU login page.

  1. Hi there,

    Its amazing how much these forums have helped through reading about other people's problems and solutions. I was able to get everything with integration working perfectly (albeit several installs later), but there has been one problem that I haven't been able to find a direct answer for (maybe I am just using the wrong keywords to search).

    What I am trying to do is have all the bbPress login/registration get directed to the WordPress (WPMU) login/registration pages. I am running RPX for login/registration at the WPMU page, and it has worked flawlessly for OpenID integration, but I can't find a way to make all the bbPress goodness get directed to WPMU and then back to my forums.

    Thanks ahead of time!

  2. 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 :)

  3. 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?

  4. 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.

  5. 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.

  6. @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?

  7. 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.

  8. You must log in to post.