Geoblock Registration

Geoblock Registration 1.2.2

No permission to download
Sim updated Geoblock Registration with a new update entry:

v1.2.0 update

  • bugfix: don't try to uppercase a null iso_code
  • php 8 compatibility fix: don't set a default parameter before non-default subsequent parameters
  • slight re-arrange to order of code logic for EU checking - no point checking anything related to EU blocking if we don't have EU blocking enabled
  • rename table to xf_geoblock_cache to adhere to resource standards
  • addon now requires php 7+
  • explicitly check for phar extension on install
  • add legacy upgrade from XF 1.5 to Setup...

Read the rest of this update entry...
 
Hi @Sim please add option to not save blocked country on signup, for now i must manualy remove blocked/rejected users with batch.

Thanks.
 
Hi @Sim please add option to not save blocked country on signup, for now i must manualy remove blocked/rejected users with batch.

Thanks.

I'm not sure we can do that - this addon uses the core spam management functions so spam users are marked as rejected and not deleted. Exactly the same as if the were picked up by Stop Forum Spam or some other system built in to XenForo.

There may be an addon you can use to manage rejected users.

If you want to block users from certain countries from being able to even view your site and not be able to register at all, you can block them completely using Cloudflare.
 
Hi Sim,

thx for your great addon, using it for long while now.

I would like to make a feature request:
It would be nice if you could whitelist certain email domains when registering.
Background: Because we offer login with Facebook, our ‘App’ (the forum with its login functionallity) is regularly checked by Facebook (annually). We only let the German-speaking countries through (that's 99.99% of our target group) and moderate all others (because we get a lot of spam from there). When Facebook tests our forum, it tries the login with a certain email domain and ends up in moderation, as these registrations usually come from the asian region (are probably contract workers). The test then fails for them, and I have a lot of trouble passing it every year with a lot of back and forth.

Thanks, Thomas
 
does this work also for single USA States?
like Texas for example

No - this version of the addon works at a country level.

There are other Maxmind APIs which work at a city/state level - but I don't intend to add that functionality to this addon at this point in time.
 
Hi Sim, do you have an idea?

If a user with IP 123.123.123.123 comes, he should be redirected to /idiot.txt or a XenForo page. I have a stalker who registers multiple accounts daily from a fixed office IP address. I’d like to warn him before taking more serious actions.
 
Hi Sim, do you have an idea?

If a user with IP 123.123.123.123 comes, he should be redirected to /idiot.txt or a XenForo page. I have a stalker who registers multiple accounts daily from a fixed office IP address. I’d like to warn him before taking more serious actions.

You're best to handle this at a web server level or a cloudflare level.
 
This doesn't work for me, I get a traceback like the following when downloading the DB:

Code:
UnexpectedValueException: Could not read PharData [/var/lib/xenforo/internal_data/temp/GeoLite2-Country.tar.gz]: internal corruption of phar "/var/lib/xenforo/internal_data/temp/GeoLite2-Country.tar.gz" (__HALT_COMPILER(); not found) src/addons/Hampel/Geoblock/Maxmind/DatabaseExtractor.php:98
#0 src/addons/Hampel/Geoblock/Maxmind/DatabaseExtractor.php(98): PharData->__construct(...)
#1 src/addons/Hampel/Geoblock/Maxmind/DatabaseExtractor.php(61): Hampel\Geoblock\Maxmind\DatabaseExtractor->extractDatabase(..., ...)
#2 src/addons/Hampel/Geoblock/SubContainer/Maxmind.php(170): Hampel\Geoblock\Maxmind\DatabaseExtractor->updateDatabase(..., 'internal-data:/...')
#3 src/addons/Hampel/Geoblock/XF/Admin/Controller/Tools.php(19): Hampel\Geoblock\SubContainer\Maxmind->updateDatabase()
#4 src/XF/Mvc/Dispatcher.php(362): Hampel\Geoblock\XF\Admin\Controller\Tools->actionHampelGeoblockUpdateMaxmind(Object(XF\Mvc\ParameterBag))
#5 src/XF/Mvc/Dispatcher.php(269): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'HampelGeoblockU...', Object(XF\Mvc\RouteMatch), Object(Hampel\Geoblock\XF\Admin\Controller\Tools), NULL)
#6 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Hampel\Geoblock\XF\Admin\Controller\Tools), NULL)
#7 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#8 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#9 src/XF.php(806): XF\App->run()
#10 admin.php(15): XF::runApp('XF\\Admin\\App')

Attempted on PHP 7.2, 7.4, and 8.0
 
This doesn't work for me, I get a traceback like the following when downloading the DB:

Code:
UnexpectedValueException: Could not read PharData [/var/lib/xenforo/internal_data/temp/GeoLite2-Country.tar.gz]: internal corruption of phar "/var/lib/xenforo/internal_data/temp/GeoLite2-Country.tar.gz" (__HALT_COMPILER(); not found) src/addons/Hampel/Geoblock/Maxmind/DatabaseExtractor.php:98
#0 src/addons/Hampel/Geoblock/Maxmind/DatabaseExtractor.php(98): PharData->__construct(...)
#1 src/addons/Hampel/Geoblock/Maxmind/DatabaseExtractor.php(61): Hampel\Geoblock\Maxmind\DatabaseExtractor->extractDatabase(..., ...)
#2 src/addons/Hampel/Geoblock/SubContainer/Maxmind.php(170): Hampel\Geoblock\Maxmind\DatabaseExtractor->updateDatabase(..., 'internal-data:/...')
#3 src/addons/Hampel/Geoblock/XF/Admin/Controller/Tools.php(19): Hampel\Geoblock\SubContainer\Maxmind->updateDatabase()
#4 src/XF/Mvc/Dispatcher.php(362): Hampel\Geoblock\XF\Admin\Controller\Tools->actionHampelGeoblockUpdateMaxmind(Object(XF\Mvc\ParameterBag))
#5 src/XF/Mvc/Dispatcher.php(269): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'HampelGeoblockU...', Object(XF\Mvc\RouteMatch), Object(Hampel\Geoblock\XF\Admin\Controller\Tools), NULL)
#6 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Hampel\Geoblock\XF\Admin\Controller\Tools), NULL)
#7 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#8 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#9 src/XF.php(806): XF\App->run()
#10 admin.php(15): XF::runApp('XF\\Admin\\App')

Attempted on PHP 7.2, 7.4, and 8.0

Does the file /var/lib/xenforo/internal_data/temp/GeoLite2-Country.tar.gz still exist?

Try deleting that and then updating the database manually (Admin CP > Tools > Data maintenance > Update Maxmind Database)
 
Have you tried updating the database anyway using Admin CP > Tools > Data maintenance > Update Maxmind Database ?
Yes this is what I am doing to generate the traceback. I have tried on both my local and production machines. I can verify that the "last used" time on my MaxMind license key corresponds to the update action.

Edit: latest version of XF and this extension
 
Perhaps check your permissions - does the web server have permission to write to the internal_data/temp directory?
 
@Sim Here is the issue. I'm an old MaxMind subscriber, but I used their paid API; apparently, if you have an account in this state, you cannot use your license keys to download GeoLite2 databases, without going through an additional step to "request access".

This means that downloadDatabase makes a request that gives a response of 401 Unauthorized with the text "Invalid license key". However--the call succeeds, so it doesn't take the branch that calls XF::logError to let the user know. It just doesn't actually save the response to disk, which leads to a cryptic error later on.
 
Back
Top Bottom