[OzzModz] Login By Country Log

[OzzModz] Login By Country Log 2.0.1 Patch Level 1

No permission to download

Ozzy47

Well-known member
Ozzy47 submitted a new resource:

[OzzModz] Login By Country Log - Log data about user visits from specific countries or IP's.

Requirements:
XenForo 2.1.0+

Description:

Log data about user visits from specific countries or IP's.

Features:

  • MaxMind GeoIP tool support
  • Ability to track visits only for certain users
  • Report creation to triggered user
  • Alert specific users about visits from tracked countries and IP's

Permissions:
View attachment 252908

Options:
View attachment 252909

View attachment 252910

[ATTACH...

Read more about this resource...
 

Joe Link

Well-known member
Thanks for making this @Ozzy47, I can definitely see how this would help cut down on scammers and spammers.

I just installed it to give it a try and it took the site down with this error (until I disabled the add-on).

1623082641410.png


When signing up for a new MaxMind key, I selected "No" for "Will this key be used for GeoIP Update?". Maybe this has something to do with it?

1623082796332.png
 

woody

Well-known member
@Joe Link - I commissioned this plugin in late 2020, and haven't had a single issue with it since installation. Yes, it is a great way to track/catch scammers :)

I do not recall which GeoIP update option I selected, but easy enough to create a 2nd instance and test. I suspect I selected "yes" but that was months ago :)
 

Painbaker

Well-known member
@Joe Link it seems your Ads Manager add-on uses different version of GeoIP2-php library.
Can you check "\vendor\geoip2\geoip2\CHANGELOG.md" file from your ads manager add-on archive and tell me which version is the newest?
 

Joe Link

Well-known member
@Joe Link - I commissioned this plugin in late 2020, and haven't had a single issue with it since installation. Yes, it is a great way to track/catch scammers :)

I do not recall which GeoIP update option I selected, but easy enough to create a 2nd instance and test. I suspect I selected "yes" but that was months ago :)
Awesome! It only took me a second to see how it would be a big help.

@Joe Link it seems your Ads Manager add-on uses different version of GeoIP2-php library.
Can you check "\vendor\geoip2\geoip2\CHANGELOG.md" file from your ads manager add-on archive and tell me which version is the newest?

Are you referring to the CHANGELOG.md in the addon directory (/src/addons/Siropu/AdsManager/Vendor/MaxMind/geoip2/geoip2)?

If so, it's 2.6.0 (2017-07-10).
 

Painbaker

Well-known member
If so, it's 2.6.0 (2017-07-10).
Yeah, i used the latest version of this library.
Are you using the latest version of the Ads Manager add-on? We have to ask the author to update this library, because we can't downgrade it to avoid incompatibilities with newer add-ons.
 

Joe Link

Well-known member
Yeah, i used the latest version of this library.
Are you using the latest version of the Ads Manager add-on? We have to ask the author to update this library, because we can't downgrade it to avoid incompatibilities with newer add-ons.

I'm using 2.4.2 (one version behind).
 

Joe Link

Well-known member
Looks like I got this working somehow :ROFLMAO:

I'll post some notes, in case it helps anyone. No guarantees any of this is correct.

  1. The addon couldn't create the /internal_data/ozzmods/countrylogin/ directory for some reason, so I had to manually create it and set the appropriate permissions.
  2. I created a key and selected No when asked if it would be used with GeoIP Update.
  3. I downloaded the .mmdb file by going to https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key={key}&suffix=tar.gz, replacing {key} with my key.
  4. I extracted and uploaded the .mmdb file to /internal_data/ozzmods/countrylogin/.
I can't remember if I set the key in the addon options after step 2 or after step 4.

I copied the list of 2-digit country codes from here, pasted it into the addon options, and removed the ones I don't want to watch.

HTH
 

Joe Link

Well-known member
@Ozzy47 @Painbaker

Got this error on install on another instance, not sure how big of a deal it is.

Code:
Server error log

    XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry '1' for key 'user_id' src/XF/Db/AbstractStatement.php:228

    Generated by: Admin Jun 23, 2021 at 10:27 AM

Stack trace

INSERT  INTO `xf_ozzmodz_cl_report` (`user_id`, `log_date`) VALUES (?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(218): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1510): XF\Db\AbstractAdapter->insert('xf_ozzmodz_cl_r...', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1242): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/addons/OzzModz/CountryLogin/Service/Logger.php(152): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Service/ValidateAndSavableTrait.php(40): OzzModz\CountryLogin\Service\Logger->_save()
#8 src/addons/OzzModz/CountryLogin/Listener.php(34): OzzModz\CountryLogin\Service\Logger->save()
#9 src/XF.php(341): OzzModz\CountryLogin\Listener::OzzModz\CountryLogin\{closure}()
#10 src/XF/Job/Manager.php(288): XF::triggerRunOnce()
#11 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
#12 src/XF/Job/Manager.php(116): XF\Job\Manager->runJobEntry(Array, 8)
#13 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#14 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#15 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\UserCriteria\XF\Admin\Controller\Tools), NULL)
#16 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\UserCriteria\XF\Admin\Controller\Tools), NULL)
#17 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#18 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#19 src/XF.php(488): XF\App->run()
#20 admin.php(13): XF::runApp('XF\\Admin\\App')
#21 {main}

Request state

array(4) {
  ["url"] => string(24) "/admin.php?tools/run-job"
  ["referrer"] => string(57) "https://www.domain.com/admin.php?tools/run-job"
  ["_GET"] => array(1) {
    ["tools/run-job"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["_xfRedirect"] => string(94) "https://www.domain.com/admin.php?add-ons/install-from-archive-complete&batch_id=423"
    ["_xfToken"] => string(8) "********"
    ["only_ids"] => string(6) "234796"
  }
}
 

woody

Well-known member
Bug report:

When I use the built-in "Send Password Reset" when viewing a user account in the ACP, the "Enable Country Log Reporting" also unselects. I then need to return to the member account and re-select that option.
 

Joe Link

Well-known member
@Ozzy47

Tried to install 2.0.1 P1 and getting the message "Could not process OzzModz-CountryLogin-2.0.1 1.zip: The version of [OzzModz] Login By Country Log provided is older than the currently installed version.".
 
Top