11 Commits
Author SHA1 Message Date
Nihaal Shaikh 06a5f9c8c9 Fix #2 - Reject IP addresses that Moodle cannot match
The custom IP field and the predefined ranges form accepted invalid
entries such as 2001:db8::1garbage, 192.168.1.0/24garbage or
192.168.1.0/999. address_in_subnet() silently skips those entries, so a
"must not" restriction with a typo let blocked users in.

Validation now only accepts formats address_in_subnet() can match: a
single address, a subnet (mask 0-32 / 0-128) or a range in the last
group with end >= start. IPv6 forms cleanremoteaddr() cannot parse are
rejected as well. JS and PHP share the same rules; PHP also checks each
entry against address_in_subnet() as a safety net.

- Allow spaces after commas in the restriction field
- Support IPv6 ranges, e.g. 2001:db8::1-ff
- Add PHPUnit tests for helper::is_valid_ipaddress_list()
- Bump version to 2026101500 (5.3.2)
2026-10-15 09:04:58 +02:00
Vincent Cornelis 15ba2b295b Update #86c46bd0u - Add language string depending on _not_ setting 2025-09-19 13:44:36 +02:00
Vincent Cornelis fe3a5b2302 Update #86c46bd0u - Add support for predefined IP addresses/ranges 2025-08-04 17:38:30 +02:00
Luuk Verhoeven c2f5e7e22c Update language file for phpcs 2024-07-20 22:54:06 +02:00
Juan Pablo de Castro (UVa) e44acd4a7f Support ipv4 ranges. 2022-02-01 08:41:47 +00:00
Vincent Cornelis 28f6d4603b added end-of-lines 2021-12-09 13:42:54 +01:00
Luuk Verhoeven 6c92077941 Add privacy provider. 2019-05-21 14:48:00 +02:00
Luuk Verhoeven 515a6954e5 Update code style 2019-05-14 20:16:54 +02:00
Luuk Verhoeven ee0784d146 Init base structure 2019-05-14 19:55:34 +02:00
Luuk Verhoeven 738c2af2d5 Init 2019-05-14 12:26:15 +02:00
Luuk Verhoeven 3542e7a7d0 first commit 2019-05-14 12:25:43 +02:00