Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

By default the module uses Maxmind to determine the country of the IP. It is possible that you add your own lookup providers and then select them in the module configuration.

In this example, we name our new IP lookup provider "iplocation".

  1. Create a new directory for your lookup provider: /addons/adminloginnotify/providers/iplocation
  2. Create a new php file: /addons/adminloginnotify/providers/iplocation/iplocation.php
  3. In the newly created file, you need to insert following function which get called by the module:

    Code Block
    function iplocation_run ($ip) {    
        return $country->isoCode;
    }

    The function receives the IP of the admin as a function argument and your function must return the ISO code from the country, e.g. US, UK, etc.

After creating your own IP lookup provider, you can select the new service in the module settings via a dropdown:

Image Added