BuddyPress doesn’t interfere with user registration at that level. I think you’re almost certainly doing something wrong if you are needing to create your own hash for the password, etc. The authentication class is overridable, and most stuff can be done via the ‘authenticate’ action (I think that’s the name). I would rethink the approach you are taking, and do a bit more research — the wordpress.org forums may have had discussion about hooking into the registration process, and certainly the codex does.
Hi Paul,
im not wanting to create my own hash.. i just want to write the user information to the database without using the default bp_core_screen_signup function.. so i am using a database query to manually add the data to the wp_user database table..
the problem is that the hashed password isnt correct..
can you offer any suggestions as to why when you refresh the page when echoing `wp_hash_password(‘test’);` i get a different hash each time??
here is an example
Person A currently exists in the database.. password = ‘test’
Person B creates a new account where i write wp_hash_password(‘test’); to the database
Person A looks like this $P$BgZ1xZI/B6RJ9bngl.EnPRcCB34n/G.
Person B looks like this $P$BotBsMWNHVnIElIOT9VGpax6cdXVgo.
Person A can log in with password as ‘test’
Person B cannot.
if i overwrite Person B’s password field with the copied and pasted hash from Person A, Person B can now log in with password ‘test’
managed to fix this issue by writing the following
`$wpdb->query($wpdb->prepare(“INSERT INTO `wp_users` (user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_status, display_name) values (‘$user_login’, MD5(‘$user_pass’), ‘$user_nicename’, ‘$user_email’, ‘$user_url’, ‘$date_registered’, ‘$user_status’, ‘$user_display_name’)”));`
note the MD5() around the $user_pass variable.. this appropriately hashes the password as it is entered into the database.
just FYI
No no no, there is absolutely no need to insert a user account with a direct SQL query
any reason you’re not just using the standard wp_insert_user() function? what does buddypress do that’s different than the standard wordpress signup?
I’m curious because I’m in the process of doing the same thing as the OP (although was planning on just using the default wordpress functionality, which I have working for my system – but the next step is to migrate the code so that it uses buddypress as well)…