Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: cookies (subtle bug?) single sign-on bbpress and wordpress

nolageek,

In WPMU, did you put the bbpress-integration.php in the “mu-plugins” directory or the “plugins” directory?

I want only the site admin to be able to activate the “bbpress Integration” plugin, but it shows up for all users giving them an option to activate the plugin. That’s not good.

On the bbPress side, I found that the wordpress-integration is not necessary (I’ve asked about this, but no replies so far), and display name plugin requires some code changes to the BBPress code for it to work properly. It causes permission problems, and I had to dig around the forum where it shows you which code to change.. In retrospect, it probably wasn’t worth the trouble. (Gurus, please correct me if I am wrong, as I am new to BBpress)

If you want me to look for that thread again, let me know.

To get single sign-on working properly, you need to make code changes on the bbPress side to bb_cookie() and bb_logout() in pluggable.php along with the config changes I mentioned (which you’ve done already).

function bb_cookie( $name, $value, $expires = 0 ) {
if ( bb_get_option( 'cookiedomain' ) ){
setcookie( $name, $value, $expires, bb_get_option( 'cookiepath' ), bb_get_option( 'cookiedomain' ) );
}else{
setcookie( $name, $value, $expires, bb_get_option( 'cookiepath' ) );
}
}

function bb_login($login, $password) {
if ( $user = bb_check_login( $login, $password ) ) {
bb_cookie( bb_get_option( 'usercookie' ), $user->user_login );
bb_cookie( bb_get_option( 'passcookie' ), md5( $user->user_pass ) );
do_action('bb_user_login', (int) $user->ID );
}
return $user;
}

I hope this helps, and please let me know how it works out.

Skip to toolbar