This module allows to add field to content types containing author IP address.
IP address saves only on creating content.
If your site behind reverse proxy (for example varnish, nginx) you need to setup Reverse Proxy Configuration in settings.php for correct detecting ip address.
How to use
- Download and enable module User IP Address
- Add field "User IP address" to content type
Important:
By default this field is visible for all visitors. If your visitors don't need to see this field you need to hide this field on content type display page.
Thats all. After every node creation this field will contain user ip address.
I did't find any modules that implement this functionality.
Project page
git
git clone --branch 7.x-1.x drupaladmin@git.drupal.org:sandbox/drupaladmin/2191469.git user_ip_address
Comments
Comment #1
dr.admin commentedComment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxdrupaladmin2191469git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
dr.admin commentedFixed all errors and added README.TXT
Comment #4
gaurav_varshney commentedHi dr.admin,
1. There should onle blank line after the php tag in both the .install and .module file.
2. There is no need to take the variables like $columns and $indexes in .install file you can directly assign the array of these to the "columns" and "indexes" key where you return the array.
3.
t('IP address must be in format a.b.c.d : @ip', array('ip' => $item['user_ip_address']))it should be like thatt('IP address must be in format a.b.c.d : @ip', array('@ip' => $item['user_ip_address']))4. Remove the one blank line from the function user_ip_address_field_is_empty() and user_ip_address_field_formatter_info()
Comment #5
gaurav_varshney commentedComment #6
pushpinderchauhan commented@dr.admin, thank you for your work and contribution.
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. None.
Manual Review
Case 1: If user select Required field then following issue will come at node save.
Error at node save:
Case 2: If user select Unlimited option for Number of values then following issue will come at node save.


Unable to use this field, but it is visible.
So there is two way to solve this issue, either you explicitly mention this in your documentation (Project Page or Readme.txt etc) or fix these by making these option disabled for this field.
user_ip_address_field_formatter_view(): the switch() statement does not make sense here since you only have one case? Use if() instead? Same apply foruser_ip_address_field_widget_form().The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)
Nice module. thanks again!
Comment #7
kalabroHi Roman!
Thanks for your contribution!
I have a couple of questions about “User IP address” module:
Code is clean! Good job!
Best,
Kate
Comment #8
sin commentedHi, very useful module :)
Manual Review
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
This review uses the Project Application Review Template.
Comment #9
dr.admin commentedHi, gaurav_varshney!
Thank you for review. I fixed all issues.
Fixed
Fixed
Fixed
Fixed
Comment #10
dr.admin commentedComment #11
dr.admin commentedHi, er.pushpinderrana
Thank you for review.
Fixed
Also i fixed Case1 and Case2 - i implement hook_form_alter and disable this field.
Fixed
Fixed
Comment #12
dr.admin commentedHi, Kate!
Thank you for your questions:)
1. You right, it is good feature, but it will work only with enabled revisions. I don't have expirience with revisions, i think i will try to implement this feature later.
2. Yes, i use this module to analyze anonymous reviews for fake on projects 23med.ru and roskliniki.ru.
3. I tried to contact with maintainer and created feature request https://www.drupal.org/node/2321115 to discuss this, but noone answered. I think this module will be usefull as standalone project.
Comment #13
dr.admin commentedHi, Sergey!
Thank you for review:)
I fixed your issues.
Fixed
1. Fixed. I added notes in Readme.txt and on project page.
2. Fixed. I removed code for widget form and validation.
3. Fixed. I removed unnecessary code from presave.
4. Fixed.
5. Ok, fixed, http://pareview.sh/pareview/httpgitdrupalorgsandboxdrupaladmin2191469git
6. I didn't add version, because on http://pareview.sh/ i have warning:
Remove "version" from the ./user_ip_address.info file, it will be added by drupal.org packaging automatically.
Comment #14
dr.admin commentedComment #15
sin commentedLooks like you addressed all the issues, changing to RTBC.
Comment #16
kscheirerNon-blocking issues:
Blocking issues:
This is an important criterion so that code integrates well and can be improved over time. I encourage you to continue developing and gaining from the feedback available in the git approval process.
Thank you for you contributions and understanding. Please indicate if you would like this project to be promoted by itself, without granting any user "git vetted user" status, or if you disagree with this opinion please provide detail.
Comment #17
dr.admin commentedFixed: In user_ip_address_help(), use single quotes where possible for Drupal code standards and a very slight performance benefit
Thank you, please promote to a full project.
Comment #18
kscheirerThanks for your contribution, dr.admin, this module has been promoted to a full project! https://www.drupal.org/project/user_ip_address
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.