[OzzModz] Login By Country Log

[OzzModz] Login By Country Log 2.1.0 Patch Level 3

No permission to download
@woody
This add-on uses MaxMind's GeoLite2 Geolocation library

Probably your database is outdated

Try to download new version from your Maxmind cabinet (edition: GeoLite2-Country) and manually replace the \internal_data\ozzmodz\countrylogin contents on your forum
 
@Ozzy47

Next update should probably check this notification preference against the "[OzzModz] Login By Country Log: Can view reports" permission (so normal members can't see it) :)

1633794324677.png
 
@Ozzy47

Seeing quite a few of these errors in the ACP after enabling CloudFlare. I updated to the latest DB, but it had no affect. Any ideas?

1646070892951.webp

Code:
Server error log

    InvalidArgumentException: The value "159.87.155.161,104.129.198.224" is not a valid IP address. src/addons/OzzModz/CountryLogin/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php:175

    Generated by: member2891 Feb 27, 2022 at 6:05 PM

Stack trace

#0 src/addons/OzzModz/CountryLogin/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php(163): MaxMind\Db\Reader->findAddressInTree('159.87.155.161,...')
#1 src/addons/OzzModz/CountryLogin/vendor/geoip2/geoip2/src/Database/Reader.php(232): MaxMind\Db\Reader->getWithPrefixLen('159.87.155.161,...')
#2 src/addons/OzzModz/CountryLogin/vendor/geoip2/geoip2/src/Database/Reader.php(203): GeoIp2\Database\Reader->getRecord('Country', 'Country', '159.87.155.161,...')
#3 src/addons/OzzModz/CountryLogin/vendor/geoip2/geoip2/src/Database/Reader.php(88): GeoIp2\Database\Reader->modelFor('Country', 'Country', '159.87.155.161,...')
#4 src/addons/OzzModz/CountryLogin/Service/Logger.php(53): GeoIp2\Database\Reader->country('159.87.155.161,...')
#5 src/addons/OzzModz/CountryLogin/Service/Logger.php(30): OzzModz\CountryLogin\Service\Logger->getCountryCode()
#6 src/XF/Container.php(276): OzzModz\CountryLogin\Service\Logger->__construct(Object(XF\Pub\App), '159.87.155.161,...')
#7 src/XF/App.php(1708): XF\Container->createObject('OzzModz\\Country...', Array)
#8 src/XF/Container.php(234): XF\App->XF\{closure}('OzzModz\\Country...', Array, Object(XF\Container))
#9 src/XF/App.php(3021): XF\Container->create('service', 'OzzModz\\Country...', Array)
#10 src/addons/OzzModz/CountryLogin/Listener.php(33): XF\App->service('OzzModz\\Country...', '159.87.155.161,...')
#11 src/XF.php(370): OzzModz\CountryLogin\Listener::OzzModz\CountryLogin\{closure}()
#12 src/XF/Mvc/Dispatcher.php(158): XF::triggerRunOnce(true)
#13 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#15 src/XF.php(517): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}

Request state

array(4) {
  ["url"] => string(145) "/account/alerts-popup?_xfRequestUri=%2F&_xfWithData=1&_xfToken=1d41%2C300bd332esa7917aae7f654b&_xfResponseType=json&_=164601fasd66"
  ["referrer"] => string(34) "https://www.domain.com/"
  ["_GET"] => array(5) {
    ["_xfRequestUri"] => string(1) "/"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "164601,300bd332e5fe6a38"
    ["_xfResponseType"] => string(4) "json"
    ["_"] => string(13) "1646013948966"
  }
  ["_POST"] => array(0) {
  }
}
 
Seeing quite a few of these errors in the ACP after enabling CloudFlare. I updated to the latest DB, but it had no affect. Any ideas?

It looks like one of the addresses is being passed from a proxy.
Make sure your server is properly configured to restore visitor IP address from CloudFlare.


I have no experience with it, but the page says to add this lines to your config.php:

PHP:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
 
@Ozzy47 @Painbaker

Couple things :)

1) Is there a way to disable notifications for specific members? When sending a password reset, I see this in the changelog, but I can't seem to find the option anywhere in the UI.

1654802562995.webp

2) In ACP > Logs > Country login log, clicking the numbers to view additional pages takes you to the front page of the ACP (/admin.php?&page=2).

1654802744339.webp
 
1) Is there a way to disable notifications for specific members? When sending a password reset, I see this in the changelog, but I can't seem to find the option anywhere in the UI.


It should be located here:

1654853482222.webp


If you don't have it, there might be a template modification conflict.
Can you send me a saved page with "user_edit" template contents with all modifications applied?

To do this, you need to enable "Development" mode, then navigate to:
Appearance > Styles > Master style templates > Admin > user_edit > View {count} template modifications

Then save this page with the right mouse button.

I'll make the regex better to capture possible changes.
 
Ozzy47 updated [OzzModz] Login By Country Log with a new update entry:

[OzzModz] Login By Country Log for XenForo 2.1+ Update 2.1.0 Patch Level 3

2.1.0 Patch Level 1:

Added maxmind DB cron updater
Fix: mount own filesystem for local DB file (fixed incompatibility with external storage)
Fix: check only public app
Fix: hide alert preferences opt from not alerted users
Code refactor & cleanup

2.1.0 Patch Level 2:

Fixed ACP log pagination
Fixed regular expression for template modification to capture possible interference's by other add-ons

2.1.0 Patch Level 3

Fixed template modification conflict with DragonByte...

Read the rest of this update entry...
 
Just tried to upgrade and got this error :(

Code:
Server error log

    TypeError: Argument 2 passed to OzzModz\CountryLogin\Service\Logger::__construct() must be an instance of XF\Entity\User, string given, called in /home/domain/public/src/XF/Container.php on line 276 src/addons/OzzModz/CountryLogin/Service/Logger.php:35

    Generated by: Admin Jun 12, 2022 at 9:28 AM

Stack trace

#0 src/XF/Container.php(276): OzzModz\CountryLogin\Service\Logger->__construct(Object(XF\Admin\App), '67.160.185.224')
#1 src/XF/App.php(1709): XF\Container->createObject('OzzModz\\Country...', Array)
#2 src/XF/Container.php(234): XF\App->XF\{closure}('OzzModz\\Country...', Array, Object(XF\Container))
#3 src/XF/App.php(3022): XF\Container->create('service', 'OzzModz\\Country...', Array)
#4 src/addons/OzzModz/CountryLogin/Listener.php(33): XF\App->service('OzzModz\\Country...', '67.160.185.224')
#5 src/XF.php(377): OzzModz\CountryLogin\Listener::OzzModz\CountryLogin\{closure}()
#6 src/XF/Job/Manager.php(290): XF::triggerRunOnce()
#7 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#8 src/XF/Job/Manager.php(118): XF\Job\Manager->runJobEntry(Array, 8)
#9 src/XF/Admin/Controller/Tools.php(122): XF\Job\Manager->runByIds(Array, 8)
#10 src/XF/Mvc/Dispatcher.php(352): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(X0815\ChkTables\XF\Admin\Controller\Tools), NULL)
#12 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(X0815\ChkTables\XF\Admin\Controller\Tools), NULL)
#13 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
#15 src/XF.php(524): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}

Request state

array(4) {
  ["url"] => string(29) "/admin.php?tools/run-job"
  ["referrer"] => string(57) "https://domain/admin.php?tools/run-job"
  ["_GET"] => array(1) {
    ["tools/run-job"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["_xfRedirect"] => string(94) "https://domain.com/admin.php?add-ons/install-from-archive-complete&batch_id=380"
    ["_xfToken"] => string(8) "********"
    ["only_ids"] => string(5) "44893"
  }
}
 
@Joe Link, it looks like the Listener.php file was left from the old version :unsure:

Make sure all add-on files have been successfully replaced (or reupload files manually through FTP)
 
@Ozzy47 I just updated @digitalpoint's Cloudflare addon to 1.5.1 and I'm getting these errors in the console when trying to modify a phrase. The phrase does not save, and there is no error logged in the XF error log. Front end displayed the "Oops! We ran into some problems" message.

Code:
PHP: <br />
<b>Fatal error</b>: Declaration of OzzModz\CountryLogin\XF\FsMounts::loadDefaultMounts(array $config) must be compatible with DigitalPoint\Cloudflare\XF\FsMounts::loadDefaultMounts(array $config, $allowAdaptersNotInConfig = true) in <b>/home/nginx/domains/domain.com/public/xenforo/src/addons/OzzModz/CountryLogin/XF/FsMounts.php</b> on line <b>10</b><br />
core-compiled.js:43:78
    defaultAjaxError https://domain.com/xenforo/js/xf/core-compiled.js?_v=5d9b041b:43
    l https://domain.com/xenforo/js/xf/core-compiled.js?_v=5d9b041b:39
    jQuery 6
        c
        fireWith
        l
        o
        (Async: EventHandlerNonNull)
    send
        ajax
    ajax https://domain.com/xenforo/js/xf/core-compiled.js?_v=5d9b041b:41
    submit https://domain.com/xenforo/js/xf/core-compiled.js?_v=5d9b041b:235
    (Async: setTimeout handler)
    submit https://domain.com/xenforo/js/xf/core-compiled.js?_v=5d9b041b:235
    proxy https://domain.com/xenforo/js/xf/core-compiled.js?_v=5d9b041b:73
    jQuery 2
        dispatch
        handle

Trying to disable this addon, I get this error.

Code:
Fatal error: Declaration of OzzModz\CountryLogin\XF\FsMounts::loadDefaultMounts(array $config) must be compatible with DigitalPoint\Cloudflare\XF\FsMounts::loadDefaultMounts(array $config, $allowAdaptersNotInConfig = true) in /home/nginx/domains/domain.com/public/xenforo/src/addons/OzzModz/CountryLogin/XF/FsMounts.php on line 10

Trying to disable the Cloudflare addon works.
 
Top Bottom