Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress Integration plugin for WPMU

Viewing 16 replies - 26 through 41 (of 41 total)

  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    Tis true. I usually purge the bb_capabilities and apply the role map once everything is lined up, even though it’s like rinsing the dishes and then washing them in the machine.

    ITguy, couple of things to check RE-buddypress. XML-RPC is turned on in both WP and BBP? Also, don’t forget to put

    $bb->bb_xmlrpc_allow_user_switching = true; somewhere near the end of your bb-config.php file. That will make sure that xmlrpc can switch to your keymaster user to communicate back and forth between the two installs.


    chrishajer
    Participant

    @chrishajer

    @johnjamesjacoby – where does this bit of info come from:

    $bb->bb_xmlrpc_allow_user_switching = true;

    I’ve never installed WMPU or BuddyPress, so maybe it’s in the instructions or a config file already, but I’ve seen it referred to here a couple times and wonder where it comes from. Thanks.

    John, XML-RPC is (was) turned on in both WPMU/BP and bbP. Also ‘$bb->bb_xmlrpc_allow_user_switching = true;’ is (and always was) at the end of the bb-config file just before the closing PHP statement. I even check again that XML-RPC was working properly via Burt’s XML-RPC-sayhello plugin.

    Sam, taking your note ‘about re-applying the role map does not change the roles users already have’, I applied John’s suggestion to ‘purge the bb_capabilities and apply the role map once everything is lined up’.

    The end result is the same, user switching works, admin has the correct bb_capabilities in the wp_usermeta table (no need this time for manual correction), and all users can create new groups with forums, add topics and relies to all discussions. The ONLY thing still not working is the recreation (activation) of old exiting groups with forums that exited before upgrading from BP 1.0 to 1,0,1 and bbP 1.0-Alpha-6 to 1.0-RC2.

    I guess I have to delete them and create them as new groups. I should be able to export the topics and replies first and import them after the creation, unless one of you has another suggestion. Regardless, thanks to both of you for all the help so far.

    @chrishajer, not sure where the original instruction about the need for ‘$bb->bb_xmlrpc_allow_user_switching = true; ‘ came from, besides seeing it referenced in all BB and ppB integration instructions, I came across it first on the BuddyPress.org site’s ‘Installing and setting up bp-forums’ article (step 11). The URL is <https://trac.buddypress.org/browser/trunk/bp-forums/installation-readme.txt&gt;.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    ITguy, are you using deep integration? If so, I think there’s something else that needs to be done before the group forum creation will work.

    I ran into the same issue as you a few months back. Burt’s XMLRPC check would work, but forums wouldn’t get made. If memory serves me right, the XMLRPC was reincluding something that was mucking up the forum creation, but I don’t recall exactly what that is at the moment, but I banged my head against it for a week, and there’s a topic somewhere in the BuddyPress forums to prove it. :)

    I’m packing for a week long vacation tonight, and am flying all day tomorrow. I’ll have my laptop and access to all my code by Wednesday night, and will be back to help support this again. In the meantime I invite you to scour buddypress.org/forums and see if you can find any of my past replies or recent topics. Check from about April or so. Getting this figured out is important to me too, as I’ve got a series of Integration screen casts I’m going to put together and give to the *Press sites to help answer all of the questions everyone has about integration, since it is a very popular topic and many of us spend many hours developing and supporting it.

    Talk soon, and good luck until then.

    John, first please enjoy your vacation. As to your question, yes I do use ‘deep integration’. I have deleted the 3 groups I had that would not allow the recreation of the forums via the toggling of the ‘Enable discussion forum’ option. That was my only remaining problem. I was able to recreate the groups from scratch and transferred the topics and posting db entries from my backup. Everything is now working :-)

    I did a quick search through the BuddyPress forums about the issue you mention but have not found it. I will do it again over the weekend. Should I find it I will try any suggested fix by setting up another copy my setup (code and database) saved this morning before I deleted the problem group forums. I have a spare domain I can use just for that purpose. Should you find it please feel free to post the URL here.

    Thanks again for all your help, hopefully I can help you with identifying the issue you referring to for your screen casts.

    Wow, this is a bit of a headache.

    I’m busy trying to get the integration sorted out and got along quite well (WPMU, BBPress, BuddyPress combo), although I still needed to log in twice, when my luck ran out and now I can’t seem to log into bbpress. Bit annoying. I’ve reinstalled the whole thing, but still no luck. Trying to debug it at the moment, but it’s tough going.

    I did come across something that needed fixing though; I’m not sure where to submit this fix, so I’m posting it here for now.

    The bug was this; the latest release candidate never displayed the dropdown from which one selects the keymaster during installation due to a mistake in line 2569 of bb-admin/includes/class.bb-install.php.

    Previously the line was;

    $wp_administrator_meta_key .= $this->data[2] . ‘_’;

    which meant the meta_key it tried to query the db on looked something like this; ‘wp_capabilities1_’.

    I changed it to:

    $wp_administrator_meta_key = $bbdb->escape( $bb->wp_table_prefix . $this->data[2] . ‘_capabilities’ );

    so now the key will be ‘wp_1_capabilities’.

    This is obviously (when you look at the code) only relevant when setting the default blog id.

    Hope it helps someone!

    Now I get an odd behavior:

    – if the user logs in inside WP, he appears logged in in both WP and BB, but he can’t post in BB. If he has admin rights, he can’t see bb-admin.

    – if the user logs in inside BB, everything works ok in both WP and BB.

    So I redirected all logins to BB.

    In mu-plugins I added the following:

    function rk_login_redirect() {
    if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false && $_GET['action'] != 'logout' ) {
    $url = 'http://foros.ryuuko.cl/bb-login.php';
    $redirect = urlencode(wp_get_referer());
    $url = add_query_arg('redirect_to', $redirect, $url);
    wp_redirect($url);
    }
    }
    add_action('init', 'rk_login_redirect');

    In a plugin in my-plugins I added:

    add_filter('wp_redirect', 'rk_redirect_location');
    function rk_redirect_location($location, $status = 302) {
    $arr = array();
    $ref = wp_get_referer();
    $url_array = parse_url($ref);
    parse_str($url_array['query'], $arr);

    if (isset($arr['redirect_to']) && !empty($arr['redirect_to'])) {
    $url = urldecode($arr['redirect_to']);
    $url_array = parse_url($url);
    if (strpos($url_array['host'], 'ryuuko.cl') !== false)
    $location = $url;
    }
    return $location;
    }

    version 1.0 has been released several minutes ago!

    WPMU Trunk + bbPress Latest RC + Integration Plugin with:

    define(‘FORCE_SSL_LOGIN’, true);

    define(‘FORCE_SSL_ADMIN’, true);

    Does not work. Setting the values to false (disabling SSL/HTTPS), integration works great. However when it comes to SSL, forget it. I’m going to say it’s impossible. :-)

    We need SSL to work across software packages, security is paramount.

    Any help from anyone or the devs, let me know.

    Again, this is a SSL WPMU install.


    Sam Bauers
    Participant

    @sambauers

    In bbPress to use SSL you need these in your bb-config.php:

    define('BB_FORCE_SSL_USER_FORMS', true);
    define('BB_FORCE_SSL_ADMIN', true);


    Sam Bauers
    Participant

    @sambauers

    To be honest though, I’ve never tried integration across SSL sites, it may not be possible with currently existing tools.

    Setting bbPress to also force SSL might do it, but I can’t do any testing right now.

    the defines worked. However logging out does not clear nor log me out of bbpress when I’ve logged on via wpmu. I’ll xdebug tonight, any pointers or things I should check? I have 7 cookie keys/salts define in both configs and all are identical. No go. Thanks guys, -J

    Just started debugging but looks like the plugin reads the scheme from the URL stored option of the integration plugin. If your using secure it will never flag secure if using force ssl.

    Here is the latest integration rundown. I first lay out some helpful hints to those out there looking for them, and toward the bottom I point out something which the integration plug-in does not properly handle. That is the HTTPS secure cookie upon logging out. Depending on your setup this may cause issues. Most of the time you’ll be ok. If your like us and have added a proprietary layer of security for internal use only, you like to make sure when your secure cookies expire they expire asap and are completely gone.

    I recommend maybe, just a suggestion as I’m not privy to the dev’s stream of intentions to query if ‘BB_FORCE_SSL_xxx…’ is set. This is probably a much better indication of scheme than relying on the database option only. I know your busy Sam and that wpmu integration is like the last thing on your list. However, some of the code base is already merging.

    Noteables: Step #6, Step #7

    But before you continue:

    1.) Disable Your Cache Server (Varnish/Squid). Go straight to your webserver (Eliminate other causes.)

    2.) Get Integration working on plain http first. DO NOT define any force SSL/Admin anywhere on either wpmu/wp/bbpress.

    3.) Go back and integrate if you can’t get #2 done. Some helpful hints that work:

    3a.) Install wp/wpmu

    3b.) Install bbpress

    3c.) Install integration plugin for wp. In the option where it says complete URL, that means “http://mysite.com&#8221; and not “mysite.com”. If your _only_ (meaning 100% of the time) ever going to use HTTPS then go ahead and define HTTPS.

    3d.) I made sure all key/salts were setup in wp first, and then mirrored them into bb-config prepending BB_ in front of each Define. I defined manually: AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, LOGGED_IN_SALT, AND SECURE_AUTH_SALT (7 in total defines).

    Once you have HTTP squared away Proceed with SSL:

    4.) The integration plugin will try do some things for you in the backend, it will actually try to do all the cookie work for you. However it works off values you set via the integration option page and your wpmu site options.

    To take control of a few options, go ahead and define MANUALLY the following: (just as the plug-in suggests and more sometimes):

    COOKIEHASH, COOKIE_DOMAIN, SITECOOKIEPATH, and COOKIEPATH.

    5.) Add to wp-config.php:

    define(‘FORCE_SSL_LOGIN’, true);

    define(‘FORCE_SSL_ADMIN’, true);

    6.) Add to bb-config.php:

    define(‘BB_FORCE_SSL_USER_FORMS’, true);

    define(‘BB_FORCE_SSL_ADMIN’, true);

    7.) The kicker for me since I’m using MU Subdomains, i HAD to put into my bb-config:

    $bb->cookiedomain=’.mydomain.com’ //Yes, with the dot before the domain.

    (This is literally the only direct access object config I set in my PHP file. All the rest is handled by ‘DEFINE’ )

    Up to this point you should have integration with HTTP and HTTPS. Back and forth, forth and back, every which way. You should have it done without any manual speed up accessors. If it works, go ahead and add them but make sure you set them correctly. If your fanatical about security then cross the line, otherwise go get a beer, woman or pillow whatever.


    The Line


    8.) Log into BBpress. Goto your main blog, and wp will see you have a ‘logged_in’ cookie. Will display the site_admin link. Just go ahead and click log out.

    9.) Logging out will log you out, except a few cookies are left over. This is because the integration plug-in never inspects the HTTPS scheme properly. It will always look for HTTP. Test this by editing line 182 in the plugin file to read:

    $secure = true; //Don’t forget to change me back to false (default).

    10.) Repeat, and you’ll notice your cookies (the ones which matter) get blown away.

    Notes:

    – If you install WPMU 2.8 Alpha/Beta/Etc… you must _NOT_ enable

    define( ‘WP_AUTH_COOKIE_VERSION’, 1 )

    as the plugin suggests.

    – I DID NOT use any of the “speed up” manual configs which the bbpress integration tool points out. If you can’t get it working without these settings, adding them may not help at all and masks your real issue which is some other settings are screwed.

    – you NEED to make sure your URLs are correct. That means every single URL defined in your database in any meta table, options etc… Especially the case with the integration plugin.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    This is great info. Awesome work.

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