Subnet matching

Created on 7 September 2011, over 13 years ago
Updated 25 November 2024, 5 months ago

Thanks for this module, and especially for the 2.x version.
I've some issues with it I'll try to solve (see #1271756: Wrong links to user account pages on subsites and User ordering when multiple matches exists Closed: outdated ).

I needed subnet matching (see CIDR notation) in my project.
I've modified the ip_login_check() function to use ip2long. I think it allows better validation and matching.

Using the patch below you can specify the following address patterns:

  • Single IPv4 address
  • * wildcard, e.g. 192.168.100.*
  • IPv4 address range in the form of IP1 - IP2, e.g. 192.168.100.1 - 192.172.200.1
  • and finally, my favorite: IPv4 subnet in the form of 192.168.100.1/16

Patch file attached and needs to be reviewed.

Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇭🇺Hungary mtcs

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.

Production build 0.71.5 2024