Closed (works as designed)
Project:
IP Anonymize
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2011 at 07:06 UTC
Updated:
16 Feb 2017 at 16:17 UTC
Jump to comment: Most recent
Comments
Comment #1
mfbAs far as I can tell, settings.php always executes before ip_address() is called, initializing the $ip_address static variable. Thus you should be able to use this snippet in settings.php, where you are not modifying Drupal code.
Comment #2
mfbThe only problem with this code snippet is that it breaks Drupal core's flood control (all login attempts, contact form submissions, etc. appear to be on one IP address), so is not recommended unless you know what you're doing :)
Comment #3
owen barton commentedThere is a patch at http://drupal.org/node/126197#comment-6091310 that takes this approach, but breaks flood control in the opposite direction (i.e. stops it triggering rather than blocking all users) by giving all users a random IP for each request.
Comment #4
mfbI just uploaded Cryptolog module - https://drupal.org/project/cryptolog - which replaces $_SERVER['REMOTE_ADDR'] with a Base64-encoded HMAC of the IP address, using a random salt which is stored in memory and regenerated each day.
It of course needs to be executed in early bootstrap, but I packaged it as a module so it can be updated. It is enabled by adding
$conf['cache_backends'][] = 'sites/all/modules/cryptolog/cryptolog.inc';at the bottom of settings.php.Comment #5
Codenext commented@mfb
Hi, Addressing to Comment#4,
In your comment you have mentioned,
Could you please let us know that, do we need to use this line after installing cryptolog module. Or just we need to install module enable it and it is good to go. I'm using it in Drupal 8 site.
Much Thanks,
Comment #6
mfb@Codenext cryptolog module should work fine on Drupal 8 by simply installing it. The settings.php file tweak was only necessary in Drupal 7.
Comment #7
Codenext commented@mfb Thanks for information and clarification, much appreciated, sorry for late reply, was away from internet.