Page tree
Skip to end of metadata
Go to start of metadata

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:

    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:

  • No labels