Inability to select mod_geoip on settings page when using localhost

Created on 7 January 2014, almost 11 years ago
Updated 28 November 2024, 24 days ago

Hi,

To activate the selection of a local maxmind binary on one's localhost (development machine) is currently not possible since the smart_ip.admin.inc file's validation function (smart_ip_admin_settings_validate) checks that $_SERVER['GEOIP_COUNTRY_NAME'] has been set, which of course won't work for 127.0.0.1 (localhost).

if ($form_state['values']['smart_ip_source'] == 'mod_geoip' && !isset($_SERVER['GEOIP_COUNTRY_NAME'])) {
   form_set_error('smart_ip_source', t("Maxmind's Apache module mod_geoip is not installed in your server."));
  }

While in a way it is good to test from the outset that mod_geoip is working the error information is rather presumptious and the default action prevents quick toggling of IP database selection on a development machine.

Maybe it would be helpful to indicate on the form that attempted activation on a localhost will fail. The warning may be rectified to indicate that mod_geoip may not be installed properly or the option was attempted on localhost.

[In my case I just commented out the validation above once I manually confirmed that $_SERVER['GEOIP_COUNTRY_NAME'] (and the other desired $_SERVER variables) were loading.)

Cheers

Feature request
Status

Closed: outdated

Version

2.2

Component

User interface

Created by

🇦🇺Australia cmonnow

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • heddn Nicaragua

    Drupal 7 is no longer supported in a month. Closing old issues. If this is still something you want addressed in the current 5.x version of the module, please re-open and provide some next steps.

Production build 0.71.5 2024