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)
Impersonation might be a cause for concern. Plus, there’s ye olde sockpuppet issue, which some forums expressly forbid.
(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!
Why is it a problem to use someone else’s email address? The password email would go to that email address, correct? So how would the person using someone else’s email address benefit from that?
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.
724719Inactive
I just realised that two users can have the same email address, is it possible to give an error message if a user tries to register with an existing email.
I cant find a plugin for it.
any help appreciated please.
Sure, if that really bothers you, with bbPress you can do almost anything if you get clever.
Edit the login-form.php
template and wrap the entire <form></form>
in something like this (untested)
<?php if (bb_get_location()!="register-page") { ?>
<form blah blah blah
...
</form>
<?php } ?>
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.
724719Inactive
it usually goes as follows:-
`blahblah.com/forum/bb-templates/kakumei/login-form.php
note: – “kakumei is the theme name, you could try replacing it with the title of your theme your using”
find this snippet of code:-
<?php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_option('uri').'register.php') ?>
and replace it with
<?//php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_option('uri').'register.php') ?>
all you doing here is blocking out this code by putting the blocks “//” which means the code (link) to the registration page is will no longer be there.
Good luck
sway
http://www.swaymedia.com
http://www.picbi.com/forum
Ok (just asking this cause i am working on a plugin myself), but how about the next step. I have this to create a table if it doens’t excist:
bb_register_activation_hook(__FILE__, 'bbmenu_install_check');
function bbmenu_install_check() {
global $bbdb;
$bbdb->hide_errors();
$installed = $bbdb->get_results("show tables like ".$bbdb->prefix."bbmenu");
if ( !$installed ) :
$bbdb->query(" CREATE TABLE IF NOT EXISTS <code>".$bbdb->prefix."bbmenu</code> (
<code>item_id</code> INT(3) NOT NULL AUTO_INCREMENT,
<code>item</code> varchar(50) NOT NULL default '',
<code>set</code> varchar(50) NOT NULL default '',
<code>page</code> varchar(50) NOT NULL default '',
<code>location</code> varchar(50) NOT NULL default '',
<code>order</code> int(9) NOT NULL default '0',
PRIMARY KEY (<code>item_id</code>)
)");
endif;
$bbdb->show_errors();
}
But I also want to put some data in it:
"INSERT INTO
$bbdb->menu` VALUES
(DEFAULT, ‘Forums’, ‘active’, ‘index.php’, ‘front-page’, 0),
(DEFAULT, ‘Search’, ‘active’, ‘search.php’, ‘search-page’, 1),
(DEFAULT, ‘Statistics’, ‘inactive’, ‘statistics.php’, ‘stats-page’, 0);”;`
How to do this in the same query?
749549Inactive
Hello,
I have a new installation of bb press integrated with my main wordpress site. For a whole bunch of reasons I want to edit the bb press installation so that there’s no way to register for the board through the board itself; I only want people to be able to register through the main wordpress site. Is there any way to block registration through the board, or just remove each element of it manually? I’m using the theme “Scoun” if it makes any difference. Any suggestions would be greatly appreciated.
724719Inactive
lol nope. thats exactly why critiques are important. thanks.
ill do that now.
edit: done. yeah they could signup at the WP homepage, but yeah the forum didnt have a link to register. :p
Is there a register link on the forum home page?
Ok so I have searched the forums but didn’t see any relevant. I just installed bbpress and then went to setting and set the correct settings for integration with my separate wp database. Now I didn’t see the change when I went to the forums so I logged out cleared mu cache and cookies and went to log in with the same user name as before but it comes up as the user name is not registered. It doesn’t make sense it looks like it integrated the db’s fine but erased by login information. Is there a way to check to see if it integrated correctly? Also is there a way to make another or recover my admin login information since it looks like it deleted it.
Edit: I just tried to register a new user name and it gave me this error.
Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /home/hyperhoo/public_html/businessperfection/forum/bb-includes/db-mysql.php on line 180
738576Inactive
Hi,
I am just going through the setup of bbPress and I have 2 questions about the above.
1. Add cookie integration settings:
If you want to allow shared logins with an existing WordPress installation.
Does this mean that users who register for the forum are also able to write posts on my blog? I can’t imagine this would the case, but seeing this made me a bit nervous.
2. Add user database integration settings:
If you want to share user data with an existing WordPress installation.
What’s the benefit behind this, besides centralizing user data?
Try one thing at a time. Let me try registering again and see what the password looks like this time.
http://www.astisti.it/forum
I tried to register and once it happened that the password was wrong… But most of my tries worked.
I’ve never had that problem. Can you post a link to your forum, so we can register, then see what happens when we try to log in?
Thanks.
I am experiencing the same problem as well.
I think it has something to do with user roles, as a registered BBpress user does not have get a defined role in WordPress (i.e author, contributor, editor etc…).
It would be easier if a default wordpress role was automatically assigned to a user that registers via bbpress.
If anyone has any ideas/solutions it would be much appreciated.
This is getting to complicated for me. I have given up trying to integrate WP and bbPress. But I still want to try get them look similar. So I deleted my bbPress-tables from the database and deleted all the bbPress-files and started new.
But got new problems, when the installation was made I got a warning:
Warning: getmypid() has been disabled for security reasons in /data/members/paid/e/n/enkelwebbplats.se/htdocs/www/forum/bb-includes/class-phpass.php on line 43
Warning: Cannot modify header information – headers already sent by (output started at /data/members/paid/e/n/enkelwebbplats.se/htdocs/www/forum/bb-includes/class-phpass.php:43) in /data/members/paid/e/n/enkelwebbplats.se/htdocs/www/forum/bb-includes/functions.php on line 2258
I only understand that this relates to passwords and when I tried to log I could not and got a not exact but similar warning and could not log in. I tried to register but the password I was given did not work.
I am getting frustrated. Now I cannot create a non-integrated forum. Please, please help!!!
I’ve been trying to follow this thread that has a patch to display the temporary password for users who have just registered with my forums:
Users dont receive password after registration
the code in my file is different then what pravin said to change in bb-includes/registration-functions.php. i just can’t figure out what needs to be changed.
is this technique outdated? I’m running bbpress 0.9.0.2. i would really like to do this as my mail server from my crappy host gets blacklisted often and registration emails get caught in spam filters.
i also know i should add some stuff to my SPF records, but 1) i’m not really sure how to do that (that’s a different thread though) and 2) i’d like to display the passwords at registration anyway.
please help!
It is true, no disclaimer or terms of use are included with bbPress. I created one and link to it on the confirmation after registering, and also include the link in the registration email.
Try registering a new user, log in with a different browser if necessary, and see if you can edit another member’s post.
BTW, I registered two accounts, one my own domain, one gmail, and after 10 minutes I still have no email from your forum. Normally, I get the mail from a new bbPress registration within seconds.
Where is this website hosted (physically, in which country is the server)?