Access bbPress login info from existing site
-
I’ve tried to find the answer to this by reading the forums and my own experimentation, but I’m still having problems. Any information welcome. In summary, the only way I can seem to acess bbPress login info from other pages on my site is to put bbPress at the root of my site, i.e. on the same level as my other scripts.
I have a PHP/MySQL installation and I would like to integrate bbPress with my own PHP applications. I don’t want the user to have to have two login IDs/passwords – my issue is very similar to User table abstracted in future versions?, only in reverse. That is, I want to use bbPress functions as the primary authentication/registration and have my apps acess the bbPress user info.
EX: I have a file called http://mydomain.com/gallery.php, in which I have added the following code:
require("bb-load.php");
login_form();
bb_get_current_user_info('id');
if (bb_current_user_can('administrate')) {
//do some things admins can do
}IF I put the bbPress install at the root of mydomain.com, this all works beautifully, but I want to put the bbPress install in http://mydomain.com/forums/. If I do that, altering the code to point to “forums/bb-load.php”, I get the login form, but it doesn’t work: I can type userid and password, and click login, but no login occurs. Furthermore, the login form appears even if a valid user is currently logged in – it doesn’t say “Welcome, UserID”.
Do I need to do a plug-in? If so, what would it do, in general? Thanks in advance!
- You must be logged in to reply to this topic.