MyBB Community Forums

Full Version: MyBBIntegrator Login Anomaly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm almost done with the project I mentioned in my last support thread! However, I'm having this odd problem with MyBBIntegrator. For the login script, the only way I've gotten it to work is for the form's action to link to an external php page with the login script.

I could live with it (added a "go back" button so people can go back and continue the form). However, I was forced to iframe the form, and now that method isn't working.

Here is the page: http://laggygamerz.com/raven/join

Form:
<?php
echo ($MyBBI->isLoggedIn()) ? '<img src="nw/check.png">' :
'<form action="/assets/php/nw_login.php" method="post">' .
'<input class="text-field" type="text" name="user" placeholder="Username" /><br />' . 
'<input class="text-field" type="password" name="pass" placeholder="Password" /><br />'. 
'<input class="button" type="submit" name="login" value="Login" />'. 
'</form>';
?>

Login Script:
<?php
define('IN_MYBB', NULL);
global $mybb, $lang, $query, $db, $cache, $plugins, $displaygroupfields;
require_once '../../forum/global.php';
require_once '../../forum/MyBBIntegrator.php';
$MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);
echo '<br><center>';
$login_status = $MyBBI->login($MyBBI->mybb->input['user'], $MyBBI->mybb->input['pass']);
if ($login_status == true)
{
    echo '<font color=green><strong>You have logged in sucessfully</strong></font><br><br><a href="nw_form.php"><strong>Continue</strong></a>';
}
if ($login_status == false)
{
    echo '<font color=red><strong>Incorrect User/Password</strong></font><br><br><a href="nw_form.php"><strong>Try Again</strong></a>';
}
echo '</center>';
?>