Collect IP addresses of submissions, taking into account proxies
This modules allows messages generated from user form submissions to include an OriginatingIP
, on a per-recipient basis.
composer require nswdpc/silverstripe-userforms-ipcollection
After installation:
<% if $OriginatingIP %>
<p>Originating IP: {$OriginatingIP}</p>
<% end_if %>
With the same for plain-text templates.
The Originating IP may not be a single IP address, for instance it could include any number of proxy IPs.
By default, the module will attempt to get an IP first from the Cloudflare CF-Connecting-IP
header, then from the X-Forwarded-For
header. If you don't use Cloudflare, it's unlikely that this header will be present and so it will be ignored.
You can modify the priority and expected headers in project configuration:
---
Name: 'reset-userforms-ipcollection'
After:
- '#nswdpc-userforms-ipcollection'
# reset IP
NSWDPC\UserForms\IpCollection\IP:
ip_priority: []
---
Name: 'app-userforms-ipcollection'
After:
- '#reset-userforms-ipcollection'
---
# Set project-based IP priorities
NSWDPC\UserForms\IpCollection\IP:
ip_priority:
- 'SOME_OTHER_HEADER'
- 'X_FORWARDED_FOR'
We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.
Please review the code of conduct prior to opening a new issue.
If you have found a security issue with this module, please email digital[@]dpc.nsw.gov.au in the first instance, detailing your findings.
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
Please review the code of conduct prior to completing a pull request.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem