MyBB Community Forums

Full Version: Successfull Login returns $correct == false?!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Writing yet another plugin, but I'm running into the following issue.

When logging in from the quick login box, the $correct variable in member.php returns false even though the login was a success with no errors.

Can anyone explain this?
How are you accessing the var? Could you post the function?
Even putting:
echo "<pre>";var_dump($correct);echo "</pre>";die();

Right after the $correct = true; assignment block gets me bool(false).

In my plugin I've got:
global $correct;

if ($correct)
{
  This code is never executed because $correct is always false...
}

And I know this worked before, because I've USED it before in another plugin. The bridge I made for Rusnak Adoptables script; where I did if ($correct) { code to write the Rusnak Adoptables Cookie here } and it worked just fine. Wrote the cookies and everything. Of course, that plugin is returning false for $correct now also.
What's the hook you're using?
member_do_login_end
That's an issue I have reported a while ago.

member_do_login_end IS DUPLICATED.
Thus it gets called two times. One where $correct is true and another one where $correct is NOT true

They haven't fixed it yet though
Isn't that intended functionality though? Where the one thats called if its correct only gets called IF it IS correct, and vice versa? I've seen this kinda hook duplication in other places too.
(2010-04-23, 05:03 PM)ralgith Wrote: [ -> ]Isn't that intended functionality though? Where the one thats called if its correct only gets called IF it IS correct, and vice versa? I've seen this kinda hook duplication in other places too.

Not sure, can't remember if it was this one that I've reported though or if it was one in showthread or forumdisplay.

But if you're getting logged in correctly, $correct mustr be true
Agreed. Which is what is confusing. I wouldn't mind seeing a dev comment on this.
Just tried it myself and works:
function hello_world_login()
{
	global $correct;
	
	if ($correct === true)
	{
		die("test");
	}
}

Displays "test".
Pages: 1 2