755833Inactive
I too would like a solution to this. There is a plugin available to do this but it doesn’t work on wordpress 2.5.1. I think I may just have to hack the bbPress registraton queries.
nv1962, it would be a good plugin to learn/practice from. Roughly 3-5 lines total. Essentially you’d add an action to bb_send_headers and just like my plugin above, if the bb_get_location==”register-page” you echo the redirect header for the wordpress page (and then do a die() so no other code can execute until it redirects).
Well login integration is not as important as the register part. As far as your instructions, I wouldn’t recommend deleting the contents of a core file but the redirect part is okay.
It occurs to me, it’s actually possible to redirect the register page in bbpress to the wordpress side via plugin with no edits required anywhere.
Remember that bbPress registration process should catch up to the WordPress side eventually. In fact I like it’s layout better but WordPress’s is more mature code-wise.
Yes, this is why I always recommend to people when integrating with WordPress that they redirect all login and registration links to the wordpress side. It’s had years of development in that area.
In any case, here is a simple plugin to prevent duplicate email addresses. Unfortunately bbPress has no way to place custom error messages on the page without template hacking but this should do:
<?php
/*
Plugin Name: no duplicate email addresses
Author: _ck_
*/
if ($_POST && bb_get_location()=="register-page") {add_filter('bb_verify_email','no_duplicate_email');}
function no_duplicate_email($email) {
if ($email) {global $bbdb; if (!$bbdb->get_row($bbdb->prepare("SELECT * FROM $bbdb->users WHERE user_email = %s", $email))) {return $email;}
else {add_action('bb_foot','no_duplicate_email_alert'); return false;}}
}
function no_duplicate_email_alert() {echo "<scr"."ipt>alert('".__("email address already registered")."');</script>";}
?>
(bbPress 0.9 or higher required)
(Subtitle: how to use registration protection/filtering in WP for bbPress – the lazy but effective way!)
Say: you’re a PHP newbie (like me), want to run bbPress and WP, and have successfully completed the installation of the plugin to integrate the bbPress user database with WP’s (whew!) and then you discover that people can register via either the bbPress or WP . Suppose furthermore that you’re getting hammered by nasty bots registering themselves, and have an open self-registration policy on your WP blog/CMS, and therefore installed a nifty registration screening plugin (oh say, WP-reCAPTCHA) and would like to use that for bbPress.
How could you do that? With two simple edits you can:
1) Open the register.php file of bbPress (in bbPress’ root directory) and delete EVERYTHING in it, and save your cleaned-out register.php file back to its place on the server (saving an empty file is to avoid a possible “file not found” error after the next step)
2) Open (or create if you don’t have it – which would be rare) a .htaccess file in the web server’s root directory and add the following single line (it’s displayed here on two lines, but really ought to be a single line!), and put that at/near the top of your .htaccess file (assuming your bbPress install sits in the /forum sub directory; else, modify accordingly to point to the register.php file):
Redirect permanent /forum/register.php http://www.example.com/wp-login.php?action=register
Make sure you substitute “example.com” with your own domain (of course).
3) This step is non-existent. Instead, enjoy your newfound unified registration bliss for dummies!
I would back up your database first, just to be sure.
If you delete all the files, nothing happens to WordPress.
If you delete all the bb_ tables, that does not affect WordPress.
I’m not sure how you get rid of the bb users from the wp_users table. But once you delete all the bb_ tables from the database, you should verify that you can log in to WordPress admin fine. You might want to manually delete the bb users from the wp_users table, but you’d have to be careful if they created any content in WordPress that would be keyed to their id.
I think this covers integration:
https://bbpress.org/documentation/integration-with-wordpress/
724719Inactive
that means people can keep sign-up new accounts to give them selfs Karma points….
i dont mean to sound like a prick __ck__ but can you whip up some sort of plugin for this problem or some instructions. becuase i wouldnt know where to start let alone code somthing like that.
EDIT: WordPress has it goin ok, I get the message:-
ERROR: This email is already registered, please choose another one.
when registering an already existing email.
Whoa I never realized that.
I wonder if it’s also that way on the WordPress side.
Well it shouldn’t be too hard to whip up some code for that.
You cannot use WordPress 2.6 with bbPress 0.9
There are major cookie changes in 2.6.
It’s going to be awhile before there is a version of bbPress that will work with 2.6, so stick with 2.5.1
bbPress does not create the .htaccess file for you like WordPress does. I think in future releases they are considering creating it for you.
https://trac.bbpress.org/ticket/838
Wait, so was this ever resolved after a year?
With WordPress in the root and bbPress in a sub-directory (ie. /forums/) can they both have pretty permalinks?
I have an idea if not – simple edit the webroot wordpress htaccess like so:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/forums/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
where /forums/ is the install path of bbpres underneath wordpress. Remember you still need the local htaccess for bbpress in it’s own folder.
I can vouch for ThemePress. It is an excellent solution imho. I am using it on a site that is still in the development stage. It is quite easy to use. It is also much better than trying to make separate bbPress and wordpress themes similar.
Oh wow I wonder when they slipped that in. Good find.
I bet it’s just copied from the WordPress code.
If you know how, you might want to stick that into TRAC (and if you have the time, check WordPress and it’s TRAC too)
(couldn’t get the quote to work) from _ck_ post above: ” Also, none of this truly fixes WP 2.6 to work properly with cookie integration with bbPress 0.9.0.2 – that’s going to require an upgrade on the bbPress side.
ahh this must be why I am having trouble with single sign-on? In the past hour, I have tried everything in all the other posts about this topic to no avail. Unless I tried every combination/setting with the configs except the right one, of course.
The trouble is that the developers on the WP side, in their wisdom
decided to re-use an existing cookie name for a new purpose and change the cookie path.
The idea is higher security as the admin cookie in theory should only get transmitted when you are entering the admin section.
This is why you need to try deleting all your cookies (for your site) after installing WP 2.6
If that fails, try my define fix above.
Note that changing the cookie path to ‘/’ takes you back to the lower level of security that WP 2.5.1 and earlier had. There’s a particular WP mod who’s upset with me for even suggesting this but I figured the idea is to get you up and running ASAP first until they address this later.
Also, none of this truly fixes WP 2.6 to work properly with cookie integration with bbPress 0.9.0.2 – that’s going to require an upgrade on the bbPress side.
yes, that seems to fix it (at least for me):
from this thread: https://wordpress.org/support/topic/188964/page/2#post-803992
go into your wp-config.php
and add this line:
@define(‘ADMIN_COOKIE_PATH’, ‘/’);
NOTE ‘/’ will be your blog path.
If you find that ‘/’ doesn’t work, make it ‘/blog/` or whatever your path is.
OK I checked the wordpress database users and came up with the only user name registered which is my admin user and the id is 3. Then I went and checked it against the user meta and it has all the correct settings for an admin account. I then went into the bb database users and found the keymaster account which id is 1. I checked it against the bb database user meta and it has the setting you specified above and a few others. I think its because my admin id on my wp database is 3 and not one. Do you think that is the problem? If so how do I go about fixing it without messing everything up? Thanks for your help BTW. I appreciate it.
750331Inactive
My installation seems to work with just that slash “/” on it own, but at least it working. I added the below into my wp-config.php file
@define('ADMIN_COOKIE_PATH', '/');
I have tried it with '/blog/wp-admin' and that didn’t seem to work, at all.
That doesn’t work when I add that to my WordPress (it has integrated functions). Nothing appears when I added the code. Also, what is the code to display content if user is logged in, else (if not logged in) display some other content.
Okay, some bbPress users may be able to get it to work with WordPress 2.6 by adding to your wp-config.php
@define('ADMIN_COOKIE_PATH', '/blog/wp-admin');
where “blog” is your blog’s actual path. If it’s in the webroot, just take out “blog” entirely and leave '/wp-admin'
We might have to sit tight for a 0.9.1 release or something like that.
I figured out a work-around to get into admin area on WP 2.6 but this will “knock out” your bbPress login as you switch back and forth:
https://wordpress.org/support/topic/188964/page/2?replies=41#post-803992
There was a large commit to trunk a few days ago that upgraded most of the cookie stuff.
So what next?
Is this an issue of configuring wp 2.6 and bbpress 0.9.0.2 correctly to fix this problem?
Or is a software-update necessary?
I wonder if a newer bbPress build will be required which can be taken from trac (or via svn).
Let me tinker a bit and see if they changed cookie methods (yet again, sigh)
CONFIRMED: WP 2.6 breaks cookie sync
and I get a endless-loop login by WP 2.6
Many people seem to confirm similar cookie problems:
https://wordpress.org/support/topic/188964
https://wordpress.org/support/topic/188870
hi,
just upgraded to wordpress 2.6, and I’m not able to login to my bbpress forum anymore (0.9.0.2). it just reloads the page.
Logging in at the wordpress admin interface is wokring fine.
(cleared cache, cookies,…)