The MU forums have moved to WordPress.org

Another bbpress cookie post (sorry) (11 posts)

  1. alex.rogahn
    Member
    Posted 15 years ago #

    Ok I know there must be hundreds of these types of threads going round but I can't find any clear cut answers to my problem. I found quite a few threads with "correcting" code in them but none of them worked well and were usually for previous versions :/

    Here's my scenario. I have WPMU 2.7 and bbpress 1.0 alpha 6 installed and running fine, they are on 2 separate dbs but the intergration is good too, now the problem is that they don't have a single log in, its not really *that* bad but it would be nice to fix it... so does anyone know some code that will fix this.

  2. alex.rogahn
    Member
    Posted 15 years ago #

    no replies?

  3. tdjcbe
    Member
    Posted 15 years ago #

    You may want to give folks more than an hour to respond.

    Have to be honest. I just removed the link out of the bbpress theme code and put a exit(); call near at the top of the register file within the bbpress code so new account couldn't be created via the forums.

  4. alex.rogahn
    Member
    Posted 15 years ago #

    First of all I waited two hours for a reply and second of all what difference will stopping people from signing up on the forums make, I'm not having a problem with the general intergration, its just the cookies that seem to get messed up and not allow people to log in once, so if they logged into wpmu they would also be logged into bbpress and vice versa but that doesn't happen, they have to log into wpmu and also bbpress and again vice versa.

  5. cafespain
    Member
    Posted 15 years ago #

    Would this help (don't know as I've not watched it but the title caught my attention).

    http://wordpress.tv/2009/01/23/integrating-a-bbpress-forum-with-your-self-installed-wordpress/

  6. alex.rogahn
    Member
    Posted 15 years ago #

    I've already watched that and it just repeats what I've already done. If I haven't made it clear enough already. User integration works fine, it's just a problem with cookies where users cannot log into wpmu once and also be logged into bbpress from that single login and the other way around.

  7. eagano
    Member
    Posted 15 years ago #

    The problem with cookie integration with bbPress is that WPMU uses the domain, including the sub-domain, to create the COOKIEHASH using MD5:

    define('COOKIEHASH', md5(get_option('siteurl')));

    in bbPress, the COOKIEHASH is also created using MD5:

    define('BB_HASH', $bb->wp_cookies_integrated ? md5($bb->wp_siteurl) : md5($bb->uri));

    For your main blog, get_option('siteurl') will return something like http://mymainblog.com. bbPress will use wp_siteurl, which should also return http://mymainblog.com.

    Note: it gets more complicated if you actually setup another VirtualHost in Apache just for your forums, that gets loaded before your main WPMU VirtualHost, like http://forums.mymainblog.com

    The problem exists when a user logs in through their own blog, and get_option('siteurl') returns the subdomain, like http://firstblog.mymainblog.com. bbPress still uses the wp_siteurl, and now your MD5 hashes will never match.

    The solution: HARDCODE your COOKIEHASH. Use MD5 to get a good hash (from your domain or whatever you choose), then define COOKIEHASH in both WPMU wp-settings.php and bbPress bb-settings.php.

    [edit] You need to hardcode wp-settings.php COOKIEHASH and bb-settings BB-HASH to the same value.[edit]

    Possilble downside: users that have successfully logged in to their own blog within the domain will appear to be logged in to all the other blogs as well, but will have no rights. But the login to WPMU and bbPress will be seamless - as a single signon.

    See my enhancement ticket to WPMU here:
    http://trac.mu.wordpress.org/ticket/775

    See my discussion on bbPress forums here:
    http://bbpress.org/forums/topic/wp-261-integration-success-with-10-alhpa-2

    While users that are created in bbPress are given default privileges according to the role map in bbPress, the same mechanism does not exist to create default privileges in bbPress when signing up in WPMU. For slick integration on WPMU signup: dowmload my plugin for WMPU that will enable 'member' level privileges in bbPress when a user is created in WPMU (as will be the case in most installs).
    http://bbpress.org/plugins/topic/wpmu-enable-bbpress-capabilities/.

    Let me know what you think!

  8. alex.rogahn
    Member
    Posted 15 years ago #

    Mind Boggling! I'll try to work this out :P

  9. alex.rogahn
    Member
    Posted 15 years ago #

    well it all works brilliantly except for one thing; If I log into wordpress then I'm also logged into bbpress however I can't log out through bbpress I have to go out through wordpress and vice versa. Do you know why it does this and how I can fix it?

  10. alex.rogahn
    Member
    Posted 15 years ago #

    A little help? Sorry if I'm being impatient :/

  11. gerikg
    Member
    Posted 15 years ago #

    still need help?

About this Topic

  • Started 15 years ago by alex.rogahn
  • Latest reply from gerikg