Forums

Join
bbPress Support ForumsPluginsLogging into bbpress account from external script

Info

Logging into bbpress account from external script

  1. 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?

  2. 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");
    }

  3. You must log in to post.