Info
- 2 posts
- 1 voice
- Started 3 years ago by Cine
- Latest reply from Cine
- This topic is resolved
Logging into bbpress account from external script
-
- Posted 3 years ago #
I'm installing bbPress on a website that is mainly flashbased, and I need the users to be able to login via a form placed inside the frontpage.swf file. This is usually easy: all that's necessary is a .php file that communicates with the flash, that basically looks like this:
if($_POST['username'] == $correct_username && $_POST['password'] == $correct_password){
echo("loggedin=true");
} else {
echo("loggedin=false");
}Flash will then read the variable returned and work from there.
The issue is that I can't figure out how to verify the data against the users table. I've studied bb-login.php and login.php, but I still can't find the code that does the actual logging in - the code that checks the password against the encrypted one in the database, sets the cookie, etcetera.
Could someone point me in the right direction?
-
- Posted 3 years ago #
Never mind, figured it out. The functions were really easy to use. I ended up doing it like this:
$user = bb_login( @$_POST['username'], @$_POST['password']);
if(isset($user->ID)) {
echo("loggedin=true");
} else {
echo("loggedin=false");
} -
You must log in to post.