Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
627 views
in Q2A Core by

My users get "too many logins, try again in one hour" even though it is the first login.

I could track down the problem to the "loginip" == 0.

Shown in the user profile as IP: 0.0.0.0.

Probably this is due to ip v6 not being stored by q2a v1.7. I guess we need a fix here.

Q2A version: 1.7.4

1 Answer

+1 vote
by
This has been fixed for v1.8.

It's a surprisingly complex issue and took a while to fix, so I can't really suggest anything in the meantime.

Though maybe it's possible to drop IPv6 support at the server level (Apache/Nginx)? I think that would force visitors to use IPv4.
by
Would be nice to have the commit link. Makes it easier to find the changes.
by
The changes are in several commits, so I can't give a specific one. I think the changes start on this page https://github.com/q2a/question2answer/commits/1.8?page=2
From 5fa744c upwards.
by
How safe is an update to 1.8 alpha? My users running more and more into problems, since they cannot login anymore based on IP spam restrictions.
by
I have checked the commits, seems like a bunch of work. Also wanted to point out that all this can be simplified from PHP 5.6.3, where you just use INET6_ATON() and INET6_NTOA(), found this info here: http://www.rdeeson.com/weblog/168/updating-mysql-and-php-to-store-ipv6-addresses.html
by
> How safe is an update to 1.8 alpha?

I've been running it on my site for weeks now with no problems at all. Try testing it locally if you can, in case there are any problems with plugins (I don't think there should be).

Alternatively, if you have a VPS/dedicated server you should be able to disable IPv6 support there, and it will instead pass the users' IPv4 address to PHP.

> simplified from PHP 5.6.3, where you just use INET6_ATON() and INET6_NTOA()

That's *MySQL* 5.6.3 actually. It might be a while until we can require that as a minimum, I think version 5.0 and 5.5 are still very popular. Ubuntu 14.04 LTS which is one of the most popular servers, uses v5.5.
The solution we have, using PHP, actually works very well so there's no rush to change.
...