XF 2.2 Cannot log into admin after a few failed attempts

CrispinP

Well-known member
Hi folks,

I switched from Chrome to FF and I mistakenly used the wrong password to log into admin.
When I try log in now it just takes me back to the admin login screen. No message of anything.

I've tried:
  • Truncating the admin session cache table
  • Promoting another test account I had to admin (both table update and config.php super admin
Same thing happens to that.

What could this be?
 
Solution
It's an Ezoic issue - it doesn't play nice with XF.

You may be able to investigate to determine the exact cause and then change settings in Ezoic/CF to mitigate it.

You can also try adding this to the config.php file:
PHP:
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}

Or this:
PHP:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
It's an Ezoic issue - it doesn't play nice with XF.

You may be able to investigate to determine the exact cause and then change settings in Ezoic/CF to mitigate it.

You can also try adding this to the config.php file:
PHP:
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}

Or this:
PHP:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
 
Solution
great, thanks. Can confirm that both those options, seperately, fix the problem.

In all fairness, the guys from Ezoic are being super helpful in trying to understand it but hindered by me not wanting to give them admin panel access :D
What do they need to do, or XenForo need to do, to make this not a problem going foward?
 
It's due to the server being configured to use a reverse proxy (which is constantly changing) and the real IP address not being exposed consistently and/or CloudFlare being in use.

It's doing what it's supposed to - the config.php switch works around the issue caused by it.
 
We had same issues logging on ACP after integrating Ezoic and the code below solves it. Both codes actually allow us to login but the other code won't show the visitors real IP.

PHP:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
 
Top Bottom